compute-gen.go 4.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107
  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package compute provides access to the Compute Engine API.
  6. //
  7. // See https://developers.google.com/compute/docs/reference/latest/
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/compute/v1"
  12. // ...
  13. // computeService, err := compute.New(oauthHttpClient)
  14. package compute // import "google.golang.org/api/compute/v1"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "compute:v1"
  43. const apiName = "compute"
  44. const apiVersion = "v1"
  45. const basePath = "https://www.googleapis.com/compute/v1/projects/"
  46. // OAuth2 scopes used by this API.
  47. const (
  48. // View and manage your data across Google Cloud Platform services
  49. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  50. // View and manage your Google Compute Engine resources
  51. ComputeScope = "https://www.googleapis.com/auth/compute"
  52. // View your Google Compute Engine resources
  53. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  54. // Manage your data and permissions in Google Cloud Storage
  55. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  56. // View your data in Google Cloud Storage
  57. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  58. // Manage your data in Google Cloud Storage
  59. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  60. )
  61. func New(client *http.Client) (*Service, error) {
  62. if client == nil {
  63. return nil, errors.New("client is nil")
  64. }
  65. s := &Service{client: client, BasePath: basePath}
  66. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  67. s.Addresses = NewAddressesService(s)
  68. s.Autoscalers = NewAutoscalersService(s)
  69. s.BackendBuckets = NewBackendBucketsService(s)
  70. s.BackendServices = NewBackendServicesService(s)
  71. s.DiskTypes = NewDiskTypesService(s)
  72. s.Disks = NewDisksService(s)
  73. s.Firewalls = NewFirewallsService(s)
  74. s.ForwardingRules = NewForwardingRulesService(s)
  75. s.GlobalAddresses = NewGlobalAddressesService(s)
  76. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  77. s.GlobalOperations = NewGlobalOperationsService(s)
  78. s.HealthChecks = NewHealthChecksService(s)
  79. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  80. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  81. s.Images = NewImagesService(s)
  82. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  83. s.InstanceGroups = NewInstanceGroupsService(s)
  84. s.InstanceTemplates = NewInstanceTemplatesService(s)
  85. s.Instances = NewInstancesService(s)
  86. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  87. s.InterconnectLocations = NewInterconnectLocationsService(s)
  88. s.Interconnects = NewInterconnectsService(s)
  89. s.LicenseCodes = NewLicenseCodesService(s)
  90. s.Licenses = NewLicensesService(s)
  91. s.MachineTypes = NewMachineTypesService(s)
  92. s.Networks = NewNetworksService(s)
  93. s.NodeGroups = NewNodeGroupsService(s)
  94. s.NodeTemplates = NewNodeTemplatesService(s)
  95. s.NodeTypes = NewNodeTypesService(s)
  96. s.Projects = NewProjectsService(s)
  97. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  98. s.RegionBackendServices = NewRegionBackendServicesService(s)
  99. s.RegionCommitments = NewRegionCommitmentsService(s)
  100. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  101. s.RegionDisks = NewRegionDisksService(s)
  102. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  103. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  104. s.RegionOperations = NewRegionOperationsService(s)
  105. s.Regions = NewRegionsService(s)
  106. s.Routers = NewRoutersService(s)
  107. s.Routes = NewRoutesService(s)
  108. s.SecurityPolicies = NewSecurityPoliciesService(s)
  109. s.Snapshots = NewSnapshotsService(s)
  110. s.SslCertificates = NewSslCertificatesService(s)
  111. s.SslPolicies = NewSslPoliciesService(s)
  112. s.Subnetworks = NewSubnetworksService(s)
  113. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  114. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  115. s.TargetInstances = NewTargetInstancesService(s)
  116. s.TargetPools = NewTargetPoolsService(s)
  117. s.TargetSslProxies = NewTargetSslProxiesService(s)
  118. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  119. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  120. s.UrlMaps = NewUrlMapsService(s)
  121. s.VpnTunnels = NewVpnTunnelsService(s)
  122. s.ZoneOperations = NewZoneOperationsService(s)
  123. s.Zones = NewZonesService(s)
  124. return s, nil
  125. }
  126. type Service struct {
  127. client *http.Client
  128. BasePath string // API endpoint base URL
  129. UserAgent string // optional additional User-Agent fragment
  130. AcceleratorTypes *AcceleratorTypesService
  131. Addresses *AddressesService
  132. Autoscalers *AutoscalersService
  133. BackendBuckets *BackendBucketsService
  134. BackendServices *BackendServicesService
  135. DiskTypes *DiskTypesService
  136. Disks *DisksService
  137. Firewalls *FirewallsService
  138. ForwardingRules *ForwardingRulesService
  139. GlobalAddresses *GlobalAddressesService
  140. GlobalForwardingRules *GlobalForwardingRulesService
  141. GlobalOperations *GlobalOperationsService
  142. HealthChecks *HealthChecksService
  143. HttpHealthChecks *HttpHealthChecksService
  144. HttpsHealthChecks *HttpsHealthChecksService
  145. Images *ImagesService
  146. InstanceGroupManagers *InstanceGroupManagersService
  147. InstanceGroups *InstanceGroupsService
  148. InstanceTemplates *InstanceTemplatesService
  149. Instances *InstancesService
  150. InterconnectAttachments *InterconnectAttachmentsService
  151. InterconnectLocations *InterconnectLocationsService
  152. Interconnects *InterconnectsService
  153. LicenseCodes *LicenseCodesService
  154. Licenses *LicensesService
  155. MachineTypes *MachineTypesService
  156. Networks *NetworksService
  157. NodeGroups *NodeGroupsService
  158. NodeTemplates *NodeTemplatesService
  159. NodeTypes *NodeTypesService
  160. Projects *ProjectsService
  161. RegionAutoscalers *RegionAutoscalersService
  162. RegionBackendServices *RegionBackendServicesService
  163. RegionCommitments *RegionCommitmentsService
  164. RegionDiskTypes *RegionDiskTypesService
  165. RegionDisks *RegionDisksService
  166. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  167. RegionInstanceGroups *RegionInstanceGroupsService
  168. RegionOperations *RegionOperationsService
  169. Regions *RegionsService
  170. Routers *RoutersService
  171. Routes *RoutesService
  172. SecurityPolicies *SecurityPoliciesService
  173. Snapshots *SnapshotsService
  174. SslCertificates *SslCertificatesService
  175. SslPolicies *SslPoliciesService
  176. Subnetworks *SubnetworksService
  177. TargetHttpProxies *TargetHttpProxiesService
  178. TargetHttpsProxies *TargetHttpsProxiesService
  179. TargetInstances *TargetInstancesService
  180. TargetPools *TargetPoolsService
  181. TargetSslProxies *TargetSslProxiesService
  182. TargetTcpProxies *TargetTcpProxiesService
  183. TargetVpnGateways *TargetVpnGatewaysService
  184. UrlMaps *UrlMapsService
  185. VpnTunnels *VpnTunnelsService
  186. ZoneOperations *ZoneOperationsService
  187. Zones *ZonesService
  188. }
  189. func (s *Service) userAgent() string {
  190. if s.UserAgent == "" {
  191. return googleapi.UserAgent
  192. }
  193. return googleapi.UserAgent + " " + s.UserAgent
  194. }
  195. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  196. rs := &AcceleratorTypesService{s: s}
  197. return rs
  198. }
  199. type AcceleratorTypesService struct {
  200. s *Service
  201. }
  202. func NewAddressesService(s *Service) *AddressesService {
  203. rs := &AddressesService{s: s}
  204. return rs
  205. }
  206. type AddressesService struct {
  207. s *Service
  208. }
  209. func NewAutoscalersService(s *Service) *AutoscalersService {
  210. rs := &AutoscalersService{s: s}
  211. return rs
  212. }
  213. type AutoscalersService struct {
  214. s *Service
  215. }
  216. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  217. rs := &BackendBucketsService{s: s}
  218. return rs
  219. }
  220. type BackendBucketsService struct {
  221. s *Service
  222. }
  223. func NewBackendServicesService(s *Service) *BackendServicesService {
  224. rs := &BackendServicesService{s: s}
  225. return rs
  226. }
  227. type BackendServicesService struct {
  228. s *Service
  229. }
  230. func NewDiskTypesService(s *Service) *DiskTypesService {
  231. rs := &DiskTypesService{s: s}
  232. return rs
  233. }
  234. type DiskTypesService struct {
  235. s *Service
  236. }
  237. func NewDisksService(s *Service) *DisksService {
  238. rs := &DisksService{s: s}
  239. return rs
  240. }
  241. type DisksService struct {
  242. s *Service
  243. }
  244. func NewFirewallsService(s *Service) *FirewallsService {
  245. rs := &FirewallsService{s: s}
  246. return rs
  247. }
  248. type FirewallsService struct {
  249. s *Service
  250. }
  251. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  252. rs := &ForwardingRulesService{s: s}
  253. return rs
  254. }
  255. type ForwardingRulesService struct {
  256. s *Service
  257. }
  258. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  259. rs := &GlobalAddressesService{s: s}
  260. return rs
  261. }
  262. type GlobalAddressesService struct {
  263. s *Service
  264. }
  265. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  266. rs := &GlobalForwardingRulesService{s: s}
  267. return rs
  268. }
  269. type GlobalForwardingRulesService struct {
  270. s *Service
  271. }
  272. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  273. rs := &GlobalOperationsService{s: s}
  274. return rs
  275. }
  276. type GlobalOperationsService struct {
  277. s *Service
  278. }
  279. func NewHealthChecksService(s *Service) *HealthChecksService {
  280. rs := &HealthChecksService{s: s}
  281. return rs
  282. }
  283. type HealthChecksService struct {
  284. s *Service
  285. }
  286. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  287. rs := &HttpHealthChecksService{s: s}
  288. return rs
  289. }
  290. type HttpHealthChecksService struct {
  291. s *Service
  292. }
  293. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  294. rs := &HttpsHealthChecksService{s: s}
  295. return rs
  296. }
  297. type HttpsHealthChecksService struct {
  298. s *Service
  299. }
  300. func NewImagesService(s *Service) *ImagesService {
  301. rs := &ImagesService{s: s}
  302. return rs
  303. }
  304. type ImagesService struct {
  305. s *Service
  306. }
  307. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  308. rs := &InstanceGroupManagersService{s: s}
  309. return rs
  310. }
  311. type InstanceGroupManagersService struct {
  312. s *Service
  313. }
  314. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  315. rs := &InstanceGroupsService{s: s}
  316. return rs
  317. }
  318. type InstanceGroupsService struct {
  319. s *Service
  320. }
  321. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  322. rs := &InstanceTemplatesService{s: s}
  323. return rs
  324. }
  325. type InstanceTemplatesService struct {
  326. s *Service
  327. }
  328. func NewInstancesService(s *Service) *InstancesService {
  329. rs := &InstancesService{s: s}
  330. return rs
  331. }
  332. type InstancesService struct {
  333. s *Service
  334. }
  335. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  336. rs := &InterconnectAttachmentsService{s: s}
  337. return rs
  338. }
  339. type InterconnectAttachmentsService struct {
  340. s *Service
  341. }
  342. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  343. rs := &InterconnectLocationsService{s: s}
  344. return rs
  345. }
  346. type InterconnectLocationsService struct {
  347. s *Service
  348. }
  349. func NewInterconnectsService(s *Service) *InterconnectsService {
  350. rs := &InterconnectsService{s: s}
  351. return rs
  352. }
  353. type InterconnectsService struct {
  354. s *Service
  355. }
  356. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  357. rs := &LicenseCodesService{s: s}
  358. return rs
  359. }
  360. type LicenseCodesService struct {
  361. s *Service
  362. }
  363. func NewLicensesService(s *Service) *LicensesService {
  364. rs := &LicensesService{s: s}
  365. return rs
  366. }
  367. type LicensesService struct {
  368. s *Service
  369. }
  370. func NewMachineTypesService(s *Service) *MachineTypesService {
  371. rs := &MachineTypesService{s: s}
  372. return rs
  373. }
  374. type MachineTypesService struct {
  375. s *Service
  376. }
  377. func NewNetworksService(s *Service) *NetworksService {
  378. rs := &NetworksService{s: s}
  379. return rs
  380. }
  381. type NetworksService struct {
  382. s *Service
  383. }
  384. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  385. rs := &NodeGroupsService{s: s}
  386. return rs
  387. }
  388. type NodeGroupsService struct {
  389. s *Service
  390. }
  391. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  392. rs := &NodeTemplatesService{s: s}
  393. return rs
  394. }
  395. type NodeTemplatesService struct {
  396. s *Service
  397. }
  398. func NewNodeTypesService(s *Service) *NodeTypesService {
  399. rs := &NodeTypesService{s: s}
  400. return rs
  401. }
  402. type NodeTypesService struct {
  403. s *Service
  404. }
  405. func NewProjectsService(s *Service) *ProjectsService {
  406. rs := &ProjectsService{s: s}
  407. return rs
  408. }
  409. type ProjectsService struct {
  410. s *Service
  411. }
  412. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  413. rs := &RegionAutoscalersService{s: s}
  414. return rs
  415. }
  416. type RegionAutoscalersService struct {
  417. s *Service
  418. }
  419. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  420. rs := &RegionBackendServicesService{s: s}
  421. return rs
  422. }
  423. type RegionBackendServicesService struct {
  424. s *Service
  425. }
  426. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  427. rs := &RegionCommitmentsService{s: s}
  428. return rs
  429. }
  430. type RegionCommitmentsService struct {
  431. s *Service
  432. }
  433. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  434. rs := &RegionDiskTypesService{s: s}
  435. return rs
  436. }
  437. type RegionDiskTypesService struct {
  438. s *Service
  439. }
  440. func NewRegionDisksService(s *Service) *RegionDisksService {
  441. rs := &RegionDisksService{s: s}
  442. return rs
  443. }
  444. type RegionDisksService struct {
  445. s *Service
  446. }
  447. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  448. rs := &RegionInstanceGroupManagersService{s: s}
  449. return rs
  450. }
  451. type RegionInstanceGroupManagersService struct {
  452. s *Service
  453. }
  454. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  455. rs := &RegionInstanceGroupsService{s: s}
  456. return rs
  457. }
  458. type RegionInstanceGroupsService struct {
  459. s *Service
  460. }
  461. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  462. rs := &RegionOperationsService{s: s}
  463. return rs
  464. }
  465. type RegionOperationsService struct {
  466. s *Service
  467. }
  468. func NewRegionsService(s *Service) *RegionsService {
  469. rs := &RegionsService{s: s}
  470. return rs
  471. }
  472. type RegionsService struct {
  473. s *Service
  474. }
  475. func NewRoutersService(s *Service) *RoutersService {
  476. rs := &RoutersService{s: s}
  477. return rs
  478. }
  479. type RoutersService struct {
  480. s *Service
  481. }
  482. func NewRoutesService(s *Service) *RoutesService {
  483. rs := &RoutesService{s: s}
  484. return rs
  485. }
  486. type RoutesService struct {
  487. s *Service
  488. }
  489. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  490. rs := &SecurityPoliciesService{s: s}
  491. return rs
  492. }
  493. type SecurityPoliciesService struct {
  494. s *Service
  495. }
  496. func NewSnapshotsService(s *Service) *SnapshotsService {
  497. rs := &SnapshotsService{s: s}
  498. return rs
  499. }
  500. type SnapshotsService struct {
  501. s *Service
  502. }
  503. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  504. rs := &SslCertificatesService{s: s}
  505. return rs
  506. }
  507. type SslCertificatesService struct {
  508. s *Service
  509. }
  510. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  511. rs := &SslPoliciesService{s: s}
  512. return rs
  513. }
  514. type SslPoliciesService struct {
  515. s *Service
  516. }
  517. func NewSubnetworksService(s *Service) *SubnetworksService {
  518. rs := &SubnetworksService{s: s}
  519. return rs
  520. }
  521. type SubnetworksService struct {
  522. s *Service
  523. }
  524. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  525. rs := &TargetHttpProxiesService{s: s}
  526. return rs
  527. }
  528. type TargetHttpProxiesService struct {
  529. s *Service
  530. }
  531. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  532. rs := &TargetHttpsProxiesService{s: s}
  533. return rs
  534. }
  535. type TargetHttpsProxiesService struct {
  536. s *Service
  537. }
  538. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  539. rs := &TargetInstancesService{s: s}
  540. return rs
  541. }
  542. type TargetInstancesService struct {
  543. s *Service
  544. }
  545. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  546. rs := &TargetPoolsService{s: s}
  547. return rs
  548. }
  549. type TargetPoolsService struct {
  550. s *Service
  551. }
  552. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  553. rs := &TargetSslProxiesService{s: s}
  554. return rs
  555. }
  556. type TargetSslProxiesService struct {
  557. s *Service
  558. }
  559. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  560. rs := &TargetTcpProxiesService{s: s}
  561. return rs
  562. }
  563. type TargetTcpProxiesService struct {
  564. s *Service
  565. }
  566. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  567. rs := &TargetVpnGatewaysService{s: s}
  568. return rs
  569. }
  570. type TargetVpnGatewaysService struct {
  571. s *Service
  572. }
  573. func NewUrlMapsService(s *Service) *UrlMapsService {
  574. rs := &UrlMapsService{s: s}
  575. return rs
  576. }
  577. type UrlMapsService struct {
  578. s *Service
  579. }
  580. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  581. rs := &VpnTunnelsService{s: s}
  582. return rs
  583. }
  584. type VpnTunnelsService struct {
  585. s *Service
  586. }
  587. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  588. rs := &ZoneOperationsService{s: s}
  589. return rs
  590. }
  591. type ZoneOperationsService struct {
  592. s *Service
  593. }
  594. func NewZonesService(s *Service) *ZonesService {
  595. rs := &ZonesService{s: s}
  596. return rs
  597. }
  598. type ZonesService struct {
  599. s *Service
  600. }
  601. // AcceleratorConfig: A specification of the type and number of
  602. // accelerator cards attached to the instance.
  603. type AcceleratorConfig struct {
  604. // AcceleratorCount: The number of the guest accelerator cards exposed
  605. // to this instance.
  606. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  607. // AcceleratorType: Full or partial URL of the accelerator type resource
  608. // to attach to this instance. If you are creating an instance template,
  609. // specify only the accelerator name.
  610. AcceleratorType string `json:"acceleratorType,omitempty"`
  611. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  612. // unconditionally include in API requests. By default, fields with
  613. // empty values are omitted from API requests. However, any non-pointer,
  614. // non-interface field appearing in ForceSendFields will be sent to the
  615. // server regardless of whether the field is empty or not. This may be
  616. // used to include empty fields in Patch requests.
  617. ForceSendFields []string `json:"-"`
  618. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  619. // include in API requests with the JSON null value. By default, fields
  620. // with empty values are omitted from API requests. However, any field
  621. // with an empty value appearing in NullFields will be sent to the
  622. // server as null. It is an error if a field in this list has a
  623. // non-empty value. This may be used to include null fields in Patch
  624. // requests.
  625. NullFields []string `json:"-"`
  626. }
  627. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  628. type NoMethod AcceleratorConfig
  629. raw := NoMethod(*s)
  630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  631. }
  632. // AcceleratorType: An Accelerator Type resource. (== resource_for
  633. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  634. type AcceleratorType struct {
  635. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  636. // format.
  637. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  638. // Deprecated: [Output Only] The deprecation status associated with this
  639. // accelerator type.
  640. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  641. // Description: [Output Only] An optional textual description of the
  642. // resource.
  643. Description string `json:"description,omitempty"`
  644. // Id: [Output Only] The unique identifier for the resource. This
  645. // identifier is defined by the server.
  646. Id uint64 `json:"id,omitempty,string"`
  647. // Kind: [Output Only] The type of the resource. Always
  648. // compute#acceleratorType for accelerator types.
  649. Kind string `json:"kind,omitempty"`
  650. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  651. // allowed per instance.
  652. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  653. // Name: [Output Only] Name of the resource.
  654. Name string `json:"name,omitempty"`
  655. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  656. // resource.
  657. SelfLink string `json:"selfLink,omitempty"`
  658. // Zone: [Output Only] The name of the zone where the accelerator type
  659. // resides, such as us-central1-a. You must specify this field as part
  660. // of the HTTP request URL. It is not settable as a field in the request
  661. // body.
  662. Zone string `json:"zone,omitempty"`
  663. // ServerResponse contains the HTTP response code and headers from the
  664. // server.
  665. googleapi.ServerResponse `json:"-"`
  666. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  667. // to unconditionally include in API requests. By default, fields with
  668. // empty values are omitted from API requests. However, any non-pointer,
  669. // non-interface field appearing in ForceSendFields will be sent to the
  670. // server regardless of whether the field is empty or not. This may be
  671. // used to include empty fields in Patch requests.
  672. ForceSendFields []string `json:"-"`
  673. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  674. // include in API requests with the JSON null value. By default, fields
  675. // with empty values are omitted from API requests. However, any field
  676. // with an empty value appearing in NullFields will be sent to the
  677. // server as null. It is an error if a field in this list has a
  678. // non-empty value. This may be used to include null fields in Patch
  679. // requests.
  680. NullFields []string `json:"-"`
  681. }
  682. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  683. type NoMethod AcceleratorType
  684. raw := NoMethod(*s)
  685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  686. }
  687. type AcceleratorTypeAggregatedList struct {
  688. // Id: [Output Only] Unique identifier for the resource; defined by the
  689. // server.
  690. Id string `json:"id,omitempty"`
  691. // Items: A list of AcceleratorTypesScopedList resources.
  692. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  693. // Kind: [Output Only] Type of resource. Always
  694. // compute#acceleratorTypeAggregatedList for aggregated lists of
  695. // accelerator types.
  696. Kind string `json:"kind,omitempty"`
  697. // NextPageToken: [Output Only] This token allows you to get the next
  698. // page of results for list requests. If the number of results is larger
  699. // than maxResults, use the nextPageToken as a value for the query
  700. // parameter pageToken in the next list request. Subsequent list
  701. // requests will have their own nextPageToken to continue paging through
  702. // the results.
  703. NextPageToken string `json:"nextPageToken,omitempty"`
  704. // SelfLink: [Output Only] Server-defined URL for this resource.
  705. SelfLink string `json:"selfLink,omitempty"`
  706. // Warning: [Output Only] Informational warning message.
  707. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  708. // ServerResponse contains the HTTP response code and headers from the
  709. // server.
  710. googleapi.ServerResponse `json:"-"`
  711. // ForceSendFields is a list of field names (e.g. "Id") to
  712. // unconditionally include in API requests. By default, fields with
  713. // empty values are omitted from API requests. However, any non-pointer,
  714. // non-interface field appearing in ForceSendFields will be sent to the
  715. // server regardless of whether the field is empty or not. This may be
  716. // used to include empty fields in Patch requests.
  717. ForceSendFields []string `json:"-"`
  718. // NullFields is a list of field names (e.g. "Id") to include in API
  719. // requests with the JSON null value. By default, fields with empty
  720. // values are omitted from API requests. However, any field with an
  721. // empty value appearing in NullFields will be sent to the server as
  722. // null. It is an error if a field in this list has a non-empty value.
  723. // This may be used to include null fields in Patch requests.
  724. NullFields []string `json:"-"`
  725. }
  726. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  727. type NoMethod AcceleratorTypeAggregatedList
  728. raw := NoMethod(*s)
  729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  730. }
  731. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  732. // warning message.
  733. type AcceleratorTypeAggregatedListWarning struct {
  734. // Code: [Output Only] A warning code, if applicable. For example,
  735. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  736. // the response.
  737. //
  738. // Possible values:
  739. // "CLEANUP_FAILED"
  740. // "DEPRECATED_RESOURCE_USED"
  741. // "DEPRECATED_TYPE_USED"
  742. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  743. // "EXPERIMENTAL_TYPE_USED"
  744. // "EXTERNAL_API_WARNING"
  745. // "FIELD_VALUE_OVERRIDEN"
  746. // "INJECTED_KERNELS_DEPRECATED"
  747. // "MISSING_TYPE_DEPENDENCY"
  748. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  749. // "NEXT_HOP_CANNOT_IP_FORWARD"
  750. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  751. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  752. // "NEXT_HOP_NOT_RUNNING"
  753. // "NOT_CRITICAL_ERROR"
  754. // "NO_RESULTS_ON_PAGE"
  755. // "REQUIRED_TOS_AGREEMENT"
  756. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  757. // "RESOURCE_NOT_DELETED"
  758. // "SCHEMA_VALIDATION_IGNORED"
  759. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  760. // "UNDECLARED_PROPERTIES"
  761. // "UNREACHABLE"
  762. Code string `json:"code,omitempty"`
  763. // Data: [Output Only] Metadata about this warning in key: value format.
  764. // For example:
  765. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  766. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  767. // Message: [Output Only] A human-readable description of the warning
  768. // code.
  769. Message string `json:"message,omitempty"`
  770. // ForceSendFields is a list of field names (e.g. "Code") to
  771. // unconditionally include in API requests. By default, fields with
  772. // empty values are omitted from API requests. However, any non-pointer,
  773. // non-interface field appearing in ForceSendFields will be sent to the
  774. // server regardless of whether the field is empty or not. This may be
  775. // used to include empty fields in Patch requests.
  776. ForceSendFields []string `json:"-"`
  777. // NullFields is a list of field names (e.g. "Code") to include in API
  778. // requests with the JSON null value. By default, fields with empty
  779. // values are omitted from API requests. However, any field with an
  780. // empty value appearing in NullFields will be sent to the server as
  781. // null. It is an error if a field in this list has a non-empty value.
  782. // This may be used to include null fields in Patch requests.
  783. NullFields []string `json:"-"`
  784. }
  785. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  786. type NoMethod AcceleratorTypeAggregatedListWarning
  787. raw := NoMethod(*s)
  788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  789. }
  790. type AcceleratorTypeAggregatedListWarningData struct {
  791. // Key: [Output Only] A key that provides more detail on the warning
  792. // being returned. For example, for warnings where there are no results
  793. // in a list request for a particular zone, this key might be scope and
  794. // the key value might be the zone name. Other examples might be a key
  795. // indicating a deprecated resource and a suggested replacement, or a
  796. // warning about invalid network settings (for example, if an instance
  797. // attempts to perform IP forwarding but is not enabled for IP
  798. // forwarding).
  799. Key string `json:"key,omitempty"`
  800. // Value: [Output Only] A warning data value corresponding to the key.
  801. Value string `json:"value,omitempty"`
  802. // ForceSendFields is a list of field names (e.g. "Key") to
  803. // unconditionally include in API requests. By default, fields with
  804. // empty values are omitted from API requests. However, any non-pointer,
  805. // non-interface field appearing in ForceSendFields will be sent to the
  806. // server regardless of whether the field is empty or not. This may be
  807. // used to include empty fields in Patch requests.
  808. ForceSendFields []string `json:"-"`
  809. // NullFields is a list of field names (e.g. "Key") to include in API
  810. // requests with the JSON null value. By default, fields with empty
  811. // values are omitted from API requests. However, any field with an
  812. // empty value appearing in NullFields will be sent to the server as
  813. // null. It is an error if a field in this list has a non-empty value.
  814. // This may be used to include null fields in Patch requests.
  815. NullFields []string `json:"-"`
  816. }
  817. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  818. type NoMethod AcceleratorTypeAggregatedListWarningData
  819. raw := NoMethod(*s)
  820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  821. }
  822. // AcceleratorTypeList: Contains a list of accelerator types.
  823. type AcceleratorTypeList struct {
  824. // Id: [Output Only] Unique identifier for the resource; defined by the
  825. // server.
  826. Id string `json:"id,omitempty"`
  827. // Items: A list of AcceleratorType resources.
  828. Items []*AcceleratorType `json:"items,omitempty"`
  829. // Kind: [Output Only] Type of resource. Always
  830. // compute#acceleratorTypeList for lists of accelerator types.
  831. Kind string `json:"kind,omitempty"`
  832. // NextPageToken: [Output Only] This token allows you to get the next
  833. // page of results for list requests. If the number of results is larger
  834. // than maxResults, use the nextPageToken as a value for the query
  835. // parameter pageToken in the next list request. Subsequent list
  836. // requests will have their own nextPageToken to continue paging through
  837. // the results.
  838. NextPageToken string `json:"nextPageToken,omitempty"`
  839. // SelfLink: [Output Only] Server-defined URL for this resource.
  840. SelfLink string `json:"selfLink,omitempty"`
  841. // Warning: [Output Only] Informational warning message.
  842. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  843. // ServerResponse contains the HTTP response code and headers from the
  844. // server.
  845. googleapi.ServerResponse `json:"-"`
  846. // ForceSendFields is a list of field names (e.g. "Id") to
  847. // unconditionally include in API requests. By default, fields with
  848. // empty values are omitted from API requests. However, any non-pointer,
  849. // non-interface field appearing in ForceSendFields will be sent to the
  850. // server regardless of whether the field is empty or not. This may be
  851. // used to include empty fields in Patch requests.
  852. ForceSendFields []string `json:"-"`
  853. // NullFields is a list of field names (e.g. "Id") to include in API
  854. // requests with the JSON null value. By default, fields with empty
  855. // values are omitted from API requests. However, any field with an
  856. // empty value appearing in NullFields will be sent to the server as
  857. // null. It is an error if a field in this list has a non-empty value.
  858. // This may be used to include null fields in Patch requests.
  859. NullFields []string `json:"-"`
  860. }
  861. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  862. type NoMethod AcceleratorTypeList
  863. raw := NoMethod(*s)
  864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  865. }
  866. // AcceleratorTypeListWarning: [Output Only] Informational warning
  867. // message.
  868. type AcceleratorTypeListWarning struct {
  869. // Code: [Output Only] A warning code, if applicable. For example,
  870. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  871. // the response.
  872. //
  873. // Possible values:
  874. // "CLEANUP_FAILED"
  875. // "DEPRECATED_RESOURCE_USED"
  876. // "DEPRECATED_TYPE_USED"
  877. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  878. // "EXPERIMENTAL_TYPE_USED"
  879. // "EXTERNAL_API_WARNING"
  880. // "FIELD_VALUE_OVERRIDEN"
  881. // "INJECTED_KERNELS_DEPRECATED"
  882. // "MISSING_TYPE_DEPENDENCY"
  883. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  884. // "NEXT_HOP_CANNOT_IP_FORWARD"
  885. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  886. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  887. // "NEXT_HOP_NOT_RUNNING"
  888. // "NOT_CRITICAL_ERROR"
  889. // "NO_RESULTS_ON_PAGE"
  890. // "REQUIRED_TOS_AGREEMENT"
  891. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  892. // "RESOURCE_NOT_DELETED"
  893. // "SCHEMA_VALIDATION_IGNORED"
  894. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  895. // "UNDECLARED_PROPERTIES"
  896. // "UNREACHABLE"
  897. Code string `json:"code,omitempty"`
  898. // Data: [Output Only] Metadata about this warning in key: value format.
  899. // For example:
  900. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  901. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  902. // Message: [Output Only] A human-readable description of the warning
  903. // code.
  904. Message string `json:"message,omitempty"`
  905. // ForceSendFields is a list of field names (e.g. "Code") to
  906. // unconditionally include in API requests. By default, fields with
  907. // empty values are omitted from API requests. However, any non-pointer,
  908. // non-interface field appearing in ForceSendFields will be sent to the
  909. // server regardless of whether the field is empty or not. This may be
  910. // used to include empty fields in Patch requests.
  911. ForceSendFields []string `json:"-"`
  912. // NullFields is a list of field names (e.g. "Code") to include in API
  913. // requests with the JSON null value. By default, fields with empty
  914. // values are omitted from API requests. However, any field with an
  915. // empty value appearing in NullFields will be sent to the server as
  916. // null. It is an error if a field in this list has a non-empty value.
  917. // This may be used to include null fields in Patch requests.
  918. NullFields []string `json:"-"`
  919. }
  920. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  921. type NoMethod AcceleratorTypeListWarning
  922. raw := NoMethod(*s)
  923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  924. }
  925. type AcceleratorTypeListWarningData struct {
  926. // Key: [Output Only] A key that provides more detail on the warning
  927. // being returned. For example, for warnings where there are no results
  928. // in a list request for a particular zone, this key might be scope and
  929. // the key value might be the zone name. Other examples might be a key
  930. // indicating a deprecated resource and a suggested replacement, or a
  931. // warning about invalid network settings (for example, if an instance
  932. // attempts to perform IP forwarding but is not enabled for IP
  933. // forwarding).
  934. Key string `json:"key,omitempty"`
  935. // Value: [Output Only] A warning data value corresponding to the key.
  936. Value string `json:"value,omitempty"`
  937. // ForceSendFields is a list of field names (e.g. "Key") to
  938. // unconditionally include in API requests. By default, fields with
  939. // empty values are omitted from API requests. However, any non-pointer,
  940. // non-interface field appearing in ForceSendFields will be sent to the
  941. // server regardless of whether the field is empty or not. This may be
  942. // used to include empty fields in Patch requests.
  943. ForceSendFields []string `json:"-"`
  944. // NullFields is a list of field names (e.g. "Key") to include in API
  945. // requests with the JSON null value. By default, fields with empty
  946. // values are omitted from API requests. However, any field with an
  947. // empty value appearing in NullFields will be sent to the server as
  948. // null. It is an error if a field in this list has a non-empty value.
  949. // This may be used to include null fields in Patch requests.
  950. NullFields []string `json:"-"`
  951. }
  952. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  953. type NoMethod AcceleratorTypeListWarningData
  954. raw := NoMethod(*s)
  955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  956. }
  957. type AcceleratorTypesScopedList struct {
  958. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  959. // in this scope.
  960. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  961. // Warning: [Output Only] An informational warning that appears when the
  962. // accelerator types list is empty.
  963. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  964. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  965. // unconditionally include in API requests. By default, fields with
  966. // empty values are omitted from API requests. However, any non-pointer,
  967. // non-interface field appearing in ForceSendFields will be sent to the
  968. // server regardless of whether the field is empty or not. This may be
  969. // used to include empty fields in Patch requests.
  970. ForceSendFields []string `json:"-"`
  971. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  972. // include in API requests with the JSON null value. By default, fields
  973. // with empty values are omitted from API requests. However, any field
  974. // with an empty value appearing in NullFields will be sent to the
  975. // server as null. It is an error if a field in this list has a
  976. // non-empty value. This may be used to include null fields in Patch
  977. // requests.
  978. NullFields []string `json:"-"`
  979. }
  980. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  981. type NoMethod AcceleratorTypesScopedList
  982. raw := NoMethod(*s)
  983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  984. }
  985. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  986. // warning that appears when the accelerator types list is empty.
  987. type AcceleratorTypesScopedListWarning struct {
  988. // Code: [Output Only] A warning code, if applicable. For example,
  989. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  990. // the response.
  991. //
  992. // Possible values:
  993. // "CLEANUP_FAILED"
  994. // "DEPRECATED_RESOURCE_USED"
  995. // "DEPRECATED_TYPE_USED"
  996. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  997. // "EXPERIMENTAL_TYPE_USED"
  998. // "EXTERNAL_API_WARNING"
  999. // "FIELD_VALUE_OVERRIDEN"
  1000. // "INJECTED_KERNELS_DEPRECATED"
  1001. // "MISSING_TYPE_DEPENDENCY"
  1002. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1003. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1004. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1005. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1006. // "NEXT_HOP_NOT_RUNNING"
  1007. // "NOT_CRITICAL_ERROR"
  1008. // "NO_RESULTS_ON_PAGE"
  1009. // "REQUIRED_TOS_AGREEMENT"
  1010. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1011. // "RESOURCE_NOT_DELETED"
  1012. // "SCHEMA_VALIDATION_IGNORED"
  1013. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1014. // "UNDECLARED_PROPERTIES"
  1015. // "UNREACHABLE"
  1016. Code string `json:"code,omitempty"`
  1017. // Data: [Output Only] Metadata about this warning in key: value format.
  1018. // For example:
  1019. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1020. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1021. // Message: [Output Only] A human-readable description of the warning
  1022. // code.
  1023. Message string `json:"message,omitempty"`
  1024. // ForceSendFields is a list of field names (e.g. "Code") to
  1025. // unconditionally include in API requests. By default, fields with
  1026. // empty values are omitted from API requests. However, any non-pointer,
  1027. // non-interface field appearing in ForceSendFields will be sent to the
  1028. // server regardless of whether the field is empty or not. This may be
  1029. // used to include empty fields in Patch requests.
  1030. ForceSendFields []string `json:"-"`
  1031. // NullFields is a list of field names (e.g. "Code") to include in API
  1032. // requests with the JSON null value. By default, fields with empty
  1033. // values are omitted from API requests. However, any field with an
  1034. // empty value appearing in NullFields will be sent to the server as
  1035. // null. It is an error if a field in this list has a non-empty value.
  1036. // This may be used to include null fields in Patch requests.
  1037. NullFields []string `json:"-"`
  1038. }
  1039. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1040. type NoMethod AcceleratorTypesScopedListWarning
  1041. raw := NoMethod(*s)
  1042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1043. }
  1044. type AcceleratorTypesScopedListWarningData struct {
  1045. // Key: [Output Only] A key that provides more detail on the warning
  1046. // being returned. For example, for warnings where there are no results
  1047. // in a list request for a particular zone, this key might be scope and
  1048. // the key value might be the zone name. Other examples might be a key
  1049. // indicating a deprecated resource and a suggested replacement, or a
  1050. // warning about invalid network settings (for example, if an instance
  1051. // attempts to perform IP forwarding but is not enabled for IP
  1052. // forwarding).
  1053. Key string `json:"key,omitempty"`
  1054. // Value: [Output Only] A warning data value corresponding to the key.
  1055. Value string `json:"value,omitempty"`
  1056. // ForceSendFields is a list of field names (e.g. "Key") to
  1057. // unconditionally include in API requests. By default, fields with
  1058. // empty values are omitted from API requests. However, any non-pointer,
  1059. // non-interface field appearing in ForceSendFields will be sent to the
  1060. // server regardless of whether the field is empty or not. This may be
  1061. // used to include empty fields in Patch requests.
  1062. ForceSendFields []string `json:"-"`
  1063. // NullFields is a list of field names (e.g. "Key") to include in API
  1064. // requests with the JSON null value. By default, fields with empty
  1065. // values are omitted from API requests. However, any field with an
  1066. // empty value appearing in NullFields will be sent to the server as
  1067. // null. It is an error if a field in this list has a non-empty value.
  1068. // This may be used to include null fields in Patch requests.
  1069. NullFields []string `json:"-"`
  1070. }
  1071. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1072. type NoMethod AcceleratorTypesScopedListWarningData
  1073. raw := NoMethod(*s)
  1074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1075. }
  1076. // AccessConfig: An access configuration attached to an instance's
  1077. // network interface. Only one access config per instance is supported.
  1078. type AccessConfig struct {
  1079. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1080. // for access configs.
  1081. Kind string `json:"kind,omitempty"`
  1082. // Name: The name of this access configuration. The default and
  1083. // recommended name is External NAT but you can use any arbitrary string
  1084. // you would like. For example, My external IP or Network Access.
  1085. Name string `json:"name,omitempty"`
  1086. // NatIP: An external IP address associated with this instance. Specify
  1087. // an unused static external IP address available to the project or
  1088. // leave this field undefined to use an IP from a shared ephemeral IP
  1089. // address pool. If you specify a static external IP address, it must
  1090. // live in the same region as the zone of the instance.
  1091. NatIP string `json:"natIP,omitempty"`
  1092. // NetworkTier: This signifies the networking tier used for configuring
  1093. // this access configuration and can only take the following values:
  1094. // PREMIUM, STANDARD.
  1095. //
  1096. // If an AccessConfig is specified without a valid external IP address,
  1097. // an ephemeral IP will be created with this networkTier.
  1098. //
  1099. // If an AccessConfig with a valid external IP address is specified, it
  1100. // must match that of the networkTier associated with the Address
  1101. // resource owning that IP.
  1102. //
  1103. // Possible values:
  1104. // "PREMIUM"
  1105. // "STANDARD"
  1106. NetworkTier string `json:"networkTier,omitempty"`
  1107. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1108. // This field can only be set when the set_public_ptr field is enabled.
  1109. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1110. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1111. // created to map the external IP address of the instance to a DNS
  1112. // domain name.
  1113. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1114. // Type: The type of configuration. The default and only option is
  1115. // ONE_TO_ONE_NAT.
  1116. //
  1117. // Possible values:
  1118. // "ONE_TO_ONE_NAT" (default)
  1119. Type string `json:"type,omitempty"`
  1120. // ForceSendFields is a list of field names (e.g. "Kind") to
  1121. // unconditionally include in API requests. By default, fields with
  1122. // empty values are omitted from API requests. However, any non-pointer,
  1123. // non-interface field appearing in ForceSendFields will be sent to the
  1124. // server regardless of whether the field is empty or not. This may be
  1125. // used to include empty fields in Patch requests.
  1126. ForceSendFields []string `json:"-"`
  1127. // NullFields is a list of field names (e.g. "Kind") to include in API
  1128. // requests with the JSON null value. By default, fields with empty
  1129. // values are omitted from API requests. However, any field with an
  1130. // empty value appearing in NullFields will be sent to the server as
  1131. // null. It is an error if a field in this list has a non-empty value.
  1132. // This may be used to include null fields in Patch requests.
  1133. NullFields []string `json:"-"`
  1134. }
  1135. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1136. type NoMethod AccessConfig
  1137. raw := NoMethod(*s)
  1138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1139. }
  1140. // Address: A reserved address resource. (== resource_for beta.addresses
  1141. // ==) (== resource_for v1.addresses ==) (== resource_for
  1142. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1143. type Address struct {
  1144. // Address: The static IP address represented by this resource.
  1145. Address string `json:"address,omitempty"`
  1146. // AddressType: The type of address to reserve, either INTERNAL or
  1147. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1148. //
  1149. // Possible values:
  1150. // "EXTERNAL"
  1151. // "INTERNAL"
  1152. // "UNSPECIFIED_TYPE"
  1153. AddressType string `json:"addressType,omitempty"`
  1154. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1155. // format.
  1156. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1157. // Description: An optional description of this resource. Provide this
  1158. // property when you create the resource.
  1159. Description string `json:"description,omitempty"`
  1160. // Id: [Output Only] The unique identifier for the resource. This
  1161. // identifier is defined by the server.
  1162. Id uint64 `json:"id,omitempty,string"`
  1163. // IpVersion: The IP Version that will be used by this address. Valid
  1164. // options are IPV4 or IPV6. This can only be specified for a global
  1165. // address.
  1166. //
  1167. // Possible values:
  1168. // "IPV4"
  1169. // "IPV6"
  1170. // "UNSPECIFIED_VERSION"
  1171. IpVersion string `json:"ipVersion,omitempty"`
  1172. // Kind: [Output Only] Type of the resource. Always compute#address for
  1173. // addresses.
  1174. Kind string `json:"kind,omitempty"`
  1175. // Name: Name of the resource. Provided by the client when the resource
  1176. // is created. The name must be 1-63 characters long, and comply with
  1177. // RFC1035. Specifically, the name must be 1-63 characters long and
  1178. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1179. // the first character must be a lowercase letter, and all following
  1180. // characters must be a dash, lowercase letter, or digit, except the
  1181. // last character, which cannot be a dash.
  1182. Name string `json:"name,omitempty"`
  1183. // Network: The URL of the network in which to reserve the address. This
  1184. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1185. Network string `json:"network,omitempty"`
  1186. // NetworkTier: This signifies the networking tier used for configuring
  1187. // this Address and can only take the following values: PREMIUM,
  1188. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1189. // forwarding rules can be either Premium or Standard Tier. Standard
  1190. // Tier addresses applied to regional forwarding rules can be used with
  1191. // any external load balancer. Regional forwarding rules in Premium Tier
  1192. // can only be used with a Network load balancer.
  1193. //
  1194. // If this field is not specified, it is assumed to be PREMIUM.
  1195. //
  1196. // Possible values:
  1197. // "PREMIUM"
  1198. // "STANDARD"
  1199. NetworkTier string `json:"networkTier,omitempty"`
  1200. // PrefixLength: The prefix length if the resource reprensents an IP
  1201. // range.
  1202. PrefixLength int64 `json:"prefixLength,omitempty"`
  1203. // Purpose: The purpose of resource, only used with INTERNAL type.
  1204. //
  1205. // Possible values:
  1206. // "DNS_RESOLVER"
  1207. // "GCE_ENDPOINT"
  1208. // "VPC_PEERING"
  1209. Purpose string `json:"purpose,omitempty"`
  1210. // Region: [Output Only] URL of the region where the regional address
  1211. // resides. This field is not applicable to global addresses. You must
  1212. // specify this field as part of the HTTP request URL. You cannot set
  1213. // this field in the request body.
  1214. Region string `json:"region,omitempty"`
  1215. // SelfLink: [Output Only] Server-defined URL for the resource.
  1216. SelfLink string `json:"selfLink,omitempty"`
  1217. // Status: [Output Only] The status of the address, which can be one of
  1218. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1219. // currently in the process of being reserved. A RESERVED address is
  1220. // currently reserved and available to use. An IN_USE address is
  1221. // currently being used by another resource and is not available.
  1222. //
  1223. // Possible values:
  1224. // "IN_USE"
  1225. // "RESERVED"
  1226. // "RESERVING"
  1227. Status string `json:"status,omitempty"`
  1228. // Subnetwork: The URL of the subnetwork in which to reserve the
  1229. // address. If an IP address is specified, it must be within the
  1230. // subnetwork's IP range. This field can only be used with INTERNAL type
  1231. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1232. Subnetwork string `json:"subnetwork,omitempty"`
  1233. // Users: [Output Only] The URLs of the resources that are using this
  1234. // address.
  1235. Users []string `json:"users,omitempty"`
  1236. // ServerResponse contains the HTTP response code and headers from the
  1237. // server.
  1238. googleapi.ServerResponse `json:"-"`
  1239. // ForceSendFields is a list of field names (e.g. "Address") to
  1240. // unconditionally include in API requests. By default, fields with
  1241. // empty values are omitted from API requests. However, any non-pointer,
  1242. // non-interface field appearing in ForceSendFields will be sent to the
  1243. // server regardless of whether the field is empty or not. This may be
  1244. // used to include empty fields in Patch requests.
  1245. ForceSendFields []string `json:"-"`
  1246. // NullFields is a list of field names (e.g. "Address") to include in
  1247. // API requests with the JSON null value. By default, fields with empty
  1248. // values are omitted from API requests. However, any field with an
  1249. // empty value appearing in NullFields will be sent to the server as
  1250. // null. It is an error if a field in this list has a non-empty value.
  1251. // This may be used to include null fields in Patch requests.
  1252. NullFields []string `json:"-"`
  1253. }
  1254. func (s *Address) MarshalJSON() ([]byte, error) {
  1255. type NoMethod Address
  1256. raw := NoMethod(*s)
  1257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1258. }
  1259. type AddressAggregatedList struct {
  1260. // Id: [Output Only] Unique identifier for the resource; defined by the
  1261. // server.
  1262. Id string `json:"id,omitempty"`
  1263. // Items: A list of AddressesScopedList resources.
  1264. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1265. // Kind: [Output Only] Type of resource. Always
  1266. // compute#addressAggregatedList for aggregated lists of addresses.
  1267. Kind string `json:"kind,omitempty"`
  1268. // NextPageToken: [Output Only] This token allows you to get the next
  1269. // page of results for list requests. If the number of results is larger
  1270. // than maxResults, use the nextPageToken as a value for the query
  1271. // parameter pageToken in the next list request. Subsequent list
  1272. // requests will have their own nextPageToken to continue paging through
  1273. // the results.
  1274. NextPageToken string `json:"nextPageToken,omitempty"`
  1275. // SelfLink: [Output Only] Server-defined URL for this resource.
  1276. SelfLink string `json:"selfLink,omitempty"`
  1277. // Warning: [Output Only] Informational warning message.
  1278. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1279. // ServerResponse contains the HTTP response code and headers from the
  1280. // server.
  1281. googleapi.ServerResponse `json:"-"`
  1282. // ForceSendFields is a list of field names (e.g. "Id") to
  1283. // unconditionally include in API requests. By default, fields with
  1284. // empty values are omitted from API requests. However, any non-pointer,
  1285. // non-interface field appearing in ForceSendFields will be sent to the
  1286. // server regardless of whether the field is empty or not. This may be
  1287. // used to include empty fields in Patch requests.
  1288. ForceSendFields []string `json:"-"`
  1289. // NullFields is a list of field names (e.g. "Id") to include in API
  1290. // requests with the JSON null value. By default, fields with empty
  1291. // values are omitted from API requests. However, any field with an
  1292. // empty value appearing in NullFields will be sent to the server as
  1293. // null. It is an error if a field in this list has a non-empty value.
  1294. // This may be used to include null fields in Patch requests.
  1295. NullFields []string `json:"-"`
  1296. }
  1297. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1298. type NoMethod AddressAggregatedList
  1299. raw := NoMethod(*s)
  1300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1301. }
  1302. // AddressAggregatedListWarning: [Output Only] Informational warning
  1303. // message.
  1304. type AddressAggregatedListWarning struct {
  1305. // Code: [Output Only] A warning code, if applicable. For example,
  1306. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1307. // the response.
  1308. //
  1309. // Possible values:
  1310. // "CLEANUP_FAILED"
  1311. // "DEPRECATED_RESOURCE_USED"
  1312. // "DEPRECATED_TYPE_USED"
  1313. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1314. // "EXPERIMENTAL_TYPE_USED"
  1315. // "EXTERNAL_API_WARNING"
  1316. // "FIELD_VALUE_OVERRIDEN"
  1317. // "INJECTED_KERNELS_DEPRECATED"
  1318. // "MISSING_TYPE_DEPENDENCY"
  1319. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1320. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1321. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1322. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1323. // "NEXT_HOP_NOT_RUNNING"
  1324. // "NOT_CRITICAL_ERROR"
  1325. // "NO_RESULTS_ON_PAGE"
  1326. // "REQUIRED_TOS_AGREEMENT"
  1327. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1328. // "RESOURCE_NOT_DELETED"
  1329. // "SCHEMA_VALIDATION_IGNORED"
  1330. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1331. // "UNDECLARED_PROPERTIES"
  1332. // "UNREACHABLE"
  1333. Code string `json:"code,omitempty"`
  1334. // Data: [Output Only] Metadata about this warning in key: value format.
  1335. // For example:
  1336. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1337. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1338. // Message: [Output Only] A human-readable description of the warning
  1339. // code.
  1340. Message string `json:"message,omitempty"`
  1341. // ForceSendFields is a list of field names (e.g. "Code") to
  1342. // unconditionally include in API requests. By default, fields with
  1343. // empty values are omitted from API requests. However, any non-pointer,
  1344. // non-interface field appearing in ForceSendFields will be sent to the
  1345. // server regardless of whether the field is empty or not. This may be
  1346. // used to include empty fields in Patch requests.
  1347. ForceSendFields []string `json:"-"`
  1348. // NullFields is a list of field names (e.g. "Code") to include in API
  1349. // requests with the JSON null value. By default, fields with empty
  1350. // values are omitted from API requests. However, any field with an
  1351. // empty value appearing in NullFields will be sent to the server as
  1352. // null. It is an error if a field in this list has a non-empty value.
  1353. // This may be used to include null fields in Patch requests.
  1354. NullFields []string `json:"-"`
  1355. }
  1356. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1357. type NoMethod AddressAggregatedListWarning
  1358. raw := NoMethod(*s)
  1359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1360. }
  1361. type AddressAggregatedListWarningData struct {
  1362. // Key: [Output Only] A key that provides more detail on the warning
  1363. // being returned. For example, for warnings where there are no results
  1364. // in a list request for a particular zone, this key might be scope and
  1365. // the key value might be the zone name. Other examples might be a key
  1366. // indicating a deprecated resource and a suggested replacement, or a
  1367. // warning about invalid network settings (for example, if an instance
  1368. // attempts to perform IP forwarding but is not enabled for IP
  1369. // forwarding).
  1370. Key string `json:"key,omitempty"`
  1371. // Value: [Output Only] A warning data value corresponding to the key.
  1372. Value string `json:"value,omitempty"`
  1373. // ForceSendFields is a list of field names (e.g. "Key") to
  1374. // unconditionally include in API requests. By default, fields with
  1375. // empty values are omitted from API requests. However, any non-pointer,
  1376. // non-interface field appearing in ForceSendFields will be sent to the
  1377. // server regardless of whether the field is empty or not. This may be
  1378. // used to include empty fields in Patch requests.
  1379. ForceSendFields []string `json:"-"`
  1380. // NullFields is a list of field names (e.g. "Key") to include in API
  1381. // requests with the JSON null value. By default, fields with empty
  1382. // values are omitted from API requests. However, any field with an
  1383. // empty value appearing in NullFields will be sent to the server as
  1384. // null. It is an error if a field in this list has a non-empty value.
  1385. // This may be used to include null fields in Patch requests.
  1386. NullFields []string `json:"-"`
  1387. }
  1388. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1389. type NoMethod AddressAggregatedListWarningData
  1390. raw := NoMethod(*s)
  1391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1392. }
  1393. // AddressList: Contains a list of addresses.
  1394. type AddressList struct {
  1395. // Id: [Output Only] Unique identifier for the resource; defined by the
  1396. // server.
  1397. Id string `json:"id,omitempty"`
  1398. // Items: A list of Address resources.
  1399. Items []*Address `json:"items,omitempty"`
  1400. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1401. // lists of addresses.
  1402. Kind string `json:"kind,omitempty"`
  1403. // NextPageToken: [Output Only] This token allows you to get the next
  1404. // page of results for list requests. If the number of results is larger
  1405. // than maxResults, use the nextPageToken as a value for the query
  1406. // parameter pageToken in the next list request. Subsequent list
  1407. // requests will have their own nextPageToken to continue paging through
  1408. // the results.
  1409. NextPageToken string `json:"nextPageToken,omitempty"`
  1410. // SelfLink: [Output Only] Server-defined URL for this resource.
  1411. SelfLink string `json:"selfLink,omitempty"`
  1412. // Warning: [Output Only] Informational warning message.
  1413. Warning *AddressListWarning `json:"warning,omitempty"`
  1414. // ServerResponse contains the HTTP response code and headers from the
  1415. // server.
  1416. googleapi.ServerResponse `json:"-"`
  1417. // ForceSendFields is a list of field names (e.g. "Id") to
  1418. // unconditionally include in API requests. By default, fields with
  1419. // empty values are omitted from API requests. However, any non-pointer,
  1420. // non-interface field appearing in ForceSendFields will be sent to the
  1421. // server regardless of whether the field is empty or not. This may be
  1422. // used to include empty fields in Patch requests.
  1423. ForceSendFields []string `json:"-"`
  1424. // NullFields is a list of field names (e.g. "Id") to include in API
  1425. // requests with the JSON null value. By default, fields with empty
  1426. // values are omitted from API requests. However, any field with an
  1427. // empty value appearing in NullFields will be sent to the server as
  1428. // null. It is an error if a field in this list has a non-empty value.
  1429. // This may be used to include null fields in Patch requests.
  1430. NullFields []string `json:"-"`
  1431. }
  1432. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1433. type NoMethod AddressList
  1434. raw := NoMethod(*s)
  1435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1436. }
  1437. // AddressListWarning: [Output Only] Informational warning message.
  1438. type AddressListWarning struct {
  1439. // Code: [Output Only] A warning code, if applicable. For example,
  1440. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1441. // the response.
  1442. //
  1443. // Possible values:
  1444. // "CLEANUP_FAILED"
  1445. // "DEPRECATED_RESOURCE_USED"
  1446. // "DEPRECATED_TYPE_USED"
  1447. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1448. // "EXPERIMENTAL_TYPE_USED"
  1449. // "EXTERNAL_API_WARNING"
  1450. // "FIELD_VALUE_OVERRIDEN"
  1451. // "INJECTED_KERNELS_DEPRECATED"
  1452. // "MISSING_TYPE_DEPENDENCY"
  1453. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1454. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1455. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1456. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1457. // "NEXT_HOP_NOT_RUNNING"
  1458. // "NOT_CRITICAL_ERROR"
  1459. // "NO_RESULTS_ON_PAGE"
  1460. // "REQUIRED_TOS_AGREEMENT"
  1461. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1462. // "RESOURCE_NOT_DELETED"
  1463. // "SCHEMA_VALIDATION_IGNORED"
  1464. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1465. // "UNDECLARED_PROPERTIES"
  1466. // "UNREACHABLE"
  1467. Code string `json:"code,omitempty"`
  1468. // Data: [Output Only] Metadata about this warning in key: value format.
  1469. // For example:
  1470. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1471. Data []*AddressListWarningData `json:"data,omitempty"`
  1472. // Message: [Output Only] A human-readable description of the warning
  1473. // code.
  1474. Message string `json:"message,omitempty"`
  1475. // ForceSendFields is a list of field names (e.g. "Code") to
  1476. // unconditionally include in API requests. By default, fields with
  1477. // empty values are omitted from API requests. However, any non-pointer,
  1478. // non-interface field appearing in ForceSendFields will be sent to the
  1479. // server regardless of whether the field is empty or not. This may be
  1480. // used to include empty fields in Patch requests.
  1481. ForceSendFields []string `json:"-"`
  1482. // NullFields is a list of field names (e.g. "Code") to include in API
  1483. // requests with the JSON null value. By default, fields with empty
  1484. // values are omitted from API requests. However, any field with an
  1485. // empty value appearing in NullFields will be sent to the server as
  1486. // null. It is an error if a field in this list has a non-empty value.
  1487. // This may be used to include null fields in Patch requests.
  1488. NullFields []string `json:"-"`
  1489. }
  1490. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1491. type NoMethod AddressListWarning
  1492. raw := NoMethod(*s)
  1493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1494. }
  1495. type AddressListWarningData struct {
  1496. // Key: [Output Only] A key that provides more detail on the warning
  1497. // being returned. For example, for warnings where there are no results
  1498. // in a list request for a particular zone, this key might be scope and
  1499. // the key value might be the zone name. Other examples might be a key
  1500. // indicating a deprecated resource and a suggested replacement, or a
  1501. // warning about invalid network settings (for example, if an instance
  1502. // attempts to perform IP forwarding but is not enabled for IP
  1503. // forwarding).
  1504. Key string `json:"key,omitempty"`
  1505. // Value: [Output Only] A warning data value corresponding to the key.
  1506. Value string `json:"value,omitempty"`
  1507. // ForceSendFields is a list of field names (e.g. "Key") to
  1508. // unconditionally include in API requests. By default, fields with
  1509. // empty values are omitted from API requests. However, any non-pointer,
  1510. // non-interface field appearing in ForceSendFields will be sent to the
  1511. // server regardless of whether the field is empty or not. This may be
  1512. // used to include empty fields in Patch requests.
  1513. ForceSendFields []string `json:"-"`
  1514. // NullFields is a list of field names (e.g. "Key") to include in API
  1515. // requests with the JSON null value. By default, fields with empty
  1516. // values are omitted from API requests. However, any field with an
  1517. // empty value appearing in NullFields will be sent to the server as
  1518. // null. It is an error if a field in this list has a non-empty value.
  1519. // This may be used to include null fields in Patch requests.
  1520. NullFields []string `json:"-"`
  1521. }
  1522. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1523. type NoMethod AddressListWarningData
  1524. raw := NoMethod(*s)
  1525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1526. }
  1527. type AddressesScopedList struct {
  1528. // Addresses: [Output Only] A list of addresses contained in this scope.
  1529. Addresses []*Address `json:"addresses,omitempty"`
  1530. // Warning: [Output Only] Informational warning which replaces the list
  1531. // of addresses when the list is empty.
  1532. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1533. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1534. // unconditionally include in API requests. By default, fields with
  1535. // empty values are omitted from API requests. However, any non-pointer,
  1536. // non-interface field appearing in ForceSendFields will be sent to the
  1537. // server regardless of whether the field is empty or not. This may be
  1538. // used to include empty fields in Patch requests.
  1539. ForceSendFields []string `json:"-"`
  1540. // NullFields is a list of field names (e.g. "Addresses") to include in
  1541. // API requests with the JSON null value. By default, fields with empty
  1542. // values are omitted from API requests. However, any field with an
  1543. // empty value appearing in NullFields will be sent to the server as
  1544. // null. It is an error if a field in this list has a non-empty value.
  1545. // This may be used to include null fields in Patch requests.
  1546. NullFields []string `json:"-"`
  1547. }
  1548. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1549. type NoMethod AddressesScopedList
  1550. raw := NoMethod(*s)
  1551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1552. }
  1553. // AddressesScopedListWarning: [Output Only] Informational warning which
  1554. // replaces the list of addresses when the list is empty.
  1555. type AddressesScopedListWarning struct {
  1556. // Code: [Output Only] A warning code, if applicable. For example,
  1557. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1558. // the response.
  1559. //
  1560. // Possible values:
  1561. // "CLEANUP_FAILED"
  1562. // "DEPRECATED_RESOURCE_USED"
  1563. // "DEPRECATED_TYPE_USED"
  1564. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1565. // "EXPERIMENTAL_TYPE_USED"
  1566. // "EXTERNAL_API_WARNING"
  1567. // "FIELD_VALUE_OVERRIDEN"
  1568. // "INJECTED_KERNELS_DEPRECATED"
  1569. // "MISSING_TYPE_DEPENDENCY"
  1570. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1571. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1572. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1573. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1574. // "NEXT_HOP_NOT_RUNNING"
  1575. // "NOT_CRITICAL_ERROR"
  1576. // "NO_RESULTS_ON_PAGE"
  1577. // "REQUIRED_TOS_AGREEMENT"
  1578. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1579. // "RESOURCE_NOT_DELETED"
  1580. // "SCHEMA_VALIDATION_IGNORED"
  1581. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1582. // "UNDECLARED_PROPERTIES"
  1583. // "UNREACHABLE"
  1584. Code string `json:"code,omitempty"`
  1585. // Data: [Output Only] Metadata about this warning in key: value format.
  1586. // For example:
  1587. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1588. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1589. // Message: [Output Only] A human-readable description of the warning
  1590. // code.
  1591. Message string `json:"message,omitempty"`
  1592. // ForceSendFields is a list of field names (e.g. "Code") to
  1593. // unconditionally include in API requests. By default, fields with
  1594. // empty values are omitted from API requests. However, any non-pointer,
  1595. // non-interface field appearing in ForceSendFields will be sent to the
  1596. // server regardless of whether the field is empty or not. This may be
  1597. // used to include empty fields in Patch requests.
  1598. ForceSendFields []string `json:"-"`
  1599. // NullFields is a list of field names (e.g. "Code") to include in API
  1600. // requests with the JSON null value. By default, fields with empty
  1601. // values are omitted from API requests. However, any field with an
  1602. // empty value appearing in NullFields will be sent to the server as
  1603. // null. It is an error if a field in this list has a non-empty value.
  1604. // This may be used to include null fields in Patch requests.
  1605. NullFields []string `json:"-"`
  1606. }
  1607. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1608. type NoMethod AddressesScopedListWarning
  1609. raw := NoMethod(*s)
  1610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1611. }
  1612. type AddressesScopedListWarningData struct {
  1613. // Key: [Output Only] A key that provides more detail on the warning
  1614. // being returned. For example, for warnings where there are no results
  1615. // in a list request for a particular zone, this key might be scope and
  1616. // the key value might be the zone name. Other examples might be a key
  1617. // indicating a deprecated resource and a suggested replacement, or a
  1618. // warning about invalid network settings (for example, if an instance
  1619. // attempts to perform IP forwarding but is not enabled for IP
  1620. // forwarding).
  1621. Key string `json:"key,omitempty"`
  1622. // Value: [Output Only] A warning data value corresponding to the key.
  1623. Value string `json:"value,omitempty"`
  1624. // ForceSendFields is a list of field names (e.g. "Key") to
  1625. // unconditionally include in API requests. By default, fields with
  1626. // empty values are omitted from API requests. However, any non-pointer,
  1627. // non-interface field appearing in ForceSendFields will be sent to the
  1628. // server regardless of whether the field is empty or not. This may be
  1629. // used to include empty fields in Patch requests.
  1630. ForceSendFields []string `json:"-"`
  1631. // NullFields is a list of field names (e.g. "Key") to include in API
  1632. // requests with the JSON null value. By default, fields with empty
  1633. // values are omitted from API requests. However, any field with an
  1634. // empty value appearing in NullFields will be sent to the server as
  1635. // null. It is an error if a field in this list has a non-empty value.
  1636. // This may be used to include null fields in Patch requests.
  1637. NullFields []string `json:"-"`
  1638. }
  1639. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1640. type NoMethod AddressesScopedListWarningData
  1641. raw := NoMethod(*s)
  1642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1643. }
  1644. // AliasIpRange: An alias IP range attached to an instance's network
  1645. // interface.
  1646. type AliasIpRange struct {
  1647. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1648. // This IP CIDR range must belong to the specified subnetwork and cannot
  1649. // contain IP addresses reserved by system or used by other network
  1650. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1651. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1652. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1653. // SubnetworkRangeName: Optional subnetwork secondary range name
  1654. // specifying the secondary range from which to allocate the IP CIDR
  1655. // range for this alias IP range. If left unspecified, the primary range
  1656. // of the subnetwork will be used.
  1657. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1658. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1659. // unconditionally include in API requests. By default, fields with
  1660. // empty values are omitted from API requests. However, any non-pointer,
  1661. // non-interface field appearing in ForceSendFields will be sent to the
  1662. // server regardless of whether the field is empty or not. This may be
  1663. // used to include empty fields in Patch requests.
  1664. ForceSendFields []string `json:"-"`
  1665. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1666. // in API requests with the JSON null value. By default, fields with
  1667. // empty values are omitted from API requests. However, any field with
  1668. // an empty value appearing in NullFields will be sent to the server as
  1669. // null. It is an error if a field in this list has a non-empty value.
  1670. // This may be used to include null fields in Patch requests.
  1671. NullFields []string `json:"-"`
  1672. }
  1673. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1674. type NoMethod AliasIpRange
  1675. raw := NoMethod(*s)
  1676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1677. }
  1678. // AttachedDisk: An instance-attached disk resource.
  1679. type AttachedDisk struct {
  1680. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  1681. // instance is deleted (but not when the disk is detached from the
  1682. // instance).
  1683. AutoDelete bool `json:"autoDelete,omitempty"`
  1684. // Boot: Indicates that this is a boot disk. The virtual machine will
  1685. // use the first partition of the disk for its root filesystem.
  1686. Boot bool `json:"boot,omitempty"`
  1687. // DeviceName: Specifies a unique device name of your choice that is
  1688. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  1689. // system running within the instance. This name can be used to
  1690. // reference the device for mounting, resizing, and so on, from within
  1691. // the instance.
  1692. //
  1693. // If not specified, the server chooses a default device name to apply
  1694. // to this disk, in the form persistent-disks-x, where x is a number
  1695. // assigned by Google Compute Engine. This field is only applicable for
  1696. // persistent disks.
  1697. DeviceName string `json:"deviceName,omitempty"`
  1698. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  1699. // customer-supplied encryption key.
  1700. //
  1701. // If you are creating a new disk, this field encrypts the new disk
  1702. // using an encryption key that you provide. If you are attaching an
  1703. // existing disk that is already encrypted, this field decrypts the disk
  1704. // using the customer-supplied encryption key.
  1705. //
  1706. // If you encrypt a disk using a customer-supplied key, you must provide
  1707. // the same key again when you attempt to use this resource at a later
  1708. // time. For example, you must provide the key when you create a
  1709. // snapshot or an image from the disk or when you attach the disk to a
  1710. // virtual machine instance.
  1711. //
  1712. // If you do not provide an encryption key, then the disk will be
  1713. // encrypted using an automatically generated key and you do not need to
  1714. // provide a key to use the disk later.
  1715. //
  1716. // Instance templates do not store customer-supplied encryption keys, so
  1717. // you cannot use your own keys to encrypt disks in a managed instance
  1718. // group.
  1719. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1720. // GuestOsFeatures: A list of features to enable on the guest operating
  1721. // system. Applicable only for bootable images. Read Enabling guest
  1722. // operating system features to see a list of available options.
  1723. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  1724. // Index: [Output Only] A zero-based index to this disk, where 0 is
  1725. // reserved for the boot disk. If you have many disks attached to an
  1726. // instance, each disk would have a unique index number.
  1727. Index int64 `json:"index,omitempty"`
  1728. // InitializeParams: [Input Only] Specifies the parameters for a new
  1729. // disk that will be created alongside the new instance. Use
  1730. // initialization parameters to create boot disks or local SSDs attached
  1731. // to the new instance.
  1732. //
  1733. // This property is mutually exclusive with the source property; you can
  1734. // only define one or the other, but not both.
  1735. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  1736. // Interface: Specifies the disk interface to use for attaching this
  1737. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  1738. // disks must always use SCSI and the request will fail if you attempt
  1739. // to attach a persistent disk in any other format than SCSI. Local SSDs
  1740. // can use either NVME or SCSI. For performance characteristics of SCSI
  1741. // over NVMe, see Local SSD performance.
  1742. //
  1743. // Possible values:
  1744. // "NVME"
  1745. // "SCSI"
  1746. Interface string `json:"interface,omitempty"`
  1747. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  1748. // for attached disks.
  1749. Kind string `json:"kind,omitempty"`
  1750. // Licenses: [Output Only] Any valid publicly visible licenses.
  1751. Licenses []string `json:"licenses,omitempty"`
  1752. // Mode: The mode in which to attach this disk, either READ_WRITE or
  1753. // READ_ONLY. If not specified, the default is to attach the disk in
  1754. // READ_WRITE mode.
  1755. //
  1756. // Possible values:
  1757. // "READ_ONLY"
  1758. // "READ_WRITE"
  1759. Mode string `json:"mode,omitempty"`
  1760. // Source: Specifies a valid partial or full URL to an existing
  1761. // Persistent Disk resource. When creating a new instance, one of
  1762. // initializeParams.sourceImage or disks.source is required except for
  1763. // local SSD.
  1764. //
  1765. // If desired, you can also attach existing non-root persistent disks
  1766. // using this property. This field is only applicable for persistent
  1767. // disks.
  1768. //
  1769. // Note that for InstanceTemplate, specify the disk name, not the URL
  1770. // for the disk.
  1771. Source string `json:"source,omitempty"`
  1772. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  1773. // If not specified, the default is PERSISTENT.
  1774. //
  1775. // Possible values:
  1776. // "PERSISTENT"
  1777. // "SCRATCH"
  1778. Type string `json:"type,omitempty"`
  1779. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  1780. // unconditionally include in API requests. By default, fields with
  1781. // empty values are omitted from API requests. However, any non-pointer,
  1782. // non-interface field appearing in ForceSendFields will be sent to the
  1783. // server regardless of whether the field is empty or not. This may be
  1784. // used to include empty fields in Patch requests.
  1785. ForceSendFields []string `json:"-"`
  1786. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  1787. // API requests with the JSON null value. By default, fields with empty
  1788. // values are omitted from API requests. However, any field with an
  1789. // empty value appearing in NullFields will be sent to the server as
  1790. // null. It is an error if a field in this list has a non-empty value.
  1791. // This may be used to include null fields in Patch requests.
  1792. NullFields []string `json:"-"`
  1793. }
  1794. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  1795. type NoMethod AttachedDisk
  1796. raw := NoMethod(*s)
  1797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1798. }
  1799. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  1800. // for a new disk that will be created alongside the new instance. Use
  1801. // initialization parameters to create boot disks or local SSDs attached
  1802. // to the new instance.
  1803. //
  1804. // This property is mutually exclusive with the source property; you can
  1805. // only define one or the other, but not both.
  1806. type AttachedDiskInitializeParams struct {
  1807. // Description: An optional description. Provide this property when
  1808. // creating the disk.
  1809. Description string `json:"description,omitempty"`
  1810. // DiskName: Specifies the disk name. If not specified, the default is
  1811. // to use the name of the instance. If the disk with the instance name
  1812. // exists already in the given zone/region, a new name will be
  1813. // automatically generated.
  1814. DiskName string `json:"diskName,omitempty"`
  1815. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1816. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1817. // DiskType: Specifies the disk type to use to create the instance. If
  1818. // not specified, the default is pd-standard, specified using the full
  1819. // URL. For
  1820. // example:
  1821. // https://www.googleapis.com/compute/v1/projects/project/zones/
  1822. // zone/diskTypes/pd-standard
  1823. //
  1824. //
  1825. // Other values include pd-ssd and local-ssd. If you define this field,
  1826. // you can provide either the full or partial URL. For example, the
  1827. // following are valid values:
  1828. // -
  1829. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  1830. // - projects/project/zones/zone/diskTypes/diskType
  1831. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  1832. // is the name of the disk type, not URL.
  1833. DiskType string `json:"diskType,omitempty"`
  1834. // Labels: Labels to apply to this disk. These can be later modified by
  1835. // the disks.setLabels method. This field is only applicable for
  1836. // persistent disks.
  1837. Labels map[string]string `json:"labels,omitempty"`
  1838. // SourceImage: The source image to create this disk. When creating a
  1839. // new instance, one of initializeParams.sourceImage or disks.source is
  1840. // required except for local SSD.
  1841. //
  1842. // To create a disk with one of the public operating system images,
  1843. // specify the image by its family name. For example, specify
  1844. // family/debian-9 to use the latest Debian 9
  1845. // image:
  1846. // projects/debian-cloud/global/images/family/debian-9
  1847. //
  1848. //
  1849. // Alternati
  1850. // vely, use a specific version of a public operating system
  1851. // image:
  1852. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  1853. //
  1854. //
  1855. //
  1856. // To create a disk with a custom image that you created, specify the
  1857. // image name in the following
  1858. // format:
  1859. // global/images/my-custom-image
  1860. //
  1861. //
  1862. // You can also specify a custom image by its image family, which
  1863. // returns the latest version of the image in that family. Replace the
  1864. // image name with
  1865. // family/family-name:
  1866. // global/images/family/my-image-family
  1867. //
  1868. //
  1869. // If the source image is deleted later, this field will not be set.
  1870. SourceImage string `json:"sourceImage,omitempty"`
  1871. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1872. // source image. Required if the source image is protected by a
  1873. // customer-supplied encryption key.
  1874. //
  1875. // Instance templates do not store customer-supplied encryption keys, so
  1876. // you cannot create disks for instances in a managed instance group if
  1877. // the source images are encrypted with your own keys.
  1878. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1879. // ForceSendFields is a list of field names (e.g. "Description") to
  1880. // unconditionally include in API requests. By default, fields with
  1881. // empty values are omitted from API requests. However, any non-pointer,
  1882. // non-interface field appearing in ForceSendFields will be sent to the
  1883. // server regardless of whether the field is empty or not. This may be
  1884. // used to include empty fields in Patch requests.
  1885. ForceSendFields []string `json:"-"`
  1886. // NullFields is a list of field names (e.g. "Description") to include
  1887. // in API requests with the JSON null value. By default, fields with
  1888. // empty values are omitted from API requests. However, any field with
  1889. // an empty value appearing in NullFields will be sent to the server as
  1890. // null. It is an error if a field in this list has a non-empty value.
  1891. // This may be used to include null fields in Patch requests.
  1892. NullFields []string `json:"-"`
  1893. }
  1894. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  1895. type NoMethod AttachedDiskInitializeParams
  1896. raw := NoMethod(*s)
  1897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1898. }
  1899. // AuditConfig: Specifies the audit configuration for a service. The
  1900. // configuration determines which permission types are logged, and what
  1901. // identities, if any, are exempted from logging. An AuditConfig must
  1902. // have one or more AuditLogConfigs.
  1903. //
  1904. // If there are AuditConfigs for both `allServices` and a specific
  1905. // service, the union of the two AuditConfigs is used for that service:
  1906. // the log_types specified in each AuditConfig are enabled, and the
  1907. // exempted_members in each AuditLogConfig are exempted.
  1908. //
  1909. // Example Policy with multiple AuditConfigs:
  1910. //
  1911. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  1912. // [ { "log_type": "DATA_READ", "exempted_members": [
  1913. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  1914. // "log_type": "ADMIN_READ", } ] }, { "service":
  1915. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  1916. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  1917. // "user:bar@gmail.com" ] } ] } ] }
  1918. //
  1919. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  1920. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  1921. // logging, and bar@gmail.com from DATA_WRITE logging.
  1922. type AuditConfig struct {
  1923. // AuditLogConfigs: The configuration for logging of each type of
  1924. // permission.
  1925. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  1926. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  1927. // Service: Specifies a service that will be enabled for audit logging.
  1928. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  1929. // `allServices` is a special value that covers all services.
  1930. Service string `json:"service,omitempty"`
  1931. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  1932. // unconditionally include in API requests. By default, fields with
  1933. // empty values are omitted from API requests. However, any non-pointer,
  1934. // non-interface field appearing in ForceSendFields will be sent to the
  1935. // server regardless of whether the field is empty or not. This may be
  1936. // used to include empty fields in Patch requests.
  1937. ForceSendFields []string `json:"-"`
  1938. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  1939. // include in API requests with the JSON null value. By default, fields
  1940. // with empty values are omitted from API requests. However, any field
  1941. // with an empty value appearing in NullFields will be sent to the
  1942. // server as null. It is an error if a field in this list has a
  1943. // non-empty value. This may be used to include null fields in Patch
  1944. // requests.
  1945. NullFields []string `json:"-"`
  1946. }
  1947. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  1948. type NoMethod AuditConfig
  1949. raw := NoMethod(*s)
  1950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1951. }
  1952. // AuditLogConfig: Provides the configuration for logging a type of
  1953. // permissions. Example:
  1954. //
  1955. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  1956. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  1957. // "DATA_WRITE", } ] }
  1958. //
  1959. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  1960. // foo@gmail.com from DATA_READ logging.
  1961. type AuditLogConfig struct {
  1962. // ExemptedMembers: Specifies the identities that do not cause logging
  1963. // for this type of permission. Follows the same format of
  1964. // [Binding.members][].
  1965. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  1966. // LogType: The log type that this config enables.
  1967. //
  1968. // Possible values:
  1969. // "ADMIN_READ"
  1970. // "DATA_READ"
  1971. // "DATA_WRITE"
  1972. // "LOG_TYPE_UNSPECIFIED"
  1973. LogType string `json:"logType,omitempty"`
  1974. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  1975. // unconditionally include in API requests. By default, fields with
  1976. // empty values are omitted from API requests. However, any non-pointer,
  1977. // non-interface field appearing in ForceSendFields will be sent to the
  1978. // server regardless of whether the field is empty or not. This may be
  1979. // used to include empty fields in Patch requests.
  1980. ForceSendFields []string `json:"-"`
  1981. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  1982. // include in API requests with the JSON null value. By default, fields
  1983. // with empty values are omitted from API requests. However, any field
  1984. // with an empty value appearing in NullFields will be sent to the
  1985. // server as null. It is an error if a field in this list has a
  1986. // non-empty value. This may be used to include null fields in Patch
  1987. // requests.
  1988. NullFields []string `json:"-"`
  1989. }
  1990. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  1991. type NoMethod AuditLogConfig
  1992. raw := NoMethod(*s)
  1993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1994. }
  1995. // AuthorizationLoggingOptions: Authorization-related information used
  1996. // by Cloud Audit Logging.
  1997. type AuthorizationLoggingOptions struct {
  1998. // PermissionType: The type of the permission that was checked.
  1999. //
  2000. // Possible values:
  2001. // "ADMIN_READ"
  2002. // "ADMIN_WRITE"
  2003. // "DATA_READ"
  2004. // "DATA_WRITE"
  2005. // "PERMISSION_TYPE_UNSPECIFIED"
  2006. PermissionType string `json:"permissionType,omitempty"`
  2007. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2008. // unconditionally include in API requests. By default, fields with
  2009. // empty values are omitted from API requests. However, any non-pointer,
  2010. // non-interface field appearing in ForceSendFields will be sent to the
  2011. // server regardless of whether the field is empty or not. This may be
  2012. // used to include empty fields in Patch requests.
  2013. ForceSendFields []string `json:"-"`
  2014. // NullFields is a list of field names (e.g. "PermissionType") to
  2015. // include in API requests with the JSON null value. By default, fields
  2016. // with empty values are omitted from API requests. However, any field
  2017. // with an empty value appearing in NullFields will be sent to the
  2018. // server as null. It is an error if a field in this list has a
  2019. // non-empty value. This may be used to include null fields in Patch
  2020. // requests.
  2021. NullFields []string `json:"-"`
  2022. }
  2023. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2024. type NoMethod AuthorizationLoggingOptions
  2025. raw := NoMethod(*s)
  2026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2027. }
  2028. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2029. // to automatically scale virtual machine instances in managed instance
  2030. // groups according to an autoscaling policy that you define. For more
  2031. // information, read Autoscaling Groups of Instances. (== resource_for
  2032. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2033. // resource_for beta.regionAutoscalers ==) (== resource_for
  2034. // v1.regionAutoscalers ==)
  2035. type Autoscaler struct {
  2036. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2037. // algorithm. You can define one or more of the policies for an
  2038. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2039. // loadBalancingUtilization.
  2040. //
  2041. // If none of these are specified, the default will be to autoscale
  2042. // based on cpuUtilization to 0.6 or 60%.
  2043. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2044. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2045. // format.
  2046. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2047. // Description: An optional description of this resource. Provide this
  2048. // property when you create the resource.
  2049. Description string `json:"description,omitempty"`
  2050. // Id: [Output Only] The unique identifier for the resource. This
  2051. // identifier is defined by the server.
  2052. Id uint64 `json:"id,omitempty,string"`
  2053. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2054. // for autoscalers.
  2055. Kind string `json:"kind,omitempty"`
  2056. // Name: Name of the resource. Provided by the client when the resource
  2057. // is created. The name must be 1-63 characters long, and comply with
  2058. // RFC1035. Specifically, the name must be 1-63 characters long and
  2059. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2060. // the first character must be a lowercase letter, and all following
  2061. // characters must be a dash, lowercase letter, or digit, except the
  2062. // last character, which cannot be a dash.
  2063. Name string `json:"name,omitempty"`
  2064. // Region: [Output Only] URL of the region where the instance group
  2065. // resides (for autoscalers living in regional scope).
  2066. Region string `json:"region,omitempty"`
  2067. // SelfLink: [Output Only] Server-defined URL for the resource.
  2068. SelfLink string `json:"selfLink,omitempty"`
  2069. // Status: [Output Only] The status of the autoscaler configuration.
  2070. //
  2071. // Possible values:
  2072. // "ACTIVE"
  2073. // "DELETING"
  2074. // "ERROR"
  2075. // "PENDING"
  2076. Status string `json:"status,omitempty"`
  2077. // StatusDetails: [Output Only] Human-readable details about the current
  2078. // state of the autoscaler. Read the documentation for Commonly returned
  2079. // status messages for examples of status messages you might encounter.
  2080. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2081. // Target: URL of the managed instance group that this autoscaler will
  2082. // scale.
  2083. Target string `json:"target,omitempty"`
  2084. // Zone: [Output Only] URL of the zone where the instance group resides
  2085. // (for autoscalers living in zonal scope).
  2086. Zone string `json:"zone,omitempty"`
  2087. // ServerResponse contains the HTTP response code and headers from the
  2088. // server.
  2089. googleapi.ServerResponse `json:"-"`
  2090. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2091. // to unconditionally include in API requests. By default, fields with
  2092. // empty values are omitted from API requests. However, any non-pointer,
  2093. // non-interface field appearing in ForceSendFields will be sent to the
  2094. // server regardless of whether the field is empty or not. This may be
  2095. // used to include empty fields in Patch requests.
  2096. ForceSendFields []string `json:"-"`
  2097. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2098. // include in API requests with the JSON null value. By default, fields
  2099. // with empty values are omitted from API requests. However, any field
  2100. // with an empty value appearing in NullFields will be sent to the
  2101. // server as null. It is an error if a field in this list has a
  2102. // non-empty value. This may be used to include null fields in Patch
  2103. // requests.
  2104. NullFields []string `json:"-"`
  2105. }
  2106. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2107. type NoMethod Autoscaler
  2108. raw := NoMethod(*s)
  2109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2110. }
  2111. type AutoscalerAggregatedList struct {
  2112. // Id: [Output Only] Unique identifier for the resource; defined by the
  2113. // server.
  2114. Id string `json:"id,omitempty"`
  2115. // Items: A list of AutoscalersScopedList resources.
  2116. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2117. // Kind: [Output Only] Type of resource. Always
  2118. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2119. Kind string `json:"kind,omitempty"`
  2120. // NextPageToken: [Output Only] This token allows you to get the next
  2121. // page of results for list requests. If the number of results is larger
  2122. // than maxResults, use the nextPageToken as a value for the query
  2123. // parameter pageToken in the next list request. Subsequent list
  2124. // requests will have their own nextPageToken to continue paging through
  2125. // the results.
  2126. NextPageToken string `json:"nextPageToken,omitempty"`
  2127. // SelfLink: [Output Only] Server-defined URL for this resource.
  2128. SelfLink string `json:"selfLink,omitempty"`
  2129. // Warning: [Output Only] Informational warning message.
  2130. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2131. // ServerResponse contains the HTTP response code and headers from the
  2132. // server.
  2133. googleapi.ServerResponse `json:"-"`
  2134. // ForceSendFields is a list of field names (e.g. "Id") to
  2135. // unconditionally include in API requests. By default, fields with
  2136. // empty values are omitted from API requests. However, any non-pointer,
  2137. // non-interface field appearing in ForceSendFields will be sent to the
  2138. // server regardless of whether the field is empty or not. This may be
  2139. // used to include empty fields in Patch requests.
  2140. ForceSendFields []string `json:"-"`
  2141. // NullFields is a list of field names (e.g. "Id") to include in API
  2142. // requests with the JSON null value. By default, fields with empty
  2143. // values are omitted from API requests. However, any field with an
  2144. // empty value appearing in NullFields will be sent to the server as
  2145. // null. It is an error if a field in this list has a non-empty value.
  2146. // This may be used to include null fields in Patch requests.
  2147. NullFields []string `json:"-"`
  2148. }
  2149. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2150. type NoMethod AutoscalerAggregatedList
  2151. raw := NoMethod(*s)
  2152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2153. }
  2154. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2155. // message.
  2156. type AutoscalerAggregatedListWarning struct {
  2157. // Code: [Output Only] A warning code, if applicable. For example,
  2158. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2159. // the response.
  2160. //
  2161. // Possible values:
  2162. // "CLEANUP_FAILED"
  2163. // "DEPRECATED_RESOURCE_USED"
  2164. // "DEPRECATED_TYPE_USED"
  2165. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2166. // "EXPERIMENTAL_TYPE_USED"
  2167. // "EXTERNAL_API_WARNING"
  2168. // "FIELD_VALUE_OVERRIDEN"
  2169. // "INJECTED_KERNELS_DEPRECATED"
  2170. // "MISSING_TYPE_DEPENDENCY"
  2171. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2172. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2173. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2174. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2175. // "NEXT_HOP_NOT_RUNNING"
  2176. // "NOT_CRITICAL_ERROR"
  2177. // "NO_RESULTS_ON_PAGE"
  2178. // "REQUIRED_TOS_AGREEMENT"
  2179. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2180. // "RESOURCE_NOT_DELETED"
  2181. // "SCHEMA_VALIDATION_IGNORED"
  2182. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2183. // "UNDECLARED_PROPERTIES"
  2184. // "UNREACHABLE"
  2185. Code string `json:"code,omitempty"`
  2186. // Data: [Output Only] Metadata about this warning in key: value format.
  2187. // For example:
  2188. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2189. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2190. // Message: [Output Only] A human-readable description of the warning
  2191. // code.
  2192. Message string `json:"message,omitempty"`
  2193. // ForceSendFields is a list of field names (e.g. "Code") to
  2194. // unconditionally include in API requests. By default, fields with
  2195. // empty values are omitted from API requests. However, any non-pointer,
  2196. // non-interface field appearing in ForceSendFields will be sent to the
  2197. // server regardless of whether the field is empty or not. This may be
  2198. // used to include empty fields in Patch requests.
  2199. ForceSendFields []string `json:"-"`
  2200. // NullFields is a list of field names (e.g. "Code") to include in API
  2201. // requests with the JSON null value. By default, fields with empty
  2202. // values are omitted from API requests. However, any field with an
  2203. // empty value appearing in NullFields will be sent to the server as
  2204. // null. It is an error if a field in this list has a non-empty value.
  2205. // This may be used to include null fields in Patch requests.
  2206. NullFields []string `json:"-"`
  2207. }
  2208. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2209. type NoMethod AutoscalerAggregatedListWarning
  2210. raw := NoMethod(*s)
  2211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2212. }
  2213. type AutoscalerAggregatedListWarningData struct {
  2214. // Key: [Output Only] A key that provides more detail on the warning
  2215. // being returned. For example, for warnings where there are no results
  2216. // in a list request for a particular zone, this key might be scope and
  2217. // the key value might be the zone name. Other examples might be a key
  2218. // indicating a deprecated resource and a suggested replacement, or a
  2219. // warning about invalid network settings (for example, if an instance
  2220. // attempts to perform IP forwarding but is not enabled for IP
  2221. // forwarding).
  2222. Key string `json:"key,omitempty"`
  2223. // Value: [Output Only] A warning data value corresponding to the key.
  2224. Value string `json:"value,omitempty"`
  2225. // ForceSendFields is a list of field names (e.g. "Key") to
  2226. // unconditionally include in API requests. By default, fields with
  2227. // empty values are omitted from API requests. However, any non-pointer,
  2228. // non-interface field appearing in ForceSendFields will be sent to the
  2229. // server regardless of whether the field is empty or not. This may be
  2230. // used to include empty fields in Patch requests.
  2231. ForceSendFields []string `json:"-"`
  2232. // NullFields is a list of field names (e.g. "Key") to include in API
  2233. // requests with the JSON null value. By default, fields with empty
  2234. // values are omitted from API requests. However, any field with an
  2235. // empty value appearing in NullFields will be sent to the server as
  2236. // null. It is an error if a field in this list has a non-empty value.
  2237. // This may be used to include null fields in Patch requests.
  2238. NullFields []string `json:"-"`
  2239. }
  2240. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2241. type NoMethod AutoscalerAggregatedListWarningData
  2242. raw := NoMethod(*s)
  2243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2244. }
  2245. // AutoscalerList: Contains a list of Autoscaler resources.
  2246. type AutoscalerList struct {
  2247. // Id: [Output Only] Unique identifier for the resource; defined by the
  2248. // server.
  2249. Id string `json:"id,omitempty"`
  2250. // Items: A list of Autoscaler resources.
  2251. Items []*Autoscaler `json:"items,omitempty"`
  2252. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2253. // for lists of autoscalers.
  2254. Kind string `json:"kind,omitempty"`
  2255. // NextPageToken: [Output Only] This token allows you to get the next
  2256. // page of results for list requests. If the number of results is larger
  2257. // than maxResults, use the nextPageToken as a value for the query
  2258. // parameter pageToken in the next list request. Subsequent list
  2259. // requests will have their own nextPageToken to continue paging through
  2260. // the results.
  2261. NextPageToken string `json:"nextPageToken,omitempty"`
  2262. // SelfLink: [Output Only] Server-defined URL for this resource.
  2263. SelfLink string `json:"selfLink,omitempty"`
  2264. // Warning: [Output Only] Informational warning message.
  2265. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2266. // ServerResponse contains the HTTP response code and headers from the
  2267. // server.
  2268. googleapi.ServerResponse `json:"-"`
  2269. // ForceSendFields is a list of field names (e.g. "Id") to
  2270. // unconditionally include in API requests. By default, fields with
  2271. // empty values are omitted from API requests. However, any non-pointer,
  2272. // non-interface field appearing in ForceSendFields will be sent to the
  2273. // server regardless of whether the field is empty or not. This may be
  2274. // used to include empty fields in Patch requests.
  2275. ForceSendFields []string `json:"-"`
  2276. // NullFields is a list of field names (e.g. "Id") to include in API
  2277. // requests with the JSON null value. By default, fields with empty
  2278. // values are omitted from API requests. However, any field with an
  2279. // empty value appearing in NullFields will be sent to the server as
  2280. // null. It is an error if a field in this list has a non-empty value.
  2281. // This may be used to include null fields in Patch requests.
  2282. NullFields []string `json:"-"`
  2283. }
  2284. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2285. type NoMethod AutoscalerList
  2286. raw := NoMethod(*s)
  2287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2288. }
  2289. // AutoscalerListWarning: [Output Only] Informational warning message.
  2290. type AutoscalerListWarning struct {
  2291. // Code: [Output Only] A warning code, if applicable. For example,
  2292. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2293. // the response.
  2294. //
  2295. // Possible values:
  2296. // "CLEANUP_FAILED"
  2297. // "DEPRECATED_RESOURCE_USED"
  2298. // "DEPRECATED_TYPE_USED"
  2299. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2300. // "EXPERIMENTAL_TYPE_USED"
  2301. // "EXTERNAL_API_WARNING"
  2302. // "FIELD_VALUE_OVERRIDEN"
  2303. // "INJECTED_KERNELS_DEPRECATED"
  2304. // "MISSING_TYPE_DEPENDENCY"
  2305. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2306. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2307. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2308. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2309. // "NEXT_HOP_NOT_RUNNING"
  2310. // "NOT_CRITICAL_ERROR"
  2311. // "NO_RESULTS_ON_PAGE"
  2312. // "REQUIRED_TOS_AGREEMENT"
  2313. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2314. // "RESOURCE_NOT_DELETED"
  2315. // "SCHEMA_VALIDATION_IGNORED"
  2316. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2317. // "UNDECLARED_PROPERTIES"
  2318. // "UNREACHABLE"
  2319. Code string `json:"code,omitempty"`
  2320. // Data: [Output Only] Metadata about this warning in key: value format.
  2321. // For example:
  2322. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2323. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2324. // Message: [Output Only] A human-readable description of the warning
  2325. // code.
  2326. Message string `json:"message,omitempty"`
  2327. // ForceSendFields is a list of field names (e.g. "Code") to
  2328. // unconditionally include in API requests. By default, fields with
  2329. // empty values are omitted from API requests. However, any non-pointer,
  2330. // non-interface field appearing in ForceSendFields will be sent to the
  2331. // server regardless of whether the field is empty or not. This may be
  2332. // used to include empty fields in Patch requests.
  2333. ForceSendFields []string `json:"-"`
  2334. // NullFields is a list of field names (e.g. "Code") to include in API
  2335. // requests with the JSON null value. By default, fields with empty
  2336. // values are omitted from API requests. However, any field with an
  2337. // empty value appearing in NullFields will be sent to the server as
  2338. // null. It is an error if a field in this list has a non-empty value.
  2339. // This may be used to include null fields in Patch requests.
  2340. NullFields []string `json:"-"`
  2341. }
  2342. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2343. type NoMethod AutoscalerListWarning
  2344. raw := NoMethod(*s)
  2345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2346. }
  2347. type AutoscalerListWarningData struct {
  2348. // Key: [Output Only] A key that provides more detail on the warning
  2349. // being returned. For example, for warnings where there are no results
  2350. // in a list request for a particular zone, this key might be scope and
  2351. // the key value might be the zone name. Other examples might be a key
  2352. // indicating a deprecated resource and a suggested replacement, or a
  2353. // warning about invalid network settings (for example, if an instance
  2354. // attempts to perform IP forwarding but is not enabled for IP
  2355. // forwarding).
  2356. Key string `json:"key,omitempty"`
  2357. // Value: [Output Only] A warning data value corresponding to the key.
  2358. Value string `json:"value,omitempty"`
  2359. // ForceSendFields is a list of field names (e.g. "Key") to
  2360. // unconditionally include in API requests. By default, fields with
  2361. // empty values are omitted from API requests. However, any non-pointer,
  2362. // non-interface field appearing in ForceSendFields will be sent to the
  2363. // server regardless of whether the field is empty or not. This may be
  2364. // used to include empty fields in Patch requests.
  2365. ForceSendFields []string `json:"-"`
  2366. // NullFields is a list of field names (e.g. "Key") to include in API
  2367. // requests with the JSON null value. By default, fields with empty
  2368. // values are omitted from API requests. However, any field with an
  2369. // empty value appearing in NullFields will be sent to the server as
  2370. // null. It is an error if a field in this list has a non-empty value.
  2371. // This may be used to include null fields in Patch requests.
  2372. NullFields []string `json:"-"`
  2373. }
  2374. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2375. type NoMethod AutoscalerListWarningData
  2376. raw := NoMethod(*s)
  2377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2378. }
  2379. type AutoscalerStatusDetails struct {
  2380. // Message: The status message.
  2381. Message string `json:"message,omitempty"`
  2382. // Type: The type of error returned.
  2383. //
  2384. // Possible values:
  2385. // "ALL_INSTANCES_UNHEALTHY"
  2386. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2387. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2388. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2389. // "CUSTOM_METRIC_INVALID"
  2390. // "MIN_EQUALS_MAX"
  2391. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2392. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2393. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2394. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2395. // "REGION_RESOURCE_STOCKOUT"
  2396. // "SCALING_TARGET_DOES_NOT_EXIST"
  2397. // "UNKNOWN"
  2398. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2399. // "ZONE_RESOURCE_STOCKOUT"
  2400. Type string `json:"type,omitempty"`
  2401. // ForceSendFields is a list of field names (e.g. "Message") to
  2402. // unconditionally include in API requests. By default, fields with
  2403. // empty values are omitted from API requests. However, any non-pointer,
  2404. // non-interface field appearing in ForceSendFields will be sent to the
  2405. // server regardless of whether the field is empty or not. This may be
  2406. // used to include empty fields in Patch requests.
  2407. ForceSendFields []string `json:"-"`
  2408. // NullFields is a list of field names (e.g. "Message") to include in
  2409. // API requests with the JSON null value. By default, fields with empty
  2410. // values are omitted from API requests. However, any field with an
  2411. // empty value appearing in NullFields will be sent to the server as
  2412. // null. It is an error if a field in this list has a non-empty value.
  2413. // This may be used to include null fields in Patch requests.
  2414. NullFields []string `json:"-"`
  2415. }
  2416. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2417. type NoMethod AutoscalerStatusDetails
  2418. raw := NoMethod(*s)
  2419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2420. }
  2421. type AutoscalersScopedList struct {
  2422. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2423. // scope.
  2424. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2425. // Warning: [Output Only] Informational warning which replaces the list
  2426. // of autoscalers when the list is empty.
  2427. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2428. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2429. // unconditionally include in API requests. By default, fields with
  2430. // empty values are omitted from API requests. However, any non-pointer,
  2431. // non-interface field appearing in ForceSendFields will be sent to the
  2432. // server regardless of whether the field is empty or not. This may be
  2433. // used to include empty fields in Patch requests.
  2434. ForceSendFields []string `json:"-"`
  2435. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2436. // in API requests with the JSON null value. By default, fields with
  2437. // empty values are omitted from API requests. However, any field with
  2438. // an empty value appearing in NullFields will be sent to the server as
  2439. // null. It is an error if a field in this list has a non-empty value.
  2440. // This may be used to include null fields in Patch requests.
  2441. NullFields []string `json:"-"`
  2442. }
  2443. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2444. type NoMethod AutoscalersScopedList
  2445. raw := NoMethod(*s)
  2446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2447. }
  2448. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2449. // which replaces the list of autoscalers when the list is empty.
  2450. type AutoscalersScopedListWarning struct {
  2451. // Code: [Output Only] A warning code, if applicable. For example,
  2452. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2453. // the response.
  2454. //
  2455. // Possible values:
  2456. // "CLEANUP_FAILED"
  2457. // "DEPRECATED_RESOURCE_USED"
  2458. // "DEPRECATED_TYPE_USED"
  2459. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2460. // "EXPERIMENTAL_TYPE_USED"
  2461. // "EXTERNAL_API_WARNING"
  2462. // "FIELD_VALUE_OVERRIDEN"
  2463. // "INJECTED_KERNELS_DEPRECATED"
  2464. // "MISSING_TYPE_DEPENDENCY"
  2465. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2466. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2467. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2468. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2469. // "NEXT_HOP_NOT_RUNNING"
  2470. // "NOT_CRITICAL_ERROR"
  2471. // "NO_RESULTS_ON_PAGE"
  2472. // "REQUIRED_TOS_AGREEMENT"
  2473. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2474. // "RESOURCE_NOT_DELETED"
  2475. // "SCHEMA_VALIDATION_IGNORED"
  2476. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2477. // "UNDECLARED_PROPERTIES"
  2478. // "UNREACHABLE"
  2479. Code string `json:"code,omitempty"`
  2480. // Data: [Output Only] Metadata about this warning in key: value format.
  2481. // For example:
  2482. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2483. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2484. // Message: [Output Only] A human-readable description of the warning
  2485. // code.
  2486. Message string `json:"message,omitempty"`
  2487. // ForceSendFields is a list of field names (e.g. "Code") to
  2488. // unconditionally include in API requests. By default, fields with
  2489. // empty values are omitted from API requests. However, any non-pointer,
  2490. // non-interface field appearing in ForceSendFields will be sent to the
  2491. // server regardless of whether the field is empty or not. This may be
  2492. // used to include empty fields in Patch requests.
  2493. ForceSendFields []string `json:"-"`
  2494. // NullFields is a list of field names (e.g. "Code") to include in API
  2495. // requests with the JSON null value. By default, fields with empty
  2496. // values are omitted from API requests. However, any field with an
  2497. // empty value appearing in NullFields will be sent to the server as
  2498. // null. It is an error if a field in this list has a non-empty value.
  2499. // This may be used to include null fields in Patch requests.
  2500. NullFields []string `json:"-"`
  2501. }
  2502. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2503. type NoMethod AutoscalersScopedListWarning
  2504. raw := NoMethod(*s)
  2505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2506. }
  2507. type AutoscalersScopedListWarningData struct {
  2508. // Key: [Output Only] A key that provides more detail on the warning
  2509. // being returned. For example, for warnings where there are no results
  2510. // in a list request for a particular zone, this key might be scope and
  2511. // the key value might be the zone name. Other examples might be a key
  2512. // indicating a deprecated resource and a suggested replacement, or a
  2513. // warning about invalid network settings (for example, if an instance
  2514. // attempts to perform IP forwarding but is not enabled for IP
  2515. // forwarding).
  2516. Key string `json:"key,omitempty"`
  2517. // Value: [Output Only] A warning data value corresponding to the key.
  2518. Value string `json:"value,omitempty"`
  2519. // ForceSendFields is a list of field names (e.g. "Key") to
  2520. // unconditionally include in API requests. By default, fields with
  2521. // empty values are omitted from API requests. However, any non-pointer,
  2522. // non-interface field appearing in ForceSendFields will be sent to the
  2523. // server regardless of whether the field is empty or not. This may be
  2524. // used to include empty fields in Patch requests.
  2525. ForceSendFields []string `json:"-"`
  2526. // NullFields is a list of field names (e.g. "Key") to include in API
  2527. // requests with the JSON null value. By default, fields with empty
  2528. // values are omitted from API requests. However, any field with an
  2529. // empty value appearing in NullFields will be sent to the server as
  2530. // null. It is an error if a field in this list has a non-empty value.
  2531. // This may be used to include null fields in Patch requests.
  2532. NullFields []string `json:"-"`
  2533. }
  2534. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  2535. type NoMethod AutoscalersScopedListWarningData
  2536. raw := NoMethod(*s)
  2537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2538. }
  2539. // AutoscalingPolicy: Cloud Autoscaler policy.
  2540. type AutoscalingPolicy struct {
  2541. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  2542. // wait before it starts collecting information from a new instance.
  2543. // This prevents the autoscaler from collecting information when the
  2544. // instance is initializing, during which the collected usage would not
  2545. // be reliable. The default time autoscaler waits is 60
  2546. // seconds.
  2547. //
  2548. // Virtual machine initialization times might vary because of numerous
  2549. // factors. We recommend that you test how long an instance may take to
  2550. // initialize. To do this, create an instance and time the startup
  2551. // process.
  2552. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  2553. // CpuUtilization: Defines the CPU utilization policy that allows the
  2554. // autoscaler to scale based on the average CPU utilization of a managed
  2555. // instance group.
  2556. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  2557. // CustomMetricUtilizations: Configuration parameters of autoscaling
  2558. // based on a custom metric.
  2559. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  2560. // LoadBalancingUtilization: Configuration parameters of autoscaling
  2561. // based on load balancer.
  2562. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  2563. // MaxNumReplicas: The maximum number of instances that the autoscaler
  2564. // can scale up to. This is required when creating or updating an
  2565. // autoscaler. The maximum number of replicas should not be lower than
  2566. // minimal number of replicas.
  2567. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  2568. // MinNumReplicas: The minimum number of replicas that the autoscaler
  2569. // can scale down to. This cannot be less than 0. If not provided,
  2570. // autoscaler will choose a default value depending on maximum number of
  2571. // instances allowed.
  2572. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  2573. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  2574. // to unconditionally include in API requests. By default, fields with
  2575. // empty values are omitted from API requests. However, any non-pointer,
  2576. // non-interface field appearing in ForceSendFields will be sent to the
  2577. // server regardless of whether the field is empty or not. This may be
  2578. // used to include empty fields in Patch requests.
  2579. ForceSendFields []string `json:"-"`
  2580. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  2581. // include in API requests with the JSON null value. By default, fields
  2582. // with empty values are omitted from API requests. However, any field
  2583. // with an empty value appearing in NullFields will be sent to the
  2584. // server as null. It is an error if a field in this list has a
  2585. // non-empty value. This may be used to include null fields in Patch
  2586. // requests.
  2587. NullFields []string `json:"-"`
  2588. }
  2589. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  2590. type NoMethod AutoscalingPolicy
  2591. raw := NoMethod(*s)
  2592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2593. }
  2594. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  2595. type AutoscalingPolicyCpuUtilization struct {
  2596. // UtilizationTarget: The target CPU utilization that the autoscaler
  2597. // should maintain. Must be a float value in the range (0, 1]. If not
  2598. // specified, the default is 0.6.
  2599. //
  2600. // If the CPU level is below the target utilization, the autoscaler
  2601. // scales down the number of instances until it reaches the minimum
  2602. // number of instances you specified or until the average CPU of your
  2603. // instances reaches the target utilization.
  2604. //
  2605. // If the average CPU is above the target utilization, the autoscaler
  2606. // scales up until it reaches the maximum number of instances you
  2607. // specified or until the average utilization reaches the target
  2608. // utilization.
  2609. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2610. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2611. // to unconditionally include in API requests. By default, fields with
  2612. // empty values are omitted from API requests. However, any non-pointer,
  2613. // non-interface field appearing in ForceSendFields will be sent to the
  2614. // server regardless of whether the field is empty or not. This may be
  2615. // used to include empty fields in Patch requests.
  2616. ForceSendFields []string `json:"-"`
  2617. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2618. // include in API requests with the JSON null value. By default, fields
  2619. // with empty values are omitted from API requests. However, any field
  2620. // with an empty value appearing in NullFields will be sent to the
  2621. // server as null. It is an error if a field in this list has a
  2622. // non-empty value. This may be used to include null fields in Patch
  2623. // requests.
  2624. NullFields []string `json:"-"`
  2625. }
  2626. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  2627. type NoMethod AutoscalingPolicyCpuUtilization
  2628. raw := NoMethod(*s)
  2629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2630. }
  2631. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  2632. type NoMethod AutoscalingPolicyCpuUtilization
  2633. var s1 struct {
  2634. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2635. *NoMethod
  2636. }
  2637. s1.NoMethod = (*NoMethod)(s)
  2638. if err := json.Unmarshal(data, &s1); err != nil {
  2639. return err
  2640. }
  2641. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2642. return nil
  2643. }
  2644. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  2645. // policy.
  2646. type AutoscalingPolicyCustomMetricUtilization struct {
  2647. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  2648. // The metric cannot have negative values.
  2649. //
  2650. // The metric must have a value type of INT64 or DOUBLE.
  2651. Metric string `json:"metric,omitempty"`
  2652. // UtilizationTarget: The target value of the metric that autoscaler
  2653. // should maintain. This must be a positive value. A utilization metric
  2654. // scales number of virtual machines handling requests to increase or
  2655. // decrease proportionally to the metric.
  2656. //
  2657. // For example, a good metric to use as a utilization_target is
  2658. // compute.googleapis.com/instance/network/received_bytes_count. The
  2659. // autoscaler will work to keep this value constant for each of the
  2660. // instances.
  2661. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2662. // UtilizationTargetType: Defines how target utilization value is
  2663. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  2664. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  2665. //
  2666. // Possible values:
  2667. // "DELTA_PER_MINUTE"
  2668. // "DELTA_PER_SECOND"
  2669. // "GAUGE"
  2670. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  2671. // ForceSendFields is a list of field names (e.g. "Metric") to
  2672. // unconditionally include in API requests. By default, fields with
  2673. // empty values are omitted from API requests. However, any non-pointer,
  2674. // non-interface field appearing in ForceSendFields will be sent to the
  2675. // server regardless of whether the field is empty or not. This may be
  2676. // used to include empty fields in Patch requests.
  2677. ForceSendFields []string `json:"-"`
  2678. // NullFields is a list of field names (e.g. "Metric") to include in API
  2679. // requests with the JSON null value. By default, fields with empty
  2680. // values are omitted from API requests. However, any field with an
  2681. // empty value appearing in NullFields will be sent to the server as
  2682. // null. It is an error if a field in this list has a non-empty value.
  2683. // This may be used to include null fields in Patch requests.
  2684. NullFields []string `json:"-"`
  2685. }
  2686. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  2687. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2688. raw := NoMethod(*s)
  2689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2690. }
  2691. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  2692. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2693. var s1 struct {
  2694. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2695. *NoMethod
  2696. }
  2697. s1.NoMethod = (*NoMethod)(s)
  2698. if err := json.Unmarshal(data, &s1); err != nil {
  2699. return err
  2700. }
  2701. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2702. return nil
  2703. }
  2704. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  2705. // of autoscaling based on load balancing.
  2706. type AutoscalingPolicyLoadBalancingUtilization struct {
  2707. // UtilizationTarget: Fraction of backend capacity utilization (set in
  2708. // HTTP(s) load balancing configuration) that autoscaler should
  2709. // maintain. Must be a positive float value. If not defined, the default
  2710. // is 0.8.
  2711. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2712. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2713. // to unconditionally include in API requests. By default, fields with
  2714. // empty values are omitted from API requests. However, any non-pointer,
  2715. // non-interface field appearing in ForceSendFields will be sent to the
  2716. // server regardless of whether the field is empty or not. This may be
  2717. // used to include empty fields in Patch requests.
  2718. ForceSendFields []string `json:"-"`
  2719. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2720. // include in API requests with the JSON null value. By default, fields
  2721. // with empty values are omitted from API requests. However, any field
  2722. // with an empty value appearing in NullFields will be sent to the
  2723. // server as null. It is an error if a field in this list has a
  2724. // non-empty value. This may be used to include null fields in Patch
  2725. // requests.
  2726. NullFields []string `json:"-"`
  2727. }
  2728. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  2729. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2730. raw := NoMethod(*s)
  2731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2732. }
  2733. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  2734. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2735. var s1 struct {
  2736. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2737. *NoMethod
  2738. }
  2739. s1.NoMethod = (*NoMethod)(s)
  2740. if err := json.Unmarshal(data, &s1); err != nil {
  2741. return err
  2742. }
  2743. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2744. return nil
  2745. }
  2746. // Backend: Message containing information of one individual backend.
  2747. type Backend struct {
  2748. // BalancingMode: Specifies the balancing mode for this backend. For
  2749. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  2750. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  2751. // TCP/SSL).
  2752. //
  2753. // For Internal Load Balancing, the default and only supported mode is
  2754. // CONNECTION.
  2755. //
  2756. // Possible values:
  2757. // "CONNECTION"
  2758. // "RATE"
  2759. // "UTILIZATION"
  2760. BalancingMode string `json:"balancingMode,omitempty"`
  2761. // CapacityScaler: A multiplier applied to the group's maximum servicing
  2762. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  2763. // 1, which means the group will serve up to 100% of its configured
  2764. // capacity (depending on balancingMode). A setting of 0 means the group
  2765. // is completely drained, offering 0% of its available Capacity. Valid
  2766. // range is [0.0,1.0].
  2767. //
  2768. // This cannot be used for internal load balancing.
  2769. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  2770. // Description: An optional description of this resource. Provide this
  2771. // property when you create the resource.
  2772. Description string `json:"description,omitempty"`
  2773. // Group: The fully-qualified URL of an Instance Group or Network
  2774. // Endpoint Group resource. In case of instance group this defines the
  2775. // list of instances that serve traffic. Member virtual machine
  2776. // instances from each instance group must live in the same zone as the
  2777. // instance group itself. No two backends in a backend service are
  2778. // allowed to use same Instance Group resource.
  2779. //
  2780. // For Network Endpoint Groups this defines list of endpoints. All
  2781. // endpoints of Network Endpoint Group must be hosted on instances
  2782. // located in the same zone as the Network Endpoint Group.
  2783. //
  2784. // Backend service can not contain mix of Instance Group and Network
  2785. // Endpoint Group backends.
  2786. //
  2787. // Note that you must specify an Instance Group or Network Endpoint
  2788. // Group resource using the fully-qualified URL, rather than a partial
  2789. // URL.
  2790. //
  2791. // When the BackendService has load balancing scheme INTERNAL, the
  2792. // instance group must be within the same region as the BackendService.
  2793. // Network Endpoint Groups are not supported for INTERNAL load balancing
  2794. // scheme.
  2795. Group string `json:"group,omitempty"`
  2796. // MaxConnections: The max number of simultaneous connections for the
  2797. // group. Can be used with either CONNECTION or UTILIZATION balancing
  2798. // modes. For CONNECTION mode, either maxConnections or
  2799. // maxConnectionsPerInstance must be set.
  2800. //
  2801. // This cannot be used for internal load balancing.
  2802. MaxConnections int64 `json:"maxConnections,omitempty"`
  2803. // MaxConnectionsPerInstance: The max number of simultaneous connections
  2804. // that a single backend instance can handle. This is used to calculate
  2805. // the capacity of the group. Can be used in either CONNECTION or
  2806. // UTILIZATION balancing modes. For CONNECTION mode, either
  2807. // maxConnections or maxConnectionsPerInstance must be set.
  2808. //
  2809. // This cannot be used for internal load balancing.
  2810. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  2811. // MaxRate: The max requests per second (RPS) of the group. Can be used
  2812. // with either RATE or UTILIZATION balancing modes, but required if RATE
  2813. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  2814. // set.
  2815. //
  2816. // This cannot be used for internal load balancing.
  2817. MaxRate int64 `json:"maxRate,omitempty"`
  2818. // MaxRatePerInstance: The max requests per second (RPS) that a single
  2819. // backend instance can handle. This is used to calculate the capacity
  2820. // of the group. Can be used in either balancing mode. For RATE mode,
  2821. // either maxRate or maxRatePerInstance must be set.
  2822. //
  2823. // This cannot be used for internal load balancing.
  2824. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  2825. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  2826. // defines the CPU utilization target for the group. The default is 0.8.
  2827. // Valid range is [0.0, 1.0].
  2828. //
  2829. // This cannot be used for internal load balancing.
  2830. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  2831. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  2832. // unconditionally include in API requests. By default, fields with
  2833. // empty values are omitted from API requests. However, any non-pointer,
  2834. // non-interface field appearing in ForceSendFields will be sent to the
  2835. // server regardless of whether the field is empty or not. This may be
  2836. // used to include empty fields in Patch requests.
  2837. ForceSendFields []string `json:"-"`
  2838. // NullFields is a list of field names (e.g. "BalancingMode") to include
  2839. // in API requests with the JSON null value. By default, fields with
  2840. // empty values are omitted from API requests. However, any field with
  2841. // an empty value appearing in NullFields will be sent to the server as
  2842. // null. It is an error if a field in this list has a non-empty value.
  2843. // This may be used to include null fields in Patch requests.
  2844. NullFields []string `json:"-"`
  2845. }
  2846. func (s *Backend) MarshalJSON() ([]byte, error) {
  2847. type NoMethod Backend
  2848. raw := NoMethod(*s)
  2849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2850. }
  2851. func (s *Backend) UnmarshalJSON(data []byte) error {
  2852. type NoMethod Backend
  2853. var s1 struct {
  2854. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  2855. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  2856. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  2857. *NoMethod
  2858. }
  2859. s1.NoMethod = (*NoMethod)(s)
  2860. if err := json.Unmarshal(data, &s1); err != nil {
  2861. return err
  2862. }
  2863. s.CapacityScaler = float64(s1.CapacityScaler)
  2864. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  2865. s.MaxUtilization = float64(s1.MaxUtilization)
  2866. return nil
  2867. }
  2868. // BackendBucket: A BackendBucket resource. This resource defines a
  2869. // Cloud Storage bucket.
  2870. type BackendBucket struct {
  2871. // BucketName: Cloud Storage bucket name.
  2872. BucketName string `json:"bucketName,omitempty"`
  2873. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  2874. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  2875. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2876. // format.
  2877. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2878. // Description: An optional textual description of the resource;
  2879. // provided by the client when the resource is created.
  2880. Description string `json:"description,omitempty"`
  2881. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  2882. EnableCdn bool `json:"enableCdn,omitempty"`
  2883. // Id: [Output Only] Unique identifier for the resource; defined by the
  2884. // server.
  2885. Id uint64 `json:"id,omitempty,string"`
  2886. // Kind: Type of the resource.
  2887. Kind string `json:"kind,omitempty"`
  2888. // Name: Name of the resource. Provided by the client when the resource
  2889. // is created. The name must be 1-63 characters long, and comply with
  2890. // RFC1035. Specifically, the name must be 1-63 characters long and
  2891. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2892. // the first character must be a lowercase letter, and all following
  2893. // characters must be a dash, lowercase letter, or digit, except the
  2894. // last character, which cannot be a dash.
  2895. Name string `json:"name,omitempty"`
  2896. // SelfLink: [Output Only] Server-defined URL for the resource.
  2897. SelfLink string `json:"selfLink,omitempty"`
  2898. // ServerResponse contains the HTTP response code and headers from the
  2899. // server.
  2900. googleapi.ServerResponse `json:"-"`
  2901. // ForceSendFields is a list of field names (e.g. "BucketName") to
  2902. // unconditionally include in API requests. By default, fields with
  2903. // empty values are omitted from API requests. However, any non-pointer,
  2904. // non-interface field appearing in ForceSendFields will be sent to the
  2905. // server regardless of whether the field is empty or not. This may be
  2906. // used to include empty fields in Patch requests.
  2907. ForceSendFields []string `json:"-"`
  2908. // NullFields is a list of field names (e.g. "BucketName") to include in
  2909. // API requests with the JSON null value. By default, fields with empty
  2910. // values are omitted from API requests. However, any field with an
  2911. // empty value appearing in NullFields will be sent to the server as
  2912. // null. It is an error if a field in this list has a non-empty value.
  2913. // This may be used to include null fields in Patch requests.
  2914. NullFields []string `json:"-"`
  2915. }
  2916. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  2917. type NoMethod BackendBucket
  2918. raw := NoMethod(*s)
  2919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2920. }
  2921. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  2922. // for a backend bucket.
  2923. type BackendBucketCdnPolicy struct {
  2924. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  2925. // signed URL request will be considered fresh. After this time period,
  2926. // the response will be revalidated before being served. Defaults to 1hr
  2927. // (3600s). When serving responses to signed URL requests, Cloud CDN
  2928. // will internally behave as though all responses from this backend had
  2929. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  2930. // existing Cache-Control header. The actual headers served in responses
  2931. // will not be altered.
  2932. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  2933. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  2934. // request URLs.
  2935. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  2936. // ForceSendFields is a list of field names (e.g.
  2937. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  2938. // requests. By default, fields with empty values are omitted from API
  2939. // requests. However, any non-pointer, non-interface field appearing in
  2940. // ForceSendFields will be sent to the server regardless of whether the
  2941. // field is empty or not. This may be used to include empty fields in
  2942. // Patch requests.
  2943. ForceSendFields []string `json:"-"`
  2944. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  2945. // to include in API requests with the JSON null value. By default,
  2946. // fields with empty values are omitted from API requests. However, any
  2947. // field with an empty value appearing in NullFields will be sent to the
  2948. // server as null. It is an error if a field in this list has a
  2949. // non-empty value. This may be used to include null fields in Patch
  2950. // requests.
  2951. NullFields []string `json:"-"`
  2952. }
  2953. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  2954. type NoMethod BackendBucketCdnPolicy
  2955. raw := NoMethod(*s)
  2956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2957. }
  2958. // BackendBucketList: Contains a list of BackendBucket resources.
  2959. type BackendBucketList struct {
  2960. // Id: [Output Only] Unique identifier for the resource; defined by the
  2961. // server.
  2962. Id string `json:"id,omitempty"`
  2963. // Items: A list of BackendBucket resources.
  2964. Items []*BackendBucket `json:"items,omitempty"`
  2965. // Kind: Type of resource.
  2966. Kind string `json:"kind,omitempty"`
  2967. // NextPageToken: [Output Only] This token allows you to get the next
  2968. // page of results for list requests. If the number of results is larger
  2969. // than maxResults, use the nextPageToken as a value for the query
  2970. // parameter pageToken in the next list request. Subsequent list
  2971. // requests will have their own nextPageToken to continue paging through
  2972. // the results.
  2973. NextPageToken string `json:"nextPageToken,omitempty"`
  2974. // SelfLink: [Output Only] Server-defined URL for this resource.
  2975. SelfLink string `json:"selfLink,omitempty"`
  2976. // Warning: [Output Only] Informational warning message.
  2977. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  2978. // ServerResponse contains the HTTP response code and headers from the
  2979. // server.
  2980. googleapi.ServerResponse `json:"-"`
  2981. // ForceSendFields is a list of field names (e.g. "Id") to
  2982. // unconditionally include in API requests. By default, fields with
  2983. // empty values are omitted from API requests. However, any non-pointer,
  2984. // non-interface field appearing in ForceSendFields will be sent to the
  2985. // server regardless of whether the field is empty or not. This may be
  2986. // used to include empty fields in Patch requests.
  2987. ForceSendFields []string `json:"-"`
  2988. // NullFields is a list of field names (e.g. "Id") to include in API
  2989. // requests with the JSON null value. By default, fields with empty
  2990. // values are omitted from API requests. However, any field with an
  2991. // empty value appearing in NullFields will be sent to the server as
  2992. // null. It is an error if a field in this list has a non-empty value.
  2993. // This may be used to include null fields in Patch requests.
  2994. NullFields []string `json:"-"`
  2995. }
  2996. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  2997. type NoMethod BackendBucketList
  2998. raw := NoMethod(*s)
  2999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3000. }
  3001. // BackendBucketListWarning: [Output Only] Informational warning
  3002. // message.
  3003. type BackendBucketListWarning struct {
  3004. // Code: [Output Only] A warning code, if applicable. For example,
  3005. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3006. // the response.
  3007. //
  3008. // Possible values:
  3009. // "CLEANUP_FAILED"
  3010. // "DEPRECATED_RESOURCE_USED"
  3011. // "DEPRECATED_TYPE_USED"
  3012. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3013. // "EXPERIMENTAL_TYPE_USED"
  3014. // "EXTERNAL_API_WARNING"
  3015. // "FIELD_VALUE_OVERRIDEN"
  3016. // "INJECTED_KERNELS_DEPRECATED"
  3017. // "MISSING_TYPE_DEPENDENCY"
  3018. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3019. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3020. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3021. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3022. // "NEXT_HOP_NOT_RUNNING"
  3023. // "NOT_CRITICAL_ERROR"
  3024. // "NO_RESULTS_ON_PAGE"
  3025. // "REQUIRED_TOS_AGREEMENT"
  3026. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3027. // "RESOURCE_NOT_DELETED"
  3028. // "SCHEMA_VALIDATION_IGNORED"
  3029. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3030. // "UNDECLARED_PROPERTIES"
  3031. // "UNREACHABLE"
  3032. Code string `json:"code,omitempty"`
  3033. // Data: [Output Only] Metadata about this warning in key: value format.
  3034. // For example:
  3035. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3036. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3037. // Message: [Output Only] A human-readable description of the warning
  3038. // code.
  3039. Message string `json:"message,omitempty"`
  3040. // ForceSendFields is a list of field names (e.g. "Code") to
  3041. // unconditionally include in API requests. By default, fields with
  3042. // empty values are omitted from API requests. However, any non-pointer,
  3043. // non-interface field appearing in ForceSendFields will be sent to the
  3044. // server regardless of whether the field is empty or not. This may be
  3045. // used to include empty fields in Patch requests.
  3046. ForceSendFields []string `json:"-"`
  3047. // NullFields is a list of field names (e.g. "Code") to include in API
  3048. // requests with the JSON null value. By default, fields with empty
  3049. // values are omitted from API requests. However, any field with an
  3050. // empty value appearing in NullFields will be sent to the server as
  3051. // null. It is an error if a field in this list has a non-empty value.
  3052. // This may be used to include null fields in Patch requests.
  3053. NullFields []string `json:"-"`
  3054. }
  3055. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3056. type NoMethod BackendBucketListWarning
  3057. raw := NoMethod(*s)
  3058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3059. }
  3060. type BackendBucketListWarningData struct {
  3061. // Key: [Output Only] A key that provides more detail on the warning
  3062. // being returned. For example, for warnings where there are no results
  3063. // in a list request for a particular zone, this key might be scope and
  3064. // the key value might be the zone name. Other examples might be a key
  3065. // indicating a deprecated resource and a suggested replacement, or a
  3066. // warning about invalid network settings (for example, if an instance
  3067. // attempts to perform IP forwarding but is not enabled for IP
  3068. // forwarding).
  3069. Key string `json:"key,omitempty"`
  3070. // Value: [Output Only] A warning data value corresponding to the key.
  3071. Value string `json:"value,omitempty"`
  3072. // ForceSendFields is a list of field names (e.g. "Key") to
  3073. // unconditionally include in API requests. By default, fields with
  3074. // empty values are omitted from API requests. However, any non-pointer,
  3075. // non-interface field appearing in ForceSendFields will be sent to the
  3076. // server regardless of whether the field is empty or not. This may be
  3077. // used to include empty fields in Patch requests.
  3078. ForceSendFields []string `json:"-"`
  3079. // NullFields is a list of field names (e.g. "Key") to include in API
  3080. // requests with the JSON null value. By default, fields with empty
  3081. // values are omitted from API requests. However, any field with an
  3082. // empty value appearing in NullFields will be sent to the server as
  3083. // null. It is an error if a field in this list has a non-empty value.
  3084. // This may be used to include null fields in Patch requests.
  3085. NullFields []string `json:"-"`
  3086. }
  3087. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3088. type NoMethod BackendBucketListWarningData
  3089. raw := NoMethod(*s)
  3090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3091. }
  3092. // BackendService: A BackendService resource. This resource defines a
  3093. // group of backend virtual machines and their serving capacity. (==
  3094. // resource_for v1.backendService ==) (== resource_for
  3095. // beta.backendService ==)
  3096. type BackendService struct {
  3097. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3098. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3099. // non-persistent and lasts only until the end of the browser session
  3100. // (or equivalent). The maximum allowed value for TTL is one day.
  3101. //
  3102. // When the load balancing scheme is INTERNAL, this field is not used.
  3103. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3104. // Backends: The list of backends that serve this BackendService.
  3105. Backends []*Backend `json:"backends,omitempty"`
  3106. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3107. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3108. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3109. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3110. // format.
  3111. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3112. // Description: An optional description of this resource. Provide this
  3113. // property when you create the resource.
  3114. Description string `json:"description,omitempty"`
  3115. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3116. //
  3117. // When the load balancing scheme is INTERNAL, this field is not used.
  3118. EnableCDN bool `json:"enableCDN,omitempty"`
  3119. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3120. // stored in this object. This field is used in optimistic locking. This
  3121. // field will be ignored when inserting a BackendService. An up-to-date
  3122. // fingerprint must be provided in order to update the BackendService,
  3123. // otherwise the request will fail with error 412 conditionNotMet.
  3124. //
  3125. // To see the latest fingerprint, make a get() request to retrieve a
  3126. // BackendService.
  3127. Fingerprint string `json:"fingerprint,omitempty"`
  3128. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3129. // HttpsHealthCheck resource for health checking this BackendService.
  3130. // Currently at most one health check can be specified, and a health
  3131. // check is required for Compute Engine backend services. A health check
  3132. // must not be specified for App Engine backend and Cloud Function
  3133. // backend.
  3134. //
  3135. // For internal load balancing, a URL to a HealthCheck resource must be
  3136. // specified instead.
  3137. HealthChecks []string `json:"healthChecks,omitempty"`
  3138. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3139. // Id: [Output Only] The unique identifier for the resource. This
  3140. // identifier is defined by the server.
  3141. Id uint64 `json:"id,omitempty,string"`
  3142. // Kind: [Output Only] Type of resource. Always compute#backendService
  3143. // for backend services.
  3144. Kind string `json:"kind,omitempty"`
  3145. // LoadBalancingScheme: Indicates whether the backend service will be
  3146. // used with internal or external load balancing. A backend service
  3147. // created for one type of load balancing cannot be used with the other.
  3148. // Possible values are INTERNAL and EXTERNAL.
  3149. //
  3150. // Possible values:
  3151. // "EXTERNAL"
  3152. // "INTERNAL"
  3153. // "INVALID_LOAD_BALANCING_SCHEME"
  3154. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3155. // Name: Name of the resource. Provided by the client when the resource
  3156. // is created. The name must be 1-63 characters long, and comply with
  3157. // RFC1035. Specifically, the name must be 1-63 characters long and
  3158. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3159. // the first character must be a lowercase letter, and all following
  3160. // characters must be a dash, lowercase letter, or digit, except the
  3161. // last character, which cannot be a dash.
  3162. Name string `json:"name,omitempty"`
  3163. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3164. // backend. The default value is 80.
  3165. //
  3166. // This cannot be used for internal load balancing.
  3167. Port int64 `json:"port,omitempty"`
  3168. // PortName: Name of backend port. The same name should appear in the
  3169. // instance groups referenced by this service. Required when the load
  3170. // balancing scheme is EXTERNAL.
  3171. //
  3172. // When the load balancing scheme is INTERNAL, this field is not used.
  3173. PortName string `json:"portName,omitempty"`
  3174. // Protocol: The protocol this BackendService uses to communicate with
  3175. // backends.
  3176. //
  3177. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3178. // HTTP.
  3179. //
  3180. // For internal load balancing, the possible values are TCP and UDP, and
  3181. // the default is TCP.
  3182. //
  3183. // Possible values:
  3184. // "HTTP"
  3185. // "HTTPS"
  3186. // "SSL"
  3187. // "TCP"
  3188. // "UDP"
  3189. Protocol string `json:"protocol,omitempty"`
  3190. // Region: [Output Only] URL of the region where the regional backend
  3191. // service resides. This field is not applicable to global backend
  3192. // services. You must specify this field as part of the HTTP request
  3193. // URL. It is not settable as a field in the request body.
  3194. Region string `json:"region,omitempty"`
  3195. // SecurityPolicy: [Output Only] The resource URL for the security
  3196. // policy associated with this backend service.
  3197. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3198. // SelfLink: [Output Only] Server-defined URL for the resource.
  3199. SelfLink string `json:"selfLink,omitempty"`
  3200. // SessionAffinity: Type of session affinity to use. The default is
  3201. // NONE.
  3202. //
  3203. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3204. // or GENERATED_COOKIE.
  3205. //
  3206. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3207. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3208. //
  3209. // When the protocol is UDP, this field is not used.
  3210. //
  3211. // Possible values:
  3212. // "CLIENT_IP"
  3213. // "CLIENT_IP_PORT_PROTO"
  3214. // "CLIENT_IP_PROTO"
  3215. // "GENERATED_COOKIE"
  3216. // "NONE"
  3217. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3218. // TimeoutSec: How many seconds to wait for the backend before
  3219. // considering it a failed request. Default is 30 seconds.
  3220. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3221. // ServerResponse contains the HTTP response code and headers from the
  3222. // server.
  3223. googleapi.ServerResponse `json:"-"`
  3224. // ForceSendFields is a list of field names (e.g.
  3225. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3226. // By default, fields with empty values are omitted from API requests.
  3227. // However, any non-pointer, non-interface field appearing in
  3228. // ForceSendFields will be sent to the server regardless of whether the
  3229. // field is empty or not. This may be used to include empty fields in
  3230. // Patch requests.
  3231. ForceSendFields []string `json:"-"`
  3232. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3233. // include in API requests with the JSON null value. By default, fields
  3234. // with empty values are omitted from API requests. However, any field
  3235. // with an empty value appearing in NullFields will be sent to the
  3236. // server as null. It is an error if a field in this list has a
  3237. // non-empty value. This may be used to include null fields in Patch
  3238. // requests.
  3239. NullFields []string `json:"-"`
  3240. }
  3241. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3242. type NoMethod BackendService
  3243. raw := NoMethod(*s)
  3244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3245. }
  3246. // BackendServiceAggregatedList: Contains a list of
  3247. // BackendServicesScopedList.
  3248. type BackendServiceAggregatedList struct {
  3249. // Id: [Output Only] Unique identifier for the resource; defined by the
  3250. // server.
  3251. Id string `json:"id,omitempty"`
  3252. // Items: A list of BackendServicesScopedList resources.
  3253. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3254. // Kind: Type of resource.
  3255. Kind string `json:"kind,omitempty"`
  3256. // NextPageToken: [Output Only] This token allows you to get the next
  3257. // page of results for list requests. If the number of results is larger
  3258. // than maxResults, use the nextPageToken as a value for the query
  3259. // parameter pageToken in the next list request. Subsequent list
  3260. // requests will have their own nextPageToken to continue paging through
  3261. // the results.
  3262. NextPageToken string `json:"nextPageToken,omitempty"`
  3263. // SelfLink: [Output Only] Server-defined URL for this resource.
  3264. SelfLink string `json:"selfLink,omitempty"`
  3265. // Warning: [Output Only] Informational warning message.
  3266. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  3267. // ServerResponse contains the HTTP response code and headers from the
  3268. // server.
  3269. googleapi.ServerResponse `json:"-"`
  3270. // ForceSendFields is a list of field names (e.g. "Id") to
  3271. // unconditionally include in API requests. By default, fields with
  3272. // empty values are omitted from API requests. However, any non-pointer,
  3273. // non-interface field appearing in ForceSendFields will be sent to the
  3274. // server regardless of whether the field is empty or not. This may be
  3275. // used to include empty fields in Patch requests.
  3276. ForceSendFields []string `json:"-"`
  3277. // NullFields is a list of field names (e.g. "Id") to include in API
  3278. // requests with the JSON null value. By default, fields with empty
  3279. // values are omitted from API requests. However, any field with an
  3280. // empty value appearing in NullFields will be sent to the server as
  3281. // null. It is an error if a field in this list has a non-empty value.
  3282. // This may be used to include null fields in Patch requests.
  3283. NullFields []string `json:"-"`
  3284. }
  3285. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3286. type NoMethod BackendServiceAggregatedList
  3287. raw := NoMethod(*s)
  3288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3289. }
  3290. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3291. // warning message.
  3292. type BackendServiceAggregatedListWarning struct {
  3293. // Code: [Output Only] A warning code, if applicable. For example,
  3294. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3295. // the response.
  3296. //
  3297. // Possible values:
  3298. // "CLEANUP_FAILED"
  3299. // "DEPRECATED_RESOURCE_USED"
  3300. // "DEPRECATED_TYPE_USED"
  3301. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3302. // "EXPERIMENTAL_TYPE_USED"
  3303. // "EXTERNAL_API_WARNING"
  3304. // "FIELD_VALUE_OVERRIDEN"
  3305. // "INJECTED_KERNELS_DEPRECATED"
  3306. // "MISSING_TYPE_DEPENDENCY"
  3307. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3308. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3309. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3310. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3311. // "NEXT_HOP_NOT_RUNNING"
  3312. // "NOT_CRITICAL_ERROR"
  3313. // "NO_RESULTS_ON_PAGE"
  3314. // "REQUIRED_TOS_AGREEMENT"
  3315. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3316. // "RESOURCE_NOT_DELETED"
  3317. // "SCHEMA_VALIDATION_IGNORED"
  3318. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3319. // "UNDECLARED_PROPERTIES"
  3320. // "UNREACHABLE"
  3321. Code string `json:"code,omitempty"`
  3322. // Data: [Output Only] Metadata about this warning in key: value format.
  3323. // For example:
  3324. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3325. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  3326. // Message: [Output Only] A human-readable description of the warning
  3327. // code.
  3328. Message string `json:"message,omitempty"`
  3329. // ForceSendFields is a list of field names (e.g. "Code") to
  3330. // unconditionally include in API requests. By default, fields with
  3331. // empty values are omitted from API requests. However, any non-pointer,
  3332. // non-interface field appearing in ForceSendFields will be sent to the
  3333. // server regardless of whether the field is empty or not. This may be
  3334. // used to include empty fields in Patch requests.
  3335. ForceSendFields []string `json:"-"`
  3336. // NullFields is a list of field names (e.g. "Code") to include in API
  3337. // requests with the JSON null value. By default, fields with empty
  3338. // values are omitted from API requests. However, any field with an
  3339. // empty value appearing in NullFields will be sent to the server as
  3340. // null. It is an error if a field in this list has a non-empty value.
  3341. // This may be used to include null fields in Patch requests.
  3342. NullFields []string `json:"-"`
  3343. }
  3344. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3345. type NoMethod BackendServiceAggregatedListWarning
  3346. raw := NoMethod(*s)
  3347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3348. }
  3349. type BackendServiceAggregatedListWarningData struct {
  3350. // Key: [Output Only] A key that provides more detail on the warning
  3351. // being returned. For example, for warnings where there are no results
  3352. // in a list request for a particular zone, this key might be scope and
  3353. // the key value might be the zone name. Other examples might be a key
  3354. // indicating a deprecated resource and a suggested replacement, or a
  3355. // warning about invalid network settings (for example, if an instance
  3356. // attempts to perform IP forwarding but is not enabled for IP
  3357. // forwarding).
  3358. Key string `json:"key,omitempty"`
  3359. // Value: [Output Only] A warning data value corresponding to the key.
  3360. Value string `json:"value,omitempty"`
  3361. // ForceSendFields is a list of field names (e.g. "Key") to
  3362. // unconditionally include in API requests. By default, fields with
  3363. // empty values are omitted from API requests. However, any non-pointer,
  3364. // non-interface field appearing in ForceSendFields will be sent to the
  3365. // server regardless of whether the field is empty or not. This may be
  3366. // used to include empty fields in Patch requests.
  3367. ForceSendFields []string `json:"-"`
  3368. // NullFields is a list of field names (e.g. "Key") to include in API
  3369. // requests with the JSON null value. By default, fields with empty
  3370. // values are omitted from API requests. However, any field with an
  3371. // empty value appearing in NullFields will be sent to the server as
  3372. // null. It is an error if a field in this list has a non-empty value.
  3373. // This may be used to include null fields in Patch requests.
  3374. NullFields []string `json:"-"`
  3375. }
  3376. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3377. type NoMethod BackendServiceAggregatedListWarningData
  3378. raw := NoMethod(*s)
  3379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3380. }
  3381. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  3382. // for a backend service.
  3383. type BackendServiceCdnPolicy struct {
  3384. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  3385. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  3386. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3387. // signed URL request will be considered fresh. After this time period,
  3388. // the response will be revalidated before being served. Defaults to 1hr
  3389. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3390. // will internally behave as though all responses from this backend had
  3391. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3392. // existing Cache-Control header. The actual headers served in responses
  3393. // will not be altered.
  3394. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3395. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3396. // request URLs.
  3397. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3398. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  3399. // unconditionally include in API requests. By default, fields with
  3400. // empty values are omitted from API requests. However, any non-pointer,
  3401. // non-interface field appearing in ForceSendFields will be sent to the
  3402. // server regardless of whether the field is empty or not. This may be
  3403. // used to include empty fields in Patch requests.
  3404. ForceSendFields []string `json:"-"`
  3405. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  3406. // include in API requests with the JSON null value. By default, fields
  3407. // with empty values are omitted from API requests. However, any field
  3408. // with an empty value appearing in NullFields will be sent to the
  3409. // server as null. It is an error if a field in this list has a
  3410. // non-empty value. This may be used to include null fields in Patch
  3411. // requests.
  3412. NullFields []string `json:"-"`
  3413. }
  3414. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  3415. type NoMethod BackendServiceCdnPolicy
  3416. raw := NoMethod(*s)
  3417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3418. }
  3419. type BackendServiceGroupHealth struct {
  3420. // HealthStatus: Health state of the backend instances or endpoints in
  3421. // requested instance or network endpoint group, determined based on
  3422. // configured health checks.
  3423. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  3424. // Kind: [Output Only] Type of resource. Always
  3425. // compute#backendServiceGroupHealth for the health of backend services.
  3426. Kind string `json:"kind,omitempty"`
  3427. // ServerResponse contains the HTTP response code and headers from the
  3428. // server.
  3429. googleapi.ServerResponse `json:"-"`
  3430. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  3431. // unconditionally include in API requests. By default, fields with
  3432. // empty values are omitted from API requests. However, any non-pointer,
  3433. // non-interface field appearing in ForceSendFields will be sent to the
  3434. // server regardless of whether the field is empty or not. This may be
  3435. // used to include empty fields in Patch requests.
  3436. ForceSendFields []string `json:"-"`
  3437. // NullFields is a list of field names (e.g. "HealthStatus") to include
  3438. // in API requests with the JSON null value. By default, fields with
  3439. // empty values are omitted from API requests. However, any field with
  3440. // an empty value appearing in NullFields will be sent to the server as
  3441. // null. It is an error if a field in this list has a non-empty value.
  3442. // This may be used to include null fields in Patch requests.
  3443. NullFields []string `json:"-"`
  3444. }
  3445. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  3446. type NoMethod BackendServiceGroupHealth
  3447. raw := NoMethod(*s)
  3448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3449. }
  3450. // BackendServiceIAP: Identity-Aware Proxy
  3451. type BackendServiceIAP struct {
  3452. Enabled bool `json:"enabled,omitempty"`
  3453. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  3454. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  3455. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  3456. // field oauth2_client_secret above.
  3457. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  3458. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3459. // unconditionally include in API requests. By default, fields with
  3460. // empty values are omitted from API requests. However, any non-pointer,
  3461. // non-interface field appearing in ForceSendFields will be sent to the
  3462. // server regardless of whether the field is empty or not. This may be
  3463. // used to include empty fields in Patch requests.
  3464. ForceSendFields []string `json:"-"`
  3465. // NullFields is a list of field names (e.g. "Enabled") to include in
  3466. // API requests with the JSON null value. By default, fields with empty
  3467. // values are omitted from API requests. However, any field with an
  3468. // empty value appearing in NullFields will be sent to the server as
  3469. // null. It is an error if a field in this list has a non-empty value.
  3470. // This may be used to include null fields in Patch requests.
  3471. NullFields []string `json:"-"`
  3472. }
  3473. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  3474. type NoMethod BackendServiceIAP
  3475. raw := NoMethod(*s)
  3476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3477. }
  3478. // BackendServiceList: Contains a list of BackendService resources.
  3479. type BackendServiceList struct {
  3480. // Id: [Output Only] Unique identifier for the resource; defined by the
  3481. // server.
  3482. Id string `json:"id,omitempty"`
  3483. // Items: A list of BackendService resources.
  3484. Items []*BackendService `json:"items,omitempty"`
  3485. // Kind: [Output Only] Type of resource. Always
  3486. // compute#backendServiceList for lists of backend services.
  3487. Kind string `json:"kind,omitempty"`
  3488. // NextPageToken: [Output Only] This token allows you to get the next
  3489. // page of results for list requests. If the number of results is larger
  3490. // than maxResults, use the nextPageToken as a value for the query
  3491. // parameter pageToken in the next list request. Subsequent list
  3492. // requests will have their own nextPageToken to continue paging through
  3493. // the results.
  3494. NextPageToken string `json:"nextPageToken,omitempty"`
  3495. // SelfLink: [Output Only] Server-defined URL for this resource.
  3496. SelfLink string `json:"selfLink,omitempty"`
  3497. // Warning: [Output Only] Informational warning message.
  3498. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  3499. // ServerResponse contains the HTTP response code and headers from the
  3500. // server.
  3501. googleapi.ServerResponse `json:"-"`
  3502. // ForceSendFields is a list of field names (e.g. "Id") to
  3503. // unconditionally include in API requests. By default, fields with
  3504. // empty values are omitted from API requests. However, any non-pointer,
  3505. // non-interface field appearing in ForceSendFields will be sent to the
  3506. // server regardless of whether the field is empty or not. This may be
  3507. // used to include empty fields in Patch requests.
  3508. ForceSendFields []string `json:"-"`
  3509. // NullFields is a list of field names (e.g. "Id") to include in API
  3510. // requests with the JSON null value. By default, fields with empty
  3511. // values are omitted from API requests. However, any field with an
  3512. // empty value appearing in NullFields will be sent to the server as
  3513. // null. It is an error if a field in this list has a non-empty value.
  3514. // This may be used to include null fields in Patch requests.
  3515. NullFields []string `json:"-"`
  3516. }
  3517. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  3518. type NoMethod BackendServiceList
  3519. raw := NoMethod(*s)
  3520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3521. }
  3522. // BackendServiceListWarning: [Output Only] Informational warning
  3523. // message.
  3524. type BackendServiceListWarning struct {
  3525. // Code: [Output Only] A warning code, if applicable. For example,
  3526. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3527. // the response.
  3528. //
  3529. // Possible values:
  3530. // "CLEANUP_FAILED"
  3531. // "DEPRECATED_RESOURCE_USED"
  3532. // "DEPRECATED_TYPE_USED"
  3533. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3534. // "EXPERIMENTAL_TYPE_USED"
  3535. // "EXTERNAL_API_WARNING"
  3536. // "FIELD_VALUE_OVERRIDEN"
  3537. // "INJECTED_KERNELS_DEPRECATED"
  3538. // "MISSING_TYPE_DEPENDENCY"
  3539. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3540. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3541. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3542. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3543. // "NEXT_HOP_NOT_RUNNING"
  3544. // "NOT_CRITICAL_ERROR"
  3545. // "NO_RESULTS_ON_PAGE"
  3546. // "REQUIRED_TOS_AGREEMENT"
  3547. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3548. // "RESOURCE_NOT_DELETED"
  3549. // "SCHEMA_VALIDATION_IGNORED"
  3550. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3551. // "UNDECLARED_PROPERTIES"
  3552. // "UNREACHABLE"
  3553. Code string `json:"code,omitempty"`
  3554. // Data: [Output Only] Metadata about this warning in key: value format.
  3555. // For example:
  3556. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3557. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  3558. // Message: [Output Only] A human-readable description of the warning
  3559. // code.
  3560. Message string `json:"message,omitempty"`
  3561. // ForceSendFields is a list of field names (e.g. "Code") to
  3562. // unconditionally include in API requests. By default, fields with
  3563. // empty values are omitted from API requests. However, any non-pointer,
  3564. // non-interface field appearing in ForceSendFields will be sent to the
  3565. // server regardless of whether the field is empty or not. This may be
  3566. // used to include empty fields in Patch requests.
  3567. ForceSendFields []string `json:"-"`
  3568. // NullFields is a list of field names (e.g. "Code") to include in API
  3569. // requests with the JSON null value. By default, fields with empty
  3570. // values are omitted from API requests. However, any field with an
  3571. // empty value appearing in NullFields will be sent to the server as
  3572. // null. It is an error if a field in this list has a non-empty value.
  3573. // This may be used to include null fields in Patch requests.
  3574. NullFields []string `json:"-"`
  3575. }
  3576. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  3577. type NoMethod BackendServiceListWarning
  3578. raw := NoMethod(*s)
  3579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3580. }
  3581. type BackendServiceListWarningData struct {
  3582. // Key: [Output Only] A key that provides more detail on the warning
  3583. // being returned. For example, for warnings where there are no results
  3584. // in a list request for a particular zone, this key might be scope and
  3585. // the key value might be the zone name. Other examples might be a key
  3586. // indicating a deprecated resource and a suggested replacement, or a
  3587. // warning about invalid network settings (for example, if an instance
  3588. // attempts to perform IP forwarding but is not enabled for IP
  3589. // forwarding).
  3590. Key string `json:"key,omitempty"`
  3591. // Value: [Output Only] A warning data value corresponding to the key.
  3592. Value string `json:"value,omitempty"`
  3593. // ForceSendFields is a list of field names (e.g. "Key") to
  3594. // unconditionally include in API requests. By default, fields with
  3595. // empty values are omitted from API requests. However, any non-pointer,
  3596. // non-interface field appearing in ForceSendFields will be sent to the
  3597. // server regardless of whether the field is empty or not. This may be
  3598. // used to include empty fields in Patch requests.
  3599. ForceSendFields []string `json:"-"`
  3600. // NullFields is a list of field names (e.g. "Key") to include in API
  3601. // requests with the JSON null value. By default, fields with empty
  3602. // values are omitted from API requests. However, any field with an
  3603. // empty value appearing in NullFields will be sent to the server as
  3604. // null. It is an error if a field in this list has a non-empty value.
  3605. // This may be used to include null fields in Patch requests.
  3606. NullFields []string `json:"-"`
  3607. }
  3608. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  3609. type NoMethod BackendServiceListWarningData
  3610. raw := NoMethod(*s)
  3611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3612. }
  3613. type BackendServicesScopedList struct {
  3614. // BackendServices: A list of BackendServices contained in this scope.
  3615. BackendServices []*BackendService `json:"backendServices,omitempty"`
  3616. // Warning: Informational warning which replaces the list of backend
  3617. // services when the list is empty.
  3618. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  3619. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  3620. // unconditionally include in API requests. By default, fields with
  3621. // empty values are omitted from API requests. However, any non-pointer,
  3622. // non-interface field appearing in ForceSendFields will be sent to the
  3623. // server regardless of whether the field is empty or not. This may be
  3624. // used to include empty fields in Patch requests.
  3625. ForceSendFields []string `json:"-"`
  3626. // NullFields is a list of field names (e.g. "BackendServices") to
  3627. // include in API requests with the JSON null value. By default, fields
  3628. // with empty values are omitted from API requests. However, any field
  3629. // with an empty value appearing in NullFields will be sent to the
  3630. // server as null. It is an error if a field in this list has a
  3631. // non-empty value. This may be used to include null fields in Patch
  3632. // requests.
  3633. NullFields []string `json:"-"`
  3634. }
  3635. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  3636. type NoMethod BackendServicesScopedList
  3637. raw := NoMethod(*s)
  3638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3639. }
  3640. // BackendServicesScopedListWarning: Informational warning which
  3641. // replaces the list of backend services when the list is empty.
  3642. type BackendServicesScopedListWarning struct {
  3643. // Code: [Output Only] A warning code, if applicable. For example,
  3644. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3645. // the response.
  3646. //
  3647. // Possible values:
  3648. // "CLEANUP_FAILED"
  3649. // "DEPRECATED_RESOURCE_USED"
  3650. // "DEPRECATED_TYPE_USED"
  3651. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3652. // "EXPERIMENTAL_TYPE_USED"
  3653. // "EXTERNAL_API_WARNING"
  3654. // "FIELD_VALUE_OVERRIDEN"
  3655. // "INJECTED_KERNELS_DEPRECATED"
  3656. // "MISSING_TYPE_DEPENDENCY"
  3657. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3658. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3659. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3660. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3661. // "NEXT_HOP_NOT_RUNNING"
  3662. // "NOT_CRITICAL_ERROR"
  3663. // "NO_RESULTS_ON_PAGE"
  3664. // "REQUIRED_TOS_AGREEMENT"
  3665. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3666. // "RESOURCE_NOT_DELETED"
  3667. // "SCHEMA_VALIDATION_IGNORED"
  3668. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3669. // "UNDECLARED_PROPERTIES"
  3670. // "UNREACHABLE"
  3671. Code string `json:"code,omitempty"`
  3672. // Data: [Output Only] Metadata about this warning in key: value format.
  3673. // For example:
  3674. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3675. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  3676. // Message: [Output Only] A human-readable description of the warning
  3677. // code.
  3678. Message string `json:"message,omitempty"`
  3679. // ForceSendFields is a list of field names (e.g. "Code") to
  3680. // unconditionally include in API requests. By default, fields with
  3681. // empty values are omitted from API requests. However, any non-pointer,
  3682. // non-interface field appearing in ForceSendFields will be sent to the
  3683. // server regardless of whether the field is empty or not. This may be
  3684. // used to include empty fields in Patch requests.
  3685. ForceSendFields []string `json:"-"`
  3686. // NullFields is a list of field names (e.g. "Code") to include in API
  3687. // requests with the JSON null value. By default, fields with empty
  3688. // values are omitted from API requests. However, any field with an
  3689. // empty value appearing in NullFields will be sent to the server as
  3690. // null. It is an error if a field in this list has a non-empty value.
  3691. // This may be used to include null fields in Patch requests.
  3692. NullFields []string `json:"-"`
  3693. }
  3694. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  3695. type NoMethod BackendServicesScopedListWarning
  3696. raw := NoMethod(*s)
  3697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3698. }
  3699. type BackendServicesScopedListWarningData struct {
  3700. // Key: [Output Only] A key that provides more detail on the warning
  3701. // being returned. For example, for warnings where there are no results
  3702. // in a list request for a particular zone, this key might be scope and
  3703. // the key value might be the zone name. Other examples might be a key
  3704. // indicating a deprecated resource and a suggested replacement, or a
  3705. // warning about invalid network settings (for example, if an instance
  3706. // attempts to perform IP forwarding but is not enabled for IP
  3707. // forwarding).
  3708. Key string `json:"key,omitempty"`
  3709. // Value: [Output Only] A warning data value corresponding to the key.
  3710. Value string `json:"value,omitempty"`
  3711. // ForceSendFields is a list of field names (e.g. "Key") to
  3712. // unconditionally include in API requests. By default, fields with
  3713. // empty values are omitted from API requests. However, any non-pointer,
  3714. // non-interface field appearing in ForceSendFields will be sent to the
  3715. // server regardless of whether the field is empty or not. This may be
  3716. // used to include empty fields in Patch requests.
  3717. ForceSendFields []string `json:"-"`
  3718. // NullFields is a list of field names (e.g. "Key") to include in API
  3719. // requests with the JSON null value. By default, fields with empty
  3720. // values are omitted from API requests. However, any field with an
  3721. // empty value appearing in NullFields will be sent to the server as
  3722. // null. It is an error if a field in this list has a non-empty value.
  3723. // This may be used to include null fields in Patch requests.
  3724. NullFields []string `json:"-"`
  3725. }
  3726. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3727. type NoMethod BackendServicesScopedListWarningData
  3728. raw := NoMethod(*s)
  3729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3730. }
  3731. // Binding: Associates `members` with a `role`.
  3732. type Binding struct {
  3733. // Condition: Unimplemented. The condition that is associated with this
  3734. // binding. NOTE: an unsatisfied condition will not allow user access
  3735. // via current binding. Different bindings, including their conditions,
  3736. // are examined independently.
  3737. Condition *Expr `json:"condition,omitempty"`
  3738. // Members: Specifies the identities requesting access for a Cloud
  3739. // Platform resource. `members` can have the following values:
  3740. //
  3741. // * `allUsers`: A special identifier that represents anyone who is on
  3742. // the internet; with or without a Google account.
  3743. //
  3744. // * `allAuthenticatedUsers`: A special identifier that represents
  3745. // anyone who is authenticated with a Google account or a service
  3746. // account.
  3747. //
  3748. // * `user:{emailid}`: An email address that represents a specific
  3749. // Google account. For example, `alice@gmail.com` .
  3750. //
  3751. //
  3752. //
  3753. // * `serviceAccount:{emailid}`: An email address that represents a
  3754. // service account. For example,
  3755. // `my-other-app@appspot.gserviceaccount.com`.
  3756. //
  3757. // * `group:{emailid}`: An email address that represents a Google group.
  3758. // For example, `admins@example.com`.
  3759. //
  3760. //
  3761. //
  3762. // * `domain:{domain}`: A Google Apps domain name that represents all
  3763. // the users of that domain. For example, `google.com` or `example.com`.
  3764. Members []string `json:"members,omitempty"`
  3765. // Role: Role that is assigned to `members`. For example,
  3766. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  3767. Role string `json:"role,omitempty"`
  3768. // ForceSendFields is a list of field names (e.g. "Condition") to
  3769. // unconditionally include in API requests. By default, fields with
  3770. // empty values are omitted from API requests. However, any non-pointer,
  3771. // non-interface field appearing in ForceSendFields will be sent to the
  3772. // server regardless of whether the field is empty or not. This may be
  3773. // used to include empty fields in Patch requests.
  3774. ForceSendFields []string `json:"-"`
  3775. // NullFields is a list of field names (e.g. "Condition") to include in
  3776. // API requests with the JSON null value. By default, fields with empty
  3777. // values are omitted from API requests. However, any field with an
  3778. // empty value appearing in NullFields will be sent to the server as
  3779. // null. It is an error if a field in this list has a non-empty value.
  3780. // This may be used to include null fields in Patch requests.
  3781. NullFields []string `json:"-"`
  3782. }
  3783. func (s *Binding) MarshalJSON() ([]byte, error) {
  3784. type NoMethod Binding
  3785. raw := NoMethod(*s)
  3786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3787. }
  3788. type CacheInvalidationRule struct {
  3789. // Host: If set, this invalidation rule will only apply to requests with
  3790. // a Host header matching host.
  3791. Host string `json:"host,omitempty"`
  3792. Path string `json:"path,omitempty"`
  3793. // ForceSendFields is a list of field names (e.g. "Host") to
  3794. // unconditionally include in API requests. By default, fields with
  3795. // empty values are omitted from API requests. However, any non-pointer,
  3796. // non-interface field appearing in ForceSendFields will be sent to the
  3797. // server regardless of whether the field is empty or not. This may be
  3798. // used to include empty fields in Patch requests.
  3799. ForceSendFields []string `json:"-"`
  3800. // NullFields is a list of field names (e.g. "Host") to include in API
  3801. // requests with the JSON null value. By default, fields with empty
  3802. // values are omitted from API requests. However, any field with an
  3803. // empty value appearing in NullFields will be sent to the server as
  3804. // null. It is an error if a field in this list has a non-empty value.
  3805. // This may be used to include null fields in Patch requests.
  3806. NullFields []string `json:"-"`
  3807. }
  3808. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  3809. type NoMethod CacheInvalidationRule
  3810. raw := NoMethod(*s)
  3811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3812. }
  3813. // CacheKeyPolicy: Message containing what to include in the cache key
  3814. // for a request for Cloud CDN.
  3815. type CacheKeyPolicy struct {
  3816. // IncludeHost: If true, requests to different hosts will be cached
  3817. // separately.
  3818. IncludeHost bool `json:"includeHost,omitempty"`
  3819. // IncludeProtocol: If true, http and https requests will be cached
  3820. // separately.
  3821. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  3822. // IncludeQueryString: If true, include query string parameters in the
  3823. // cache key according to query_string_whitelist and
  3824. // query_string_blacklist. If neither is set, the entire query string
  3825. // will be included. If false, the query string will be excluded from
  3826. // the cache key entirely.
  3827. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  3828. // QueryStringBlacklist: Names of query string parameters to exclude in
  3829. // cache keys. All other parameters will be included. Either specify
  3830. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3831. // '=' will be percent encoded and not treated as delimiters.
  3832. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  3833. // QueryStringWhitelist: Names of query string parameters to include in
  3834. // cache keys. All other parameters will be excluded. Either specify
  3835. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3836. // '=' will be percent encoded and not treated as delimiters.
  3837. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  3838. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  3839. // unconditionally include in API requests. By default, fields with
  3840. // empty values are omitted from API requests. However, any non-pointer,
  3841. // non-interface field appearing in ForceSendFields will be sent to the
  3842. // server regardless of whether the field is empty or not. This may be
  3843. // used to include empty fields in Patch requests.
  3844. ForceSendFields []string `json:"-"`
  3845. // NullFields is a list of field names (e.g. "IncludeHost") to include
  3846. // in API requests with the JSON null value. By default, fields with
  3847. // empty values are omitted from API requests. However, any field with
  3848. // an empty value appearing in NullFields will be sent to the server as
  3849. // null. It is an error if a field in this list has a non-empty value.
  3850. // This may be used to include null fields in Patch requests.
  3851. NullFields []string `json:"-"`
  3852. }
  3853. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  3854. type NoMethod CacheKeyPolicy
  3855. raw := NoMethod(*s)
  3856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3857. }
  3858. // Commitment: Represents a Commitment resource. Creating a Commitment
  3859. // resource means that you are purchasing a committed use contract with
  3860. // an explicit start and end time. You can create commitments based on
  3861. // vCPUs and memory usage and receive discounted rates. For full
  3862. // details, read Signing Up for Committed Use Discounts.
  3863. //
  3864. // Committed use discounts are subject to Google Cloud Platform's
  3865. // Service Specific Terms. By purchasing a committed use discount, you
  3866. // agree to these terms. Committed use discounts will not renew, so you
  3867. // must purchase a new commitment to continue receiving discounts. (==
  3868. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  3869. type Commitment struct {
  3870. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3871. // format.
  3872. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3873. // Description: An optional description of this resource. Provide this
  3874. // property when you create the resource.
  3875. Description string `json:"description,omitempty"`
  3876. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  3877. // format.
  3878. EndTimestamp string `json:"endTimestamp,omitempty"`
  3879. // Id: [Output Only] The unique identifier for the resource. This
  3880. // identifier is defined by the server.
  3881. Id uint64 `json:"id,omitempty,string"`
  3882. // Kind: [Output Only] Type of the resource. Always compute#commitment
  3883. // for commitments.
  3884. Kind string `json:"kind,omitempty"`
  3885. // Name: Name of the resource. Provided by the client when the resource
  3886. // is created. The name must be 1-63 characters long, and comply with
  3887. // RFC1035. Specifically, the name must be 1-63 characters long and
  3888. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3889. // the first character must be a lowercase letter, and all following
  3890. // characters must be a dash, lowercase letter, or digit, except the
  3891. // last character, which cannot be a dash.
  3892. Name string `json:"name,omitempty"`
  3893. // Plan: The plan for this commitment, which determines duration and
  3894. // discount rate. The currently supported plans are TWELVE_MONTH (1
  3895. // year), and THIRTY_SIX_MONTH (3 years).
  3896. //
  3897. // Possible values:
  3898. // "INVALID"
  3899. // "THIRTY_SIX_MONTH"
  3900. // "TWELVE_MONTH"
  3901. Plan string `json:"plan,omitempty"`
  3902. // Region: [Output Only] URL of the region where this commitment may be
  3903. // used.
  3904. Region string `json:"region,omitempty"`
  3905. // Resources: A list of commitment amounts for particular resources.
  3906. // Note that VCPU and MEMORY resource commitments must occur together.
  3907. Resources []*ResourceCommitment `json:"resources,omitempty"`
  3908. // SelfLink: [Output Only] Server-defined URL for the resource.
  3909. SelfLink string `json:"selfLink,omitempty"`
  3910. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  3911. // format.
  3912. StartTimestamp string `json:"startTimestamp,omitempty"`
  3913. // Status: [Output Only] Status of the commitment with regards to
  3914. // eventual expiration (each commitment has an end date defined). One of
  3915. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  3916. //
  3917. // Possible values:
  3918. // "ACTIVE"
  3919. // "CREATING"
  3920. // "EXPIRED"
  3921. // "NOT_YET_ACTIVE"
  3922. Status string `json:"status,omitempty"`
  3923. // StatusMessage: [Output Only] An optional, human-readable explanation
  3924. // of the status.
  3925. StatusMessage string `json:"statusMessage,omitempty"`
  3926. // ServerResponse contains the HTTP response code and headers from the
  3927. // server.
  3928. googleapi.ServerResponse `json:"-"`
  3929. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  3930. // to unconditionally include in API requests. By default, fields with
  3931. // empty values are omitted from API requests. However, any non-pointer,
  3932. // non-interface field appearing in ForceSendFields will be sent to the
  3933. // server regardless of whether the field is empty or not. This may be
  3934. // used to include empty fields in Patch requests.
  3935. ForceSendFields []string `json:"-"`
  3936. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  3937. // include in API requests with the JSON null value. By default, fields
  3938. // with empty values are omitted from API requests. However, any field
  3939. // with an empty value appearing in NullFields will be sent to the
  3940. // server as null. It is an error if a field in this list has a
  3941. // non-empty value. This may be used to include null fields in Patch
  3942. // requests.
  3943. NullFields []string `json:"-"`
  3944. }
  3945. func (s *Commitment) MarshalJSON() ([]byte, error) {
  3946. type NoMethod Commitment
  3947. raw := NoMethod(*s)
  3948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3949. }
  3950. type CommitmentAggregatedList struct {
  3951. // Id: [Output Only] Unique identifier for the resource; defined by the
  3952. // server.
  3953. Id string `json:"id,omitempty"`
  3954. // Items: A list of CommitmentsScopedList resources.
  3955. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  3956. // Kind: [Output Only] Type of resource. Always
  3957. // compute#commitmentAggregatedList for aggregated lists of commitments.
  3958. Kind string `json:"kind,omitempty"`
  3959. // NextPageToken: [Output Only] This token allows you to get the next
  3960. // page of results for list requests. If the number of results is larger
  3961. // than maxResults, use the nextPageToken as a value for the query
  3962. // parameter pageToken in the next list request. Subsequent list
  3963. // requests will have their own nextPageToken to continue paging through
  3964. // the results.
  3965. NextPageToken string `json:"nextPageToken,omitempty"`
  3966. // SelfLink: [Output Only] Server-defined URL for this resource.
  3967. SelfLink string `json:"selfLink,omitempty"`
  3968. // Warning: [Output Only] Informational warning message.
  3969. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  3970. // ServerResponse contains the HTTP response code and headers from the
  3971. // server.
  3972. googleapi.ServerResponse `json:"-"`
  3973. // ForceSendFields is a list of field names (e.g. "Id") to
  3974. // unconditionally include in API requests. By default, fields with
  3975. // empty values are omitted from API requests. However, any non-pointer,
  3976. // non-interface field appearing in ForceSendFields will be sent to the
  3977. // server regardless of whether the field is empty or not. This may be
  3978. // used to include empty fields in Patch requests.
  3979. ForceSendFields []string `json:"-"`
  3980. // NullFields is a list of field names (e.g. "Id") to include in API
  3981. // requests with the JSON null value. By default, fields with empty
  3982. // values are omitted from API requests. However, any field with an
  3983. // empty value appearing in NullFields will be sent to the server as
  3984. // null. It is an error if a field in this list has a non-empty value.
  3985. // This may be used to include null fields in Patch requests.
  3986. NullFields []string `json:"-"`
  3987. }
  3988. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  3989. type NoMethod CommitmentAggregatedList
  3990. raw := NoMethod(*s)
  3991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3992. }
  3993. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  3994. // message.
  3995. type CommitmentAggregatedListWarning struct {
  3996. // Code: [Output Only] A warning code, if applicable. For example,
  3997. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3998. // the response.
  3999. //
  4000. // Possible values:
  4001. // "CLEANUP_FAILED"
  4002. // "DEPRECATED_RESOURCE_USED"
  4003. // "DEPRECATED_TYPE_USED"
  4004. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4005. // "EXPERIMENTAL_TYPE_USED"
  4006. // "EXTERNAL_API_WARNING"
  4007. // "FIELD_VALUE_OVERRIDEN"
  4008. // "INJECTED_KERNELS_DEPRECATED"
  4009. // "MISSING_TYPE_DEPENDENCY"
  4010. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4011. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4012. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4013. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4014. // "NEXT_HOP_NOT_RUNNING"
  4015. // "NOT_CRITICAL_ERROR"
  4016. // "NO_RESULTS_ON_PAGE"
  4017. // "REQUIRED_TOS_AGREEMENT"
  4018. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4019. // "RESOURCE_NOT_DELETED"
  4020. // "SCHEMA_VALIDATION_IGNORED"
  4021. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4022. // "UNDECLARED_PROPERTIES"
  4023. // "UNREACHABLE"
  4024. Code string `json:"code,omitempty"`
  4025. // Data: [Output Only] Metadata about this warning in key: value format.
  4026. // For example:
  4027. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4028. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4029. // Message: [Output Only] A human-readable description of the warning
  4030. // code.
  4031. Message string `json:"message,omitempty"`
  4032. // ForceSendFields is a list of field names (e.g. "Code") to
  4033. // unconditionally include in API requests. By default, fields with
  4034. // empty values are omitted from API requests. However, any non-pointer,
  4035. // non-interface field appearing in ForceSendFields will be sent to the
  4036. // server regardless of whether the field is empty or not. This may be
  4037. // used to include empty fields in Patch requests.
  4038. ForceSendFields []string `json:"-"`
  4039. // NullFields is a list of field names (e.g. "Code") to include in API
  4040. // requests with the JSON null value. By default, fields with empty
  4041. // values are omitted from API requests. However, any field with an
  4042. // empty value appearing in NullFields will be sent to the server as
  4043. // null. It is an error if a field in this list has a non-empty value.
  4044. // This may be used to include null fields in Patch requests.
  4045. NullFields []string `json:"-"`
  4046. }
  4047. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4048. type NoMethod CommitmentAggregatedListWarning
  4049. raw := NoMethod(*s)
  4050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4051. }
  4052. type CommitmentAggregatedListWarningData struct {
  4053. // Key: [Output Only] A key that provides more detail on the warning
  4054. // being returned. For example, for warnings where there are no results
  4055. // in a list request for a particular zone, this key might be scope and
  4056. // the key value might be the zone name. Other examples might be a key
  4057. // indicating a deprecated resource and a suggested replacement, or a
  4058. // warning about invalid network settings (for example, if an instance
  4059. // attempts to perform IP forwarding but is not enabled for IP
  4060. // forwarding).
  4061. Key string `json:"key,omitempty"`
  4062. // Value: [Output Only] A warning data value corresponding to the key.
  4063. Value string `json:"value,omitempty"`
  4064. // ForceSendFields is a list of field names (e.g. "Key") to
  4065. // unconditionally include in API requests. By default, fields with
  4066. // empty values are omitted from API requests. However, any non-pointer,
  4067. // non-interface field appearing in ForceSendFields will be sent to the
  4068. // server regardless of whether the field is empty or not. This may be
  4069. // used to include empty fields in Patch requests.
  4070. ForceSendFields []string `json:"-"`
  4071. // NullFields is a list of field names (e.g. "Key") to include in API
  4072. // requests with the JSON null value. By default, fields with empty
  4073. // values are omitted from API requests. However, any field with an
  4074. // empty value appearing in NullFields will be sent to the server as
  4075. // null. It is an error if a field in this list has a non-empty value.
  4076. // This may be used to include null fields in Patch requests.
  4077. NullFields []string `json:"-"`
  4078. }
  4079. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4080. type NoMethod CommitmentAggregatedListWarningData
  4081. raw := NoMethod(*s)
  4082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4083. }
  4084. // CommitmentList: Contains a list of Commitment resources.
  4085. type CommitmentList struct {
  4086. // Id: [Output Only] Unique identifier for the resource; defined by the
  4087. // server.
  4088. Id string `json:"id,omitempty"`
  4089. // Items: A list of Commitment resources.
  4090. Items []*Commitment `json:"items,omitempty"`
  4091. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4092. // for lists of commitments.
  4093. Kind string `json:"kind,omitempty"`
  4094. // NextPageToken: [Output Only] This token allows you to get the next
  4095. // page of results for list requests. If the number of results is larger
  4096. // than maxResults, use the nextPageToken as a value for the query
  4097. // parameter pageToken in the next list request. Subsequent list
  4098. // requests will have their own nextPageToken to continue paging through
  4099. // the results.
  4100. NextPageToken string `json:"nextPageToken,omitempty"`
  4101. // SelfLink: [Output Only] Server-defined URL for this resource.
  4102. SelfLink string `json:"selfLink,omitempty"`
  4103. // Warning: [Output Only] Informational warning message.
  4104. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4105. // ServerResponse contains the HTTP response code and headers from the
  4106. // server.
  4107. googleapi.ServerResponse `json:"-"`
  4108. // ForceSendFields is a list of field names (e.g. "Id") to
  4109. // unconditionally include in API requests. By default, fields with
  4110. // empty values are omitted from API requests. However, any non-pointer,
  4111. // non-interface field appearing in ForceSendFields will be sent to the
  4112. // server regardless of whether the field is empty or not. This may be
  4113. // used to include empty fields in Patch requests.
  4114. ForceSendFields []string `json:"-"`
  4115. // NullFields is a list of field names (e.g. "Id") to include in API
  4116. // requests with the JSON null value. By default, fields with empty
  4117. // values are omitted from API requests. However, any field with an
  4118. // empty value appearing in NullFields will be sent to the server as
  4119. // null. It is an error if a field in this list has a non-empty value.
  4120. // This may be used to include null fields in Patch requests.
  4121. NullFields []string `json:"-"`
  4122. }
  4123. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  4124. type NoMethod CommitmentList
  4125. raw := NoMethod(*s)
  4126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4127. }
  4128. // CommitmentListWarning: [Output Only] Informational warning message.
  4129. type CommitmentListWarning struct {
  4130. // Code: [Output Only] A warning code, if applicable. For example,
  4131. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4132. // the response.
  4133. //
  4134. // Possible values:
  4135. // "CLEANUP_FAILED"
  4136. // "DEPRECATED_RESOURCE_USED"
  4137. // "DEPRECATED_TYPE_USED"
  4138. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4139. // "EXPERIMENTAL_TYPE_USED"
  4140. // "EXTERNAL_API_WARNING"
  4141. // "FIELD_VALUE_OVERRIDEN"
  4142. // "INJECTED_KERNELS_DEPRECATED"
  4143. // "MISSING_TYPE_DEPENDENCY"
  4144. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4145. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4146. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4147. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4148. // "NEXT_HOP_NOT_RUNNING"
  4149. // "NOT_CRITICAL_ERROR"
  4150. // "NO_RESULTS_ON_PAGE"
  4151. // "REQUIRED_TOS_AGREEMENT"
  4152. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4153. // "RESOURCE_NOT_DELETED"
  4154. // "SCHEMA_VALIDATION_IGNORED"
  4155. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4156. // "UNDECLARED_PROPERTIES"
  4157. // "UNREACHABLE"
  4158. Code string `json:"code,omitempty"`
  4159. // Data: [Output Only] Metadata about this warning in key: value format.
  4160. // For example:
  4161. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4162. Data []*CommitmentListWarningData `json:"data,omitempty"`
  4163. // Message: [Output Only] A human-readable description of the warning
  4164. // code.
  4165. Message string `json:"message,omitempty"`
  4166. // ForceSendFields is a list of field names (e.g. "Code") to
  4167. // unconditionally include in API requests. By default, fields with
  4168. // empty values are omitted from API requests. However, any non-pointer,
  4169. // non-interface field appearing in ForceSendFields will be sent to the
  4170. // server regardless of whether the field is empty or not. This may be
  4171. // used to include empty fields in Patch requests.
  4172. ForceSendFields []string `json:"-"`
  4173. // NullFields is a list of field names (e.g. "Code") to include in API
  4174. // requests with the JSON null value. By default, fields with empty
  4175. // values are omitted from API requests. However, any field with an
  4176. // empty value appearing in NullFields will be sent to the server as
  4177. // null. It is an error if a field in this list has a non-empty value.
  4178. // This may be used to include null fields in Patch requests.
  4179. NullFields []string `json:"-"`
  4180. }
  4181. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  4182. type NoMethod CommitmentListWarning
  4183. raw := NoMethod(*s)
  4184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4185. }
  4186. type CommitmentListWarningData struct {
  4187. // Key: [Output Only] A key that provides more detail on the warning
  4188. // being returned. For example, for warnings where there are no results
  4189. // in a list request for a particular zone, this key might be scope and
  4190. // the key value might be the zone name. Other examples might be a key
  4191. // indicating a deprecated resource and a suggested replacement, or a
  4192. // warning about invalid network settings (for example, if an instance
  4193. // attempts to perform IP forwarding but is not enabled for IP
  4194. // forwarding).
  4195. Key string `json:"key,omitempty"`
  4196. // Value: [Output Only] A warning data value corresponding to the key.
  4197. Value string `json:"value,omitempty"`
  4198. // ForceSendFields is a list of field names (e.g. "Key") to
  4199. // unconditionally include in API requests. By default, fields with
  4200. // empty values are omitted from API requests. However, any non-pointer,
  4201. // non-interface field appearing in ForceSendFields will be sent to the
  4202. // server regardless of whether the field is empty or not. This may be
  4203. // used to include empty fields in Patch requests.
  4204. ForceSendFields []string `json:"-"`
  4205. // NullFields is a list of field names (e.g. "Key") to include in API
  4206. // requests with the JSON null value. By default, fields with empty
  4207. // values are omitted from API requests. However, any field with an
  4208. // empty value appearing in NullFields will be sent to the server as
  4209. // null. It is an error if a field in this list has a non-empty value.
  4210. // This may be used to include null fields in Patch requests.
  4211. NullFields []string `json:"-"`
  4212. }
  4213. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  4214. type NoMethod CommitmentListWarningData
  4215. raw := NoMethod(*s)
  4216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4217. }
  4218. type CommitmentsScopedList struct {
  4219. // Commitments: [Output Only] A list of commitments contained in this
  4220. // scope.
  4221. Commitments []*Commitment `json:"commitments,omitempty"`
  4222. // Warning: [Output Only] Informational warning which replaces the list
  4223. // of commitments when the list is empty.
  4224. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  4225. // ForceSendFields is a list of field names (e.g. "Commitments") to
  4226. // unconditionally include in API requests. By default, fields with
  4227. // empty values are omitted from API requests. However, any non-pointer,
  4228. // non-interface field appearing in ForceSendFields will be sent to the
  4229. // server regardless of whether the field is empty or not. This may be
  4230. // used to include empty fields in Patch requests.
  4231. ForceSendFields []string `json:"-"`
  4232. // NullFields is a list of field names (e.g. "Commitments") to include
  4233. // in API requests with the JSON null value. By default, fields with
  4234. // empty values are omitted from API requests. However, any field with
  4235. // an empty value appearing in NullFields will be sent to the server as
  4236. // null. It is an error if a field in this list has a non-empty value.
  4237. // This may be used to include null fields in Patch requests.
  4238. NullFields []string `json:"-"`
  4239. }
  4240. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  4241. type NoMethod CommitmentsScopedList
  4242. raw := NoMethod(*s)
  4243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4244. }
  4245. // CommitmentsScopedListWarning: [Output Only] Informational warning
  4246. // which replaces the list of commitments when the list is empty.
  4247. type CommitmentsScopedListWarning struct {
  4248. // Code: [Output Only] A warning code, if applicable. For example,
  4249. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4250. // the response.
  4251. //
  4252. // Possible values:
  4253. // "CLEANUP_FAILED"
  4254. // "DEPRECATED_RESOURCE_USED"
  4255. // "DEPRECATED_TYPE_USED"
  4256. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4257. // "EXPERIMENTAL_TYPE_USED"
  4258. // "EXTERNAL_API_WARNING"
  4259. // "FIELD_VALUE_OVERRIDEN"
  4260. // "INJECTED_KERNELS_DEPRECATED"
  4261. // "MISSING_TYPE_DEPENDENCY"
  4262. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4263. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4264. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4265. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4266. // "NEXT_HOP_NOT_RUNNING"
  4267. // "NOT_CRITICAL_ERROR"
  4268. // "NO_RESULTS_ON_PAGE"
  4269. // "REQUIRED_TOS_AGREEMENT"
  4270. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4271. // "RESOURCE_NOT_DELETED"
  4272. // "SCHEMA_VALIDATION_IGNORED"
  4273. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4274. // "UNDECLARED_PROPERTIES"
  4275. // "UNREACHABLE"
  4276. Code string `json:"code,omitempty"`
  4277. // Data: [Output Only] Metadata about this warning in key: value format.
  4278. // For example:
  4279. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4280. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  4281. // Message: [Output Only] A human-readable description of the warning
  4282. // code.
  4283. Message string `json:"message,omitempty"`
  4284. // ForceSendFields is a list of field names (e.g. "Code") to
  4285. // unconditionally include in API requests. By default, fields with
  4286. // empty values are omitted from API requests. However, any non-pointer,
  4287. // non-interface field appearing in ForceSendFields will be sent to the
  4288. // server regardless of whether the field is empty or not. This may be
  4289. // used to include empty fields in Patch requests.
  4290. ForceSendFields []string `json:"-"`
  4291. // NullFields is a list of field names (e.g. "Code") to include in API
  4292. // requests with the JSON null value. By default, fields with empty
  4293. // values are omitted from API requests. However, any field with an
  4294. // empty value appearing in NullFields will be sent to the server as
  4295. // null. It is an error if a field in this list has a non-empty value.
  4296. // This may be used to include null fields in Patch requests.
  4297. NullFields []string `json:"-"`
  4298. }
  4299. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  4300. type NoMethod CommitmentsScopedListWarning
  4301. raw := NoMethod(*s)
  4302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4303. }
  4304. type CommitmentsScopedListWarningData struct {
  4305. // Key: [Output Only] A key that provides more detail on the warning
  4306. // being returned. For example, for warnings where there are no results
  4307. // in a list request for a particular zone, this key might be scope and
  4308. // the key value might be the zone name. Other examples might be a key
  4309. // indicating a deprecated resource and a suggested replacement, or a
  4310. // warning about invalid network settings (for example, if an instance
  4311. // attempts to perform IP forwarding but is not enabled for IP
  4312. // forwarding).
  4313. Key string `json:"key,omitempty"`
  4314. // Value: [Output Only] A warning data value corresponding to the key.
  4315. Value string `json:"value,omitempty"`
  4316. // ForceSendFields is a list of field names (e.g. "Key") to
  4317. // unconditionally include in API requests. By default, fields with
  4318. // empty values are omitted from API requests. However, any non-pointer,
  4319. // non-interface field appearing in ForceSendFields will be sent to the
  4320. // server regardless of whether the field is empty or not. This may be
  4321. // used to include empty fields in Patch requests.
  4322. ForceSendFields []string `json:"-"`
  4323. // NullFields is a list of field names (e.g. "Key") to include in API
  4324. // requests with the JSON null value. By default, fields with empty
  4325. // values are omitted from API requests. However, any field with an
  4326. // empty value appearing in NullFields will be sent to the server as
  4327. // null. It is an error if a field in this list has a non-empty value.
  4328. // This may be used to include null fields in Patch requests.
  4329. NullFields []string `json:"-"`
  4330. }
  4331. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4332. type NoMethod CommitmentsScopedListWarningData
  4333. raw := NoMethod(*s)
  4334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4335. }
  4336. // Condition: A condition to be met.
  4337. type Condition struct {
  4338. // Iam: Trusted attributes supplied by the IAM system.
  4339. //
  4340. // Possible values:
  4341. // "APPROVER"
  4342. // "ATTRIBUTION"
  4343. // "AUTHORITY"
  4344. // "CREDENTIALS_TYPE"
  4345. // "JUSTIFICATION_TYPE"
  4346. // "NO_ATTR"
  4347. // "SECURITY_REALM"
  4348. Iam string `json:"iam,omitempty"`
  4349. // Op: An operator to apply the subject with.
  4350. //
  4351. // Possible values:
  4352. // "DISCHARGED"
  4353. // "EQUALS"
  4354. // "IN"
  4355. // "NOT_EQUALS"
  4356. // "NOT_IN"
  4357. // "NO_OP"
  4358. Op string `json:"op,omitempty"`
  4359. // Svc: Trusted attributes discharged by the service.
  4360. Svc string `json:"svc,omitempty"`
  4361. // Sys: Trusted attributes supplied by any service that owns resources
  4362. // and uses the IAM system for access control.
  4363. //
  4364. // Possible values:
  4365. // "IP"
  4366. // "NAME"
  4367. // "NO_ATTR"
  4368. // "REGION"
  4369. // "SERVICE"
  4370. Sys string `json:"sys,omitempty"`
  4371. // Value: DEPRECATED. Use 'values' instead.
  4372. Value string `json:"value,omitempty"`
  4373. // Values: The objects of the condition. This is mutually exclusive with
  4374. // 'value'.
  4375. Values []string `json:"values,omitempty"`
  4376. // ForceSendFields is a list of field names (e.g. "Iam") to
  4377. // unconditionally include in API requests. By default, fields with
  4378. // empty values are omitted from API requests. However, any non-pointer,
  4379. // non-interface field appearing in ForceSendFields will be sent to the
  4380. // server regardless of whether the field is empty or not. This may be
  4381. // used to include empty fields in Patch requests.
  4382. ForceSendFields []string `json:"-"`
  4383. // NullFields is a list of field names (e.g. "Iam") to include in API
  4384. // requests with the JSON null value. By default, fields with empty
  4385. // values are omitted from API requests. However, any field with an
  4386. // empty value appearing in NullFields will be sent to the server as
  4387. // null. It is an error if a field in this list has a non-empty value.
  4388. // This may be used to include null fields in Patch requests.
  4389. NullFields []string `json:"-"`
  4390. }
  4391. func (s *Condition) MarshalJSON() ([]byte, error) {
  4392. type NoMethod Condition
  4393. raw := NoMethod(*s)
  4394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4395. }
  4396. // ConnectionDraining: Message containing connection draining
  4397. // configuration.
  4398. type ConnectionDraining struct {
  4399. // DrainingTimeoutSec: Time for which instance will be drained (not
  4400. // accept new connections, but still work to finish started).
  4401. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  4402. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  4403. // to unconditionally include in API requests. By default, fields with
  4404. // empty values are omitted from API requests. However, any non-pointer,
  4405. // non-interface field appearing in ForceSendFields will be sent to the
  4406. // server regardless of whether the field is empty or not. This may be
  4407. // used to include empty fields in Patch requests.
  4408. ForceSendFields []string `json:"-"`
  4409. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  4410. // include in API requests with the JSON null value. By default, fields
  4411. // with empty values are omitted from API requests. However, any field
  4412. // with an empty value appearing in NullFields will be sent to the
  4413. // server as null. It is an error if a field in this list has a
  4414. // non-empty value. This may be used to include null fields in Patch
  4415. // requests.
  4416. NullFields []string `json:"-"`
  4417. }
  4418. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  4419. type NoMethod ConnectionDraining
  4420. raw := NoMethod(*s)
  4421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4422. }
  4423. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  4424. type CustomerEncryptionKey struct {
  4425. // KmsKeyName: The name of the encryption key that is stored in Google
  4426. // Cloud KMS.
  4427. KmsKeyName string `json:"kmsKeyName,omitempty"`
  4428. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  4429. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  4430. RawKey string `json:"rawKey,omitempty"`
  4431. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  4432. // customer-supplied encryption key that protects this resource.
  4433. Sha256 string `json:"sha256,omitempty"`
  4434. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  4435. // unconditionally include in API requests. By default, fields with
  4436. // empty values are omitted from API requests. However, any non-pointer,
  4437. // non-interface field appearing in ForceSendFields will be sent to the
  4438. // server regardless of whether the field is empty or not. This may be
  4439. // used to include empty fields in Patch requests.
  4440. ForceSendFields []string `json:"-"`
  4441. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  4442. // API requests with the JSON null value. By default, fields with empty
  4443. // values are omitted from API requests. However, any field with an
  4444. // empty value appearing in NullFields will be sent to the server as
  4445. // null. It is an error if a field in this list has a non-empty value.
  4446. // This may be used to include null fields in Patch requests.
  4447. NullFields []string `json:"-"`
  4448. }
  4449. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  4450. type NoMethod CustomerEncryptionKey
  4451. raw := NoMethod(*s)
  4452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4453. }
  4454. type CustomerEncryptionKeyProtectedDisk struct {
  4455. // DiskEncryptionKey: Decrypts data associated with the disk with a
  4456. // customer-supplied encryption key.
  4457. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4458. // Source: Specifies a valid partial or full URL to an existing
  4459. // Persistent Disk resource. This field is only applicable for
  4460. // persistent disks.
  4461. Source string `json:"source,omitempty"`
  4462. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  4463. // to unconditionally include in API requests. By default, fields with
  4464. // empty values are omitted from API requests. However, any non-pointer,
  4465. // non-interface field appearing in ForceSendFields will be sent to the
  4466. // server regardless of whether the field is empty or not. This may be
  4467. // used to include empty fields in Patch requests.
  4468. ForceSendFields []string `json:"-"`
  4469. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  4470. // include in API requests with the JSON null value. By default, fields
  4471. // with empty values are omitted from API requests. However, any field
  4472. // with an empty value appearing in NullFields will be sent to the
  4473. // server as null. It is an error if a field in this list has a
  4474. // non-empty value. This may be used to include null fields in Patch
  4475. // requests.
  4476. NullFields []string `json:"-"`
  4477. }
  4478. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  4479. type NoMethod CustomerEncryptionKeyProtectedDisk
  4480. raw := NoMethod(*s)
  4481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4482. }
  4483. // DeprecationStatus: Deprecation status for a public resource.
  4484. type DeprecationStatus struct {
  4485. // Deleted: An optional RFC3339 timestamp on or after which the state of
  4486. // this resource is intended to change to DELETED. This is only
  4487. // informational and the status will not change unless the client
  4488. // explicitly changes it.
  4489. Deleted string `json:"deleted,omitempty"`
  4490. // Deprecated: An optional RFC3339 timestamp on or after which the state
  4491. // of this resource is intended to change to DEPRECATED. This is only
  4492. // informational and the status will not change unless the client
  4493. // explicitly changes it.
  4494. Deprecated string `json:"deprecated,omitempty"`
  4495. // Obsolete: An optional RFC3339 timestamp on or after which the state
  4496. // of this resource is intended to change to OBSOLETE. This is only
  4497. // informational and the status will not change unless the client
  4498. // explicitly changes it.
  4499. Obsolete string `json:"obsolete,omitempty"`
  4500. // Replacement: The URL of the suggested replacement for a deprecated
  4501. // resource. The suggested replacement resource must be the same kind of
  4502. // resource as the deprecated resource.
  4503. Replacement string `json:"replacement,omitempty"`
  4504. // State: The deprecation state of this resource. This can be
  4505. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  4506. // resource using a DEPRECATED resource will return successfully, but
  4507. // with a warning indicating the deprecated resource and recommending
  4508. // its replacement. Operations which use OBSOLETE or DELETED resources
  4509. // will be rejected and result in an error.
  4510. //
  4511. // Possible values:
  4512. // "DELETED"
  4513. // "DEPRECATED"
  4514. // "OBSOLETE"
  4515. State string `json:"state,omitempty"`
  4516. // ForceSendFields is a list of field names (e.g. "Deleted") to
  4517. // unconditionally include in API requests. By default, fields with
  4518. // empty values are omitted from API requests. However, any non-pointer,
  4519. // non-interface field appearing in ForceSendFields will be sent to the
  4520. // server regardless of whether the field is empty or not. This may be
  4521. // used to include empty fields in Patch requests.
  4522. ForceSendFields []string `json:"-"`
  4523. // NullFields is a list of field names (e.g. "Deleted") to include in
  4524. // API requests with the JSON null value. By default, fields with empty
  4525. // values are omitted from API requests. However, any field with an
  4526. // empty value appearing in NullFields will be sent to the server as
  4527. // null. It is an error if a field in this list has a non-empty value.
  4528. // This may be used to include null fields in Patch requests.
  4529. NullFields []string `json:"-"`
  4530. }
  4531. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  4532. type NoMethod DeprecationStatus
  4533. raw := NoMethod(*s)
  4534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4535. }
  4536. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  4537. // resource_for v1.disks ==)
  4538. type Disk struct {
  4539. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4540. // format.
  4541. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4542. // Description: An optional description of this resource. Provide this
  4543. // property when you create the resource.
  4544. Description string `json:"description,omitempty"`
  4545. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  4546. // encryption key.
  4547. //
  4548. // After you encrypt a disk with a customer-supplied key, you must
  4549. // provide the same key if you use the disk later (e.g. to create a disk
  4550. // snapshot or an image, or to attach the disk to a virtual
  4551. // machine).
  4552. //
  4553. // Customer-supplied encryption keys do not protect access to metadata
  4554. // of the disk.
  4555. //
  4556. // If you do not provide an encryption key when creating the disk, then
  4557. // the disk will be encrypted using an automatically generated key and
  4558. // you do not need to provide a key to use the disk later.
  4559. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4560. // GuestOsFeatures: A list of features to enable on the guest operating
  4561. // system. Applicable only for bootable images. Read Enabling guest
  4562. // operating system features to see a list of available options.
  4563. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  4564. // Id: [Output Only] The unique identifier for the resource. This
  4565. // identifier is defined by the server.
  4566. Id uint64 `json:"id,omitempty,string"`
  4567. // Kind: [Output Only] Type of the resource. Always compute#disk for
  4568. // disks.
  4569. Kind string `json:"kind,omitempty"`
  4570. // LabelFingerprint: A fingerprint for the labels being applied to this
  4571. // disk, which is essentially a hash of the labels set used for
  4572. // optimistic locking. The fingerprint is initially generated by Compute
  4573. // Engine and changes after every request to modify or update labels.
  4574. // You must always provide an up-to-date fingerprint hash in order to
  4575. // update or change labels, otherwise the request will fail with error
  4576. // 412 conditionNotMet.
  4577. //
  4578. // To see the latest fingerprint, make a get() request to retrieve a
  4579. // disk.
  4580. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4581. // Labels: Labels to apply to this disk. These can be later modified by
  4582. // the setLabels method.
  4583. Labels map[string]string `json:"labels,omitempty"`
  4584. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  4585. // text format.
  4586. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  4587. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  4588. // text format.
  4589. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  4590. // LicenseCodes: Integer license codes indicating which licenses are
  4591. // attached to this disk.
  4592. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  4593. // Licenses: A list of publicly visible licenses. Reserved for Google's
  4594. // use.
  4595. Licenses []string `json:"licenses,omitempty"`
  4596. // Name: Name of the resource. Provided by the client when the resource
  4597. // is created. The name must be 1-63 characters long, and comply with
  4598. // RFC1035. Specifically, the name must be 1-63 characters long and
  4599. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4600. // the first character must be a lowercase letter, and all following
  4601. // characters must be a dash, lowercase letter, or digit, except the
  4602. // last character, which cannot be a dash.
  4603. Name string `json:"name,omitempty"`
  4604. // Options: Internal use only.
  4605. Options string `json:"options,omitempty"`
  4606. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  4607. // in bytes. If not present in a request, a default value is used.
  4608. // Currently supported sizes are 4096 and 16384, other sizes may be
  4609. // added in the future. If an unsupported value is requested, the error
  4610. // message will list the supported values for the caller's project.
  4611. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  4612. // Region: [Output Only] URL of the region where the disk resides. Only
  4613. // applicable for regional resources. You must specify this field as
  4614. // part of the HTTP request URL. It is not settable as a field in the
  4615. // request body.
  4616. Region string `json:"region,omitempty"`
  4617. // ReplicaZones: URLs of the zones where the disk should be replicated
  4618. // to. Only applicable for regional resources.
  4619. ReplicaZones []string `json:"replicaZones,omitempty"`
  4620. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  4621. // resource.
  4622. SelfLink string `json:"selfLink,omitempty"`
  4623. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  4624. // this field when creating a persistent disk using the sourceImage or
  4625. // sourceSnapshot parameter, or specify it alone to create an empty
  4626. // persistent disk.
  4627. //
  4628. // If you specify this field along with sourceImage or sourceSnapshot,
  4629. // the value of sizeGb must not be less than the size of the sourceImage
  4630. // or the size of the snapshot. Acceptable values are 1 to 65536,
  4631. // inclusive.
  4632. SizeGb int64 `json:"sizeGb,omitempty,string"`
  4633. // SourceImage: The source image used to create this disk. If the source
  4634. // image is deleted, this field will not be set.
  4635. //
  4636. // To create a disk with one of the public operating system images,
  4637. // specify the image by its family name. For example, specify
  4638. // family/debian-9 to use the latest Debian 9
  4639. // image:
  4640. // projects/debian-cloud/global/images/family/debian-9
  4641. //
  4642. //
  4643. // Alternati
  4644. // vely, use a specific version of a public operating system
  4645. // image:
  4646. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  4647. //
  4648. //
  4649. //
  4650. // To create a disk with a custom image that you created, specify the
  4651. // image name in the following
  4652. // format:
  4653. // global/images/my-custom-image
  4654. //
  4655. //
  4656. // You can also specify a custom image by its image family, which
  4657. // returns the latest version of the image in that family. Replace the
  4658. // image name with
  4659. // family/family-name:
  4660. // global/images/family/my-image-family
  4661. SourceImage string `json:"sourceImage,omitempty"`
  4662. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  4663. // source image. Required if the source image is protected by a
  4664. // customer-supplied encryption key.
  4665. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  4666. // SourceImageId: [Output Only] The ID value of the image used to create
  4667. // this disk. This value identifies the exact image that was used to
  4668. // create this persistent disk. For example, if you created the
  4669. // persistent disk from an image that was later deleted and recreated
  4670. // under the same name, the source image ID would identify the exact
  4671. // version of the image that was used.
  4672. SourceImageId string `json:"sourceImageId,omitempty"`
  4673. // SourceSnapshot: The source snapshot used to create this disk. You can
  4674. // provide this as a partial or full URL to the resource. For example,
  4675. // the following are valid values:
  4676. // -
  4677. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  4678. // - projects/project/global/snapshots/snapshot
  4679. // - global/snapshots/snapshot
  4680. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  4681. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  4682. // the source snapshot. Required if the source snapshot is protected by
  4683. // a customer-supplied encryption key.
  4684. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  4685. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  4686. // create this disk. This value identifies the exact snapshot that was
  4687. // used to create this persistent disk. For example, if you created the
  4688. // persistent disk from a snapshot that was later deleted and recreated
  4689. // under the same name, the source snapshot ID would identify the exact
  4690. // version of the snapshot that was used.
  4691. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  4692. // Status: [Output Only] The status of disk creation.
  4693. //
  4694. // Possible values:
  4695. // "CREATING"
  4696. // "FAILED"
  4697. // "READY"
  4698. // "RESTORING"
  4699. Status string `json:"status,omitempty"`
  4700. // Type: URL of the disk type resource describing which disk type to use
  4701. // to create the disk. Provide this when creating the disk. For example:
  4702. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  4703. Type string `json:"type,omitempty"`
  4704. // Users: [Output Only] Links to the users of the disk (attached
  4705. // instances) in form: project/zones/zone/instances/instance
  4706. Users []string `json:"users,omitempty"`
  4707. // Zone: [Output Only] URL of the zone where the disk resides. You must
  4708. // specify this field as part of the HTTP request URL. It is not
  4709. // settable as a field in the request body.
  4710. Zone string `json:"zone,omitempty"`
  4711. // ServerResponse contains the HTTP response code and headers from the
  4712. // server.
  4713. googleapi.ServerResponse `json:"-"`
  4714. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4715. // to unconditionally include in API requests. By default, fields with
  4716. // empty values are omitted from API requests. However, any non-pointer,
  4717. // non-interface field appearing in ForceSendFields will be sent to the
  4718. // server regardless of whether the field is empty or not. This may be
  4719. // used to include empty fields in Patch requests.
  4720. ForceSendFields []string `json:"-"`
  4721. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4722. // include in API requests with the JSON null value. By default, fields
  4723. // with empty values are omitted from API requests. However, any field
  4724. // with an empty value appearing in NullFields will be sent to the
  4725. // server as null. It is an error if a field in this list has a
  4726. // non-empty value. This may be used to include null fields in Patch
  4727. // requests.
  4728. NullFields []string `json:"-"`
  4729. }
  4730. func (s *Disk) MarshalJSON() ([]byte, error) {
  4731. type NoMethod Disk
  4732. raw := NoMethod(*s)
  4733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4734. }
  4735. type DiskAggregatedList struct {
  4736. // Id: [Output Only] Unique identifier for the resource; defined by the
  4737. // server.
  4738. Id string `json:"id,omitempty"`
  4739. // Items: A list of DisksScopedList resources.
  4740. Items map[string]DisksScopedList `json:"items,omitempty"`
  4741. // Kind: [Output Only] Type of resource. Always
  4742. // compute#diskAggregatedList for aggregated lists of persistent disks.
  4743. Kind string `json:"kind,omitempty"`
  4744. // NextPageToken: [Output Only] This token allows you to get the next
  4745. // page of results for list requests. If the number of results is larger
  4746. // than maxResults, use the nextPageToken as a value for the query
  4747. // parameter pageToken in the next list request. Subsequent list
  4748. // requests will have their own nextPageToken to continue paging through
  4749. // the results.
  4750. NextPageToken string `json:"nextPageToken,omitempty"`
  4751. // SelfLink: [Output Only] Server-defined URL for this resource.
  4752. SelfLink string `json:"selfLink,omitempty"`
  4753. // Warning: [Output Only] Informational warning message.
  4754. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  4755. // ServerResponse contains the HTTP response code and headers from the
  4756. // server.
  4757. googleapi.ServerResponse `json:"-"`
  4758. // ForceSendFields is a list of field names (e.g. "Id") to
  4759. // unconditionally include in API requests. By default, fields with
  4760. // empty values are omitted from API requests. However, any non-pointer,
  4761. // non-interface field appearing in ForceSendFields will be sent to the
  4762. // server regardless of whether the field is empty or not. This may be
  4763. // used to include empty fields in Patch requests.
  4764. ForceSendFields []string `json:"-"`
  4765. // NullFields is a list of field names (e.g. "Id") to include in API
  4766. // requests with the JSON null value. By default, fields with empty
  4767. // values are omitted from API requests. However, any field with an
  4768. // empty value appearing in NullFields will be sent to the server as
  4769. // null. It is an error if a field in this list has a non-empty value.
  4770. // This may be used to include null fields in Patch requests.
  4771. NullFields []string `json:"-"`
  4772. }
  4773. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  4774. type NoMethod DiskAggregatedList
  4775. raw := NoMethod(*s)
  4776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4777. }
  4778. // DiskAggregatedListWarning: [Output Only] Informational warning
  4779. // message.
  4780. type DiskAggregatedListWarning struct {
  4781. // Code: [Output Only] A warning code, if applicable. For example,
  4782. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4783. // the response.
  4784. //
  4785. // Possible values:
  4786. // "CLEANUP_FAILED"
  4787. // "DEPRECATED_RESOURCE_USED"
  4788. // "DEPRECATED_TYPE_USED"
  4789. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4790. // "EXPERIMENTAL_TYPE_USED"
  4791. // "EXTERNAL_API_WARNING"
  4792. // "FIELD_VALUE_OVERRIDEN"
  4793. // "INJECTED_KERNELS_DEPRECATED"
  4794. // "MISSING_TYPE_DEPENDENCY"
  4795. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4796. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4797. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4798. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4799. // "NEXT_HOP_NOT_RUNNING"
  4800. // "NOT_CRITICAL_ERROR"
  4801. // "NO_RESULTS_ON_PAGE"
  4802. // "REQUIRED_TOS_AGREEMENT"
  4803. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4804. // "RESOURCE_NOT_DELETED"
  4805. // "SCHEMA_VALIDATION_IGNORED"
  4806. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4807. // "UNDECLARED_PROPERTIES"
  4808. // "UNREACHABLE"
  4809. Code string `json:"code,omitempty"`
  4810. // Data: [Output Only] Metadata about this warning in key: value format.
  4811. // For example:
  4812. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4813. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  4814. // Message: [Output Only] A human-readable description of the warning
  4815. // code.
  4816. Message string `json:"message,omitempty"`
  4817. // ForceSendFields is a list of field names (e.g. "Code") to
  4818. // unconditionally include in API requests. By default, fields with
  4819. // empty values are omitted from API requests. However, any non-pointer,
  4820. // non-interface field appearing in ForceSendFields will be sent to the
  4821. // server regardless of whether the field is empty or not. This may be
  4822. // used to include empty fields in Patch requests.
  4823. ForceSendFields []string `json:"-"`
  4824. // NullFields is a list of field names (e.g. "Code") to include in API
  4825. // requests with the JSON null value. By default, fields with empty
  4826. // values are omitted from API requests. However, any field with an
  4827. // empty value appearing in NullFields will be sent to the server as
  4828. // null. It is an error if a field in this list has a non-empty value.
  4829. // This may be used to include null fields in Patch requests.
  4830. NullFields []string `json:"-"`
  4831. }
  4832. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4833. type NoMethod DiskAggregatedListWarning
  4834. raw := NoMethod(*s)
  4835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4836. }
  4837. type DiskAggregatedListWarningData struct {
  4838. // Key: [Output Only] A key that provides more detail on the warning
  4839. // being returned. For example, for warnings where there are no results
  4840. // in a list request for a particular zone, this key might be scope and
  4841. // the key value might be the zone name. Other examples might be a key
  4842. // indicating a deprecated resource and a suggested replacement, or a
  4843. // warning about invalid network settings (for example, if an instance
  4844. // attempts to perform IP forwarding but is not enabled for IP
  4845. // forwarding).
  4846. Key string `json:"key,omitempty"`
  4847. // Value: [Output Only] A warning data value corresponding to the key.
  4848. Value string `json:"value,omitempty"`
  4849. // ForceSendFields is a list of field names (e.g. "Key") to
  4850. // unconditionally include in API requests. By default, fields with
  4851. // empty values are omitted from API requests. However, any non-pointer,
  4852. // non-interface field appearing in ForceSendFields will be sent to the
  4853. // server regardless of whether the field is empty or not. This may be
  4854. // used to include empty fields in Patch requests.
  4855. ForceSendFields []string `json:"-"`
  4856. // NullFields is a list of field names (e.g. "Key") to include in API
  4857. // requests with the JSON null value. By default, fields with empty
  4858. // values are omitted from API requests. However, any field with an
  4859. // empty value appearing in NullFields will be sent to the server as
  4860. // null. It is an error if a field in this list has a non-empty value.
  4861. // This may be used to include null fields in Patch requests.
  4862. NullFields []string `json:"-"`
  4863. }
  4864. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4865. type NoMethod DiskAggregatedListWarningData
  4866. raw := NoMethod(*s)
  4867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4868. }
  4869. // DiskInstantiationConfig: A specification of the desired way to
  4870. // instantiate a disk in the instance template when its created from a
  4871. // source instance.
  4872. type DiskInstantiationConfig struct {
  4873. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  4874. // instance is deleted (but not when the disk is detached from the
  4875. // instance).
  4876. AutoDelete bool `json:"autoDelete,omitempty"`
  4877. // CustomImage: The custom source image to be used to restore this disk
  4878. // when instantiating this instance template.
  4879. CustomImage string `json:"customImage,omitempty"`
  4880. // DeviceName: Specifies the device name of the disk to which the
  4881. // configurations apply to.
  4882. DeviceName string `json:"deviceName,omitempty"`
  4883. // InstantiateFrom: Specifies whether to include the disk and what image
  4884. // to use. Possible values are:
  4885. // - source-image: to use the same image that was used to create the
  4886. // source instance's corresponding disk. Applicable to the boot disk and
  4887. // additional read-write disks.
  4888. // - source-image-family: to use the same image family that was used to
  4889. // create the source instance's corresponding disk. Applicable to the
  4890. // boot disk and additional read-write disks.
  4891. // - custom-image: to use a user-provided image url for disk creation.
  4892. // Applicable to the boot disk and additional read-write disks.
  4893. // - attach-read-only: to attach a read-only disk. Applicable to
  4894. // read-only disks.
  4895. // - do-not-include: to exclude a disk from the template. Applicable to
  4896. // additional read-write disks, local SSDs, and read-only disks.
  4897. //
  4898. // Possible values:
  4899. // "ATTACH_READ_ONLY"
  4900. // "BLANK"
  4901. // "CUSTOM_IMAGE"
  4902. // "DEFAULT"
  4903. // "DO_NOT_INCLUDE"
  4904. // "SOURCE_IMAGE"
  4905. // "SOURCE_IMAGE_FAMILY"
  4906. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  4907. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  4908. // unconditionally include in API requests. By default, fields with
  4909. // empty values are omitted from API requests. However, any non-pointer,
  4910. // non-interface field appearing in ForceSendFields will be sent to the
  4911. // server regardless of whether the field is empty or not. This may be
  4912. // used to include empty fields in Patch requests.
  4913. ForceSendFields []string `json:"-"`
  4914. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  4915. // API requests with the JSON null value. By default, fields with empty
  4916. // values are omitted from API requests. However, any field with an
  4917. // empty value appearing in NullFields will be sent to the server as
  4918. // null. It is an error if a field in this list has a non-empty value.
  4919. // This may be used to include null fields in Patch requests.
  4920. NullFields []string `json:"-"`
  4921. }
  4922. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  4923. type NoMethod DiskInstantiationConfig
  4924. raw := NoMethod(*s)
  4925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4926. }
  4927. // DiskList: A list of Disk resources.
  4928. type DiskList struct {
  4929. // Id: [Output Only] Unique identifier for the resource; defined by the
  4930. // server.
  4931. Id string `json:"id,omitempty"`
  4932. // Items: A list of Disk resources.
  4933. Items []*Disk `json:"items,omitempty"`
  4934. // Kind: [Output Only] Type of resource. Always compute#diskList for
  4935. // lists of disks.
  4936. Kind string `json:"kind,omitempty"`
  4937. // NextPageToken: [Output Only] This token allows you to get the next
  4938. // page of results for list requests. If the number of results is larger
  4939. // than maxResults, use the nextPageToken as a value for the query
  4940. // parameter pageToken in the next list request. Subsequent list
  4941. // requests will have their own nextPageToken to continue paging through
  4942. // the results.
  4943. NextPageToken string `json:"nextPageToken,omitempty"`
  4944. // SelfLink: [Output Only] Server-defined URL for this resource.
  4945. SelfLink string `json:"selfLink,omitempty"`
  4946. // Warning: [Output Only] Informational warning message.
  4947. Warning *DiskListWarning `json:"warning,omitempty"`
  4948. // ServerResponse contains the HTTP response code and headers from the
  4949. // server.
  4950. googleapi.ServerResponse `json:"-"`
  4951. // ForceSendFields is a list of field names (e.g. "Id") to
  4952. // unconditionally include in API requests. By default, fields with
  4953. // empty values are omitted from API requests. However, any non-pointer,
  4954. // non-interface field appearing in ForceSendFields will be sent to the
  4955. // server regardless of whether the field is empty or not. This may be
  4956. // used to include empty fields in Patch requests.
  4957. ForceSendFields []string `json:"-"`
  4958. // NullFields is a list of field names (e.g. "Id") to include in API
  4959. // requests with the JSON null value. By default, fields with empty
  4960. // values are omitted from API requests. However, any field with an
  4961. // empty value appearing in NullFields will be sent to the server as
  4962. // null. It is an error if a field in this list has a non-empty value.
  4963. // This may be used to include null fields in Patch requests.
  4964. NullFields []string `json:"-"`
  4965. }
  4966. func (s *DiskList) MarshalJSON() ([]byte, error) {
  4967. type NoMethod DiskList
  4968. raw := NoMethod(*s)
  4969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4970. }
  4971. // DiskListWarning: [Output Only] Informational warning message.
  4972. type DiskListWarning struct {
  4973. // Code: [Output Only] A warning code, if applicable. For example,
  4974. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4975. // the response.
  4976. //
  4977. // Possible values:
  4978. // "CLEANUP_FAILED"
  4979. // "DEPRECATED_RESOURCE_USED"
  4980. // "DEPRECATED_TYPE_USED"
  4981. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4982. // "EXPERIMENTAL_TYPE_USED"
  4983. // "EXTERNAL_API_WARNING"
  4984. // "FIELD_VALUE_OVERRIDEN"
  4985. // "INJECTED_KERNELS_DEPRECATED"
  4986. // "MISSING_TYPE_DEPENDENCY"
  4987. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4988. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4989. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4990. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4991. // "NEXT_HOP_NOT_RUNNING"
  4992. // "NOT_CRITICAL_ERROR"
  4993. // "NO_RESULTS_ON_PAGE"
  4994. // "REQUIRED_TOS_AGREEMENT"
  4995. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4996. // "RESOURCE_NOT_DELETED"
  4997. // "SCHEMA_VALIDATION_IGNORED"
  4998. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4999. // "UNDECLARED_PROPERTIES"
  5000. // "UNREACHABLE"
  5001. Code string `json:"code,omitempty"`
  5002. // Data: [Output Only] Metadata about this warning in key: value format.
  5003. // For example:
  5004. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5005. Data []*DiskListWarningData `json:"data,omitempty"`
  5006. // Message: [Output Only] A human-readable description of the warning
  5007. // code.
  5008. Message string `json:"message,omitempty"`
  5009. // ForceSendFields is a list of field names (e.g. "Code") to
  5010. // unconditionally include in API requests. By default, fields with
  5011. // empty values are omitted from API requests. However, any non-pointer,
  5012. // non-interface field appearing in ForceSendFields will be sent to the
  5013. // server regardless of whether the field is empty or not. This may be
  5014. // used to include empty fields in Patch requests.
  5015. ForceSendFields []string `json:"-"`
  5016. // NullFields is a list of field names (e.g. "Code") to include in API
  5017. // requests with the JSON null value. By default, fields with empty
  5018. // values are omitted from API requests. However, any field with an
  5019. // empty value appearing in NullFields will be sent to the server as
  5020. // null. It is an error if a field in this list has a non-empty value.
  5021. // This may be used to include null fields in Patch requests.
  5022. NullFields []string `json:"-"`
  5023. }
  5024. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5025. type NoMethod DiskListWarning
  5026. raw := NoMethod(*s)
  5027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5028. }
  5029. type DiskListWarningData struct {
  5030. // Key: [Output Only] A key that provides more detail on the warning
  5031. // being returned. For example, for warnings where there are no results
  5032. // in a list request for a particular zone, this key might be scope and
  5033. // the key value might be the zone name. Other examples might be a key
  5034. // indicating a deprecated resource and a suggested replacement, or a
  5035. // warning about invalid network settings (for example, if an instance
  5036. // attempts to perform IP forwarding but is not enabled for IP
  5037. // forwarding).
  5038. Key string `json:"key,omitempty"`
  5039. // Value: [Output Only] A warning data value corresponding to the key.
  5040. Value string `json:"value,omitempty"`
  5041. // ForceSendFields is a list of field names (e.g. "Key") to
  5042. // unconditionally include in API requests. By default, fields with
  5043. // empty values are omitted from API requests. However, any non-pointer,
  5044. // non-interface field appearing in ForceSendFields will be sent to the
  5045. // server regardless of whether the field is empty or not. This may be
  5046. // used to include empty fields in Patch requests.
  5047. ForceSendFields []string `json:"-"`
  5048. // NullFields is a list of field names (e.g. "Key") to include in API
  5049. // requests with the JSON null value. By default, fields with empty
  5050. // values are omitted from API requests. However, any field with an
  5051. // empty value appearing in NullFields will be sent to the server as
  5052. // null. It is an error if a field in this list has a non-empty value.
  5053. // This may be used to include null fields in Patch requests.
  5054. NullFields []string `json:"-"`
  5055. }
  5056. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5057. type NoMethod DiskListWarningData
  5058. raw := NoMethod(*s)
  5059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5060. }
  5061. type DiskMoveRequest struct {
  5062. // DestinationZone: The URL of the destination zone to move the disk.
  5063. // This can be a full or partial URL. For example, the following are all
  5064. // valid URLs to a zone:
  5065. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5066. //
  5067. // - projects/project/zones/zone
  5068. // - zones/zone
  5069. DestinationZone string `json:"destinationZone,omitempty"`
  5070. // TargetDisk: The URL of the target disk to move. This can be a full or
  5071. // partial URL. For example, the following are all valid URLs to a disk:
  5072. //
  5073. // -
  5074. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5075. // - projects/project/zones/zone/disks/disk
  5076. // - zones/zone/disks/disk
  5077. TargetDisk string `json:"targetDisk,omitempty"`
  5078. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5079. // unconditionally include in API requests. By default, fields with
  5080. // empty values are omitted from API requests. However, any non-pointer,
  5081. // non-interface field appearing in ForceSendFields will be sent to the
  5082. // server regardless of whether the field is empty or not. This may be
  5083. // used to include empty fields in Patch requests.
  5084. ForceSendFields []string `json:"-"`
  5085. // NullFields is a list of field names (e.g. "DestinationZone") to
  5086. // include in API requests with the JSON null value. By default, fields
  5087. // with empty values are omitted from API requests. However, any field
  5088. // with an empty value appearing in NullFields will be sent to the
  5089. // server as null. It is an error if a field in this list has a
  5090. // non-empty value. This may be used to include null fields in Patch
  5091. // requests.
  5092. NullFields []string `json:"-"`
  5093. }
  5094. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5095. type NoMethod DiskMoveRequest
  5096. raw := NoMethod(*s)
  5097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5098. }
  5099. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  5100. // (== resource_for v1.diskTypes ==)
  5101. type DiskType struct {
  5102. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5103. // format.
  5104. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5105. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  5106. // GB.
  5107. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  5108. // Deprecated: [Output Only] The deprecation status associated with this
  5109. // disk type.
  5110. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5111. // Description: [Output Only] An optional description of this resource.
  5112. Description string `json:"description,omitempty"`
  5113. // Id: [Output Only] The unique identifier for the resource. This
  5114. // identifier is defined by the server.
  5115. Id uint64 `json:"id,omitempty,string"`
  5116. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  5117. // disk types.
  5118. Kind string `json:"kind,omitempty"`
  5119. // Name: [Output Only] Name of the resource.
  5120. Name string `json:"name,omitempty"`
  5121. // Region: [Output Only] URL of the region where the disk type resides.
  5122. // Only applicable for regional resources. You must specify this field
  5123. // as part of the HTTP request URL. It is not settable as a field in the
  5124. // request body.
  5125. Region string `json:"region,omitempty"`
  5126. // SelfLink: [Output Only] Server-defined URL for the resource.
  5127. SelfLink string `json:"selfLink,omitempty"`
  5128. // ValidDiskSize: [Output Only] An optional textual description of the
  5129. // valid disk size, such as "10GB-10TB".
  5130. ValidDiskSize string `json:"validDiskSize,omitempty"`
  5131. // Zone: [Output Only] URL of the zone where the disk type resides. You
  5132. // must specify this field as part of the HTTP request URL. It is not
  5133. // settable as a field in the request body.
  5134. Zone string `json:"zone,omitempty"`
  5135. // ServerResponse contains the HTTP response code and headers from the
  5136. // server.
  5137. googleapi.ServerResponse `json:"-"`
  5138. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5139. // to unconditionally include in API requests. By default, fields with
  5140. // empty values are omitted from API requests. However, any non-pointer,
  5141. // non-interface field appearing in ForceSendFields will be sent to the
  5142. // server regardless of whether the field is empty or not. This may be
  5143. // used to include empty fields in Patch requests.
  5144. ForceSendFields []string `json:"-"`
  5145. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5146. // include in API requests with the JSON null value. By default, fields
  5147. // with empty values are omitted from API requests. However, any field
  5148. // with an empty value appearing in NullFields will be sent to the
  5149. // server as null. It is an error if a field in this list has a
  5150. // non-empty value. This may be used to include null fields in Patch
  5151. // requests.
  5152. NullFields []string `json:"-"`
  5153. }
  5154. func (s *DiskType) MarshalJSON() ([]byte, error) {
  5155. type NoMethod DiskType
  5156. raw := NoMethod(*s)
  5157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5158. }
  5159. type DiskTypeAggregatedList struct {
  5160. // Id: [Output Only] Unique identifier for the resource; defined by the
  5161. // server.
  5162. Id string `json:"id,omitempty"`
  5163. // Items: A list of DiskTypesScopedList resources.
  5164. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  5165. // Kind: [Output Only] Type of resource. Always
  5166. // compute#diskTypeAggregatedList.
  5167. Kind string `json:"kind,omitempty"`
  5168. // NextPageToken: [Output Only] This token allows you to get the next
  5169. // page of results for list requests. If the number of results is larger
  5170. // than maxResults, use the nextPageToken as a value for the query
  5171. // parameter pageToken in the next list request. Subsequent list
  5172. // requests will have their own nextPageToken to continue paging through
  5173. // the results.
  5174. NextPageToken string `json:"nextPageToken,omitempty"`
  5175. // SelfLink: [Output Only] Server-defined URL for this resource.
  5176. SelfLink string `json:"selfLink,omitempty"`
  5177. // Warning: [Output Only] Informational warning message.
  5178. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  5179. // ServerResponse contains the HTTP response code and headers from the
  5180. // server.
  5181. googleapi.ServerResponse `json:"-"`
  5182. // ForceSendFields is a list of field names (e.g. "Id") to
  5183. // unconditionally include in API requests. By default, fields with
  5184. // empty values are omitted from API requests. However, any non-pointer,
  5185. // non-interface field appearing in ForceSendFields will be sent to the
  5186. // server regardless of whether the field is empty or not. This may be
  5187. // used to include empty fields in Patch requests.
  5188. ForceSendFields []string `json:"-"`
  5189. // NullFields is a list of field names (e.g. "Id") to include in API
  5190. // requests with the JSON null value. By default, fields with empty
  5191. // values are omitted from API requests. However, any field with an
  5192. // empty value appearing in NullFields will be sent to the server as
  5193. // null. It is an error if a field in this list has a non-empty value.
  5194. // This may be used to include null fields in Patch requests.
  5195. NullFields []string `json:"-"`
  5196. }
  5197. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  5198. type NoMethod DiskTypeAggregatedList
  5199. raw := NoMethod(*s)
  5200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5201. }
  5202. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  5203. // message.
  5204. type DiskTypeAggregatedListWarning struct {
  5205. // Code: [Output Only] A warning code, if applicable. For example,
  5206. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5207. // the response.
  5208. //
  5209. // Possible values:
  5210. // "CLEANUP_FAILED"
  5211. // "DEPRECATED_RESOURCE_USED"
  5212. // "DEPRECATED_TYPE_USED"
  5213. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5214. // "EXPERIMENTAL_TYPE_USED"
  5215. // "EXTERNAL_API_WARNING"
  5216. // "FIELD_VALUE_OVERRIDEN"
  5217. // "INJECTED_KERNELS_DEPRECATED"
  5218. // "MISSING_TYPE_DEPENDENCY"
  5219. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5220. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5221. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5222. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5223. // "NEXT_HOP_NOT_RUNNING"
  5224. // "NOT_CRITICAL_ERROR"
  5225. // "NO_RESULTS_ON_PAGE"
  5226. // "REQUIRED_TOS_AGREEMENT"
  5227. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5228. // "RESOURCE_NOT_DELETED"
  5229. // "SCHEMA_VALIDATION_IGNORED"
  5230. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5231. // "UNDECLARED_PROPERTIES"
  5232. // "UNREACHABLE"
  5233. Code string `json:"code,omitempty"`
  5234. // Data: [Output Only] Metadata about this warning in key: value format.
  5235. // For example:
  5236. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5237. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  5238. // Message: [Output Only] A human-readable description of the warning
  5239. // code.
  5240. Message string `json:"message,omitempty"`
  5241. // ForceSendFields is a list of field names (e.g. "Code") to
  5242. // unconditionally include in API requests. By default, fields with
  5243. // empty values are omitted from API requests. However, any non-pointer,
  5244. // non-interface field appearing in ForceSendFields will be sent to the
  5245. // server regardless of whether the field is empty or not. This may be
  5246. // used to include empty fields in Patch requests.
  5247. ForceSendFields []string `json:"-"`
  5248. // NullFields is a list of field names (e.g. "Code") to include in API
  5249. // requests with the JSON null value. By default, fields with empty
  5250. // values are omitted from API requests. However, any field with an
  5251. // empty value appearing in NullFields will be sent to the server as
  5252. // null. It is an error if a field in this list has a non-empty value.
  5253. // This may be used to include null fields in Patch requests.
  5254. NullFields []string `json:"-"`
  5255. }
  5256. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5257. type NoMethod DiskTypeAggregatedListWarning
  5258. raw := NoMethod(*s)
  5259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5260. }
  5261. type DiskTypeAggregatedListWarningData struct {
  5262. // Key: [Output Only] A key that provides more detail on the warning
  5263. // being returned. For example, for warnings where there are no results
  5264. // in a list request for a particular zone, this key might be scope and
  5265. // the key value might be the zone name. Other examples might be a key
  5266. // indicating a deprecated resource and a suggested replacement, or a
  5267. // warning about invalid network settings (for example, if an instance
  5268. // attempts to perform IP forwarding but is not enabled for IP
  5269. // forwarding).
  5270. Key string `json:"key,omitempty"`
  5271. // Value: [Output Only] A warning data value corresponding to the key.
  5272. Value string `json:"value,omitempty"`
  5273. // ForceSendFields is a list of field names (e.g. "Key") to
  5274. // unconditionally include in API requests. By default, fields with
  5275. // empty values are omitted from API requests. However, any non-pointer,
  5276. // non-interface field appearing in ForceSendFields will be sent to the
  5277. // server regardless of whether the field is empty or not. This may be
  5278. // used to include empty fields in Patch requests.
  5279. ForceSendFields []string `json:"-"`
  5280. // NullFields is a list of field names (e.g. "Key") to include in API
  5281. // requests with the JSON null value. By default, fields with empty
  5282. // values are omitted from API requests. However, any field with an
  5283. // empty value appearing in NullFields will be sent to the server as
  5284. // null. It is an error if a field in this list has a non-empty value.
  5285. // This may be used to include null fields in Patch requests.
  5286. NullFields []string `json:"-"`
  5287. }
  5288. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5289. type NoMethod DiskTypeAggregatedListWarningData
  5290. raw := NoMethod(*s)
  5291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5292. }
  5293. // DiskTypeList: Contains a list of disk types.
  5294. type DiskTypeList struct {
  5295. // Id: [Output Only] Unique identifier for the resource; defined by the
  5296. // server.
  5297. Id string `json:"id,omitempty"`
  5298. // Items: A list of DiskType resources.
  5299. Items []*DiskType `json:"items,omitempty"`
  5300. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  5301. // disk types.
  5302. Kind string `json:"kind,omitempty"`
  5303. // NextPageToken: [Output Only] This token allows you to get the next
  5304. // page of results for list requests. If the number of results is larger
  5305. // than maxResults, use the nextPageToken as a value for the query
  5306. // parameter pageToken in the next list request. Subsequent list
  5307. // requests will have their own nextPageToken to continue paging through
  5308. // the results.
  5309. NextPageToken string `json:"nextPageToken,omitempty"`
  5310. // SelfLink: [Output Only] Server-defined URL for this resource.
  5311. SelfLink string `json:"selfLink,omitempty"`
  5312. // Warning: [Output Only] Informational warning message.
  5313. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  5314. // ServerResponse contains the HTTP response code and headers from the
  5315. // server.
  5316. googleapi.ServerResponse `json:"-"`
  5317. // ForceSendFields is a list of field names (e.g. "Id") to
  5318. // unconditionally include in API requests. By default, fields with
  5319. // empty values are omitted from API requests. However, any non-pointer,
  5320. // non-interface field appearing in ForceSendFields will be sent to the
  5321. // server regardless of whether the field is empty or not. This may be
  5322. // used to include empty fields in Patch requests.
  5323. ForceSendFields []string `json:"-"`
  5324. // NullFields is a list of field names (e.g. "Id") to include in API
  5325. // requests with the JSON null value. By default, fields with empty
  5326. // values are omitted from API requests. However, any field with an
  5327. // empty value appearing in NullFields will be sent to the server as
  5328. // null. It is an error if a field in this list has a non-empty value.
  5329. // This may be used to include null fields in Patch requests.
  5330. NullFields []string `json:"-"`
  5331. }
  5332. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  5333. type NoMethod DiskTypeList
  5334. raw := NoMethod(*s)
  5335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5336. }
  5337. // DiskTypeListWarning: [Output Only] Informational warning message.
  5338. type DiskTypeListWarning struct {
  5339. // Code: [Output Only] A warning code, if applicable. For example,
  5340. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5341. // the response.
  5342. //
  5343. // Possible values:
  5344. // "CLEANUP_FAILED"
  5345. // "DEPRECATED_RESOURCE_USED"
  5346. // "DEPRECATED_TYPE_USED"
  5347. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5348. // "EXPERIMENTAL_TYPE_USED"
  5349. // "EXTERNAL_API_WARNING"
  5350. // "FIELD_VALUE_OVERRIDEN"
  5351. // "INJECTED_KERNELS_DEPRECATED"
  5352. // "MISSING_TYPE_DEPENDENCY"
  5353. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5354. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5355. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5356. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5357. // "NEXT_HOP_NOT_RUNNING"
  5358. // "NOT_CRITICAL_ERROR"
  5359. // "NO_RESULTS_ON_PAGE"
  5360. // "REQUIRED_TOS_AGREEMENT"
  5361. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5362. // "RESOURCE_NOT_DELETED"
  5363. // "SCHEMA_VALIDATION_IGNORED"
  5364. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5365. // "UNDECLARED_PROPERTIES"
  5366. // "UNREACHABLE"
  5367. Code string `json:"code,omitempty"`
  5368. // Data: [Output Only] Metadata about this warning in key: value format.
  5369. // For example:
  5370. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5371. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  5372. // Message: [Output Only] A human-readable description of the warning
  5373. // code.
  5374. Message string `json:"message,omitempty"`
  5375. // ForceSendFields is a list of field names (e.g. "Code") to
  5376. // unconditionally include in API requests. By default, fields with
  5377. // empty values are omitted from API requests. However, any non-pointer,
  5378. // non-interface field appearing in ForceSendFields will be sent to the
  5379. // server regardless of whether the field is empty or not. This may be
  5380. // used to include empty fields in Patch requests.
  5381. ForceSendFields []string `json:"-"`
  5382. // NullFields is a list of field names (e.g. "Code") to include in API
  5383. // requests with the JSON null value. By default, fields with empty
  5384. // values are omitted from API requests. However, any field with an
  5385. // empty value appearing in NullFields will be sent to the server as
  5386. // null. It is an error if a field in this list has a non-empty value.
  5387. // This may be used to include null fields in Patch requests.
  5388. NullFields []string `json:"-"`
  5389. }
  5390. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  5391. type NoMethod DiskTypeListWarning
  5392. raw := NoMethod(*s)
  5393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5394. }
  5395. type DiskTypeListWarningData struct {
  5396. // Key: [Output Only] A key that provides more detail on the warning
  5397. // being returned. For example, for warnings where there are no results
  5398. // in a list request for a particular zone, this key might be scope and
  5399. // the key value might be the zone name. Other examples might be a key
  5400. // indicating a deprecated resource and a suggested replacement, or a
  5401. // warning about invalid network settings (for example, if an instance
  5402. // attempts to perform IP forwarding but is not enabled for IP
  5403. // forwarding).
  5404. Key string `json:"key,omitempty"`
  5405. // Value: [Output Only] A warning data value corresponding to the key.
  5406. Value string `json:"value,omitempty"`
  5407. // ForceSendFields is a list of field names (e.g. "Key") to
  5408. // unconditionally include in API requests. By default, fields with
  5409. // empty values are omitted from API requests. However, any non-pointer,
  5410. // non-interface field appearing in ForceSendFields will be sent to the
  5411. // server regardless of whether the field is empty or not. This may be
  5412. // used to include empty fields in Patch requests.
  5413. ForceSendFields []string `json:"-"`
  5414. // NullFields is a list of field names (e.g. "Key") to include in API
  5415. // requests with the JSON null value. By default, fields with empty
  5416. // values are omitted from API requests. However, any field with an
  5417. // empty value appearing in NullFields will be sent to the server as
  5418. // null. It is an error if a field in this list has a non-empty value.
  5419. // This may be used to include null fields in Patch requests.
  5420. NullFields []string `json:"-"`
  5421. }
  5422. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  5423. type NoMethod DiskTypeListWarningData
  5424. raw := NoMethod(*s)
  5425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5426. }
  5427. type DiskTypesScopedList struct {
  5428. // DiskTypes: [Output Only] A list of disk types contained in this
  5429. // scope.
  5430. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  5431. // Warning: [Output Only] Informational warning which replaces the list
  5432. // of disk types when the list is empty.
  5433. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  5434. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  5435. // unconditionally include in API requests. By default, fields with
  5436. // empty values are omitted from API requests. However, any non-pointer,
  5437. // non-interface field appearing in ForceSendFields will be sent to the
  5438. // server regardless of whether the field is empty or not. This may be
  5439. // used to include empty fields in Patch requests.
  5440. ForceSendFields []string `json:"-"`
  5441. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  5442. // API requests with the JSON null value. By default, fields with empty
  5443. // values are omitted from API requests. However, any field with an
  5444. // empty value appearing in NullFields will be sent to the server as
  5445. // null. It is an error if a field in this list has a non-empty value.
  5446. // This may be used to include null fields in Patch requests.
  5447. NullFields []string `json:"-"`
  5448. }
  5449. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  5450. type NoMethod DiskTypesScopedList
  5451. raw := NoMethod(*s)
  5452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5453. }
  5454. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  5455. // replaces the list of disk types when the list is empty.
  5456. type DiskTypesScopedListWarning struct {
  5457. // Code: [Output Only] A warning code, if applicable. For example,
  5458. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5459. // the response.
  5460. //
  5461. // Possible values:
  5462. // "CLEANUP_FAILED"
  5463. // "DEPRECATED_RESOURCE_USED"
  5464. // "DEPRECATED_TYPE_USED"
  5465. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5466. // "EXPERIMENTAL_TYPE_USED"
  5467. // "EXTERNAL_API_WARNING"
  5468. // "FIELD_VALUE_OVERRIDEN"
  5469. // "INJECTED_KERNELS_DEPRECATED"
  5470. // "MISSING_TYPE_DEPENDENCY"
  5471. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5472. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5473. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5474. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5475. // "NEXT_HOP_NOT_RUNNING"
  5476. // "NOT_CRITICAL_ERROR"
  5477. // "NO_RESULTS_ON_PAGE"
  5478. // "REQUIRED_TOS_AGREEMENT"
  5479. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5480. // "RESOURCE_NOT_DELETED"
  5481. // "SCHEMA_VALIDATION_IGNORED"
  5482. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5483. // "UNDECLARED_PROPERTIES"
  5484. // "UNREACHABLE"
  5485. Code string `json:"code,omitempty"`
  5486. // Data: [Output Only] Metadata about this warning in key: value format.
  5487. // For example:
  5488. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5489. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  5490. // Message: [Output Only] A human-readable description of the warning
  5491. // code.
  5492. Message string `json:"message,omitempty"`
  5493. // ForceSendFields is a list of field names (e.g. "Code") to
  5494. // unconditionally include in API requests. By default, fields with
  5495. // empty values are omitted from API requests. However, any non-pointer,
  5496. // non-interface field appearing in ForceSendFields will be sent to the
  5497. // server regardless of whether the field is empty or not. This may be
  5498. // used to include empty fields in Patch requests.
  5499. ForceSendFields []string `json:"-"`
  5500. // NullFields is a list of field names (e.g. "Code") to include in API
  5501. // requests with the JSON null value. By default, fields with empty
  5502. // values are omitted from API requests. However, any field with an
  5503. // empty value appearing in NullFields will be sent to the server as
  5504. // null. It is an error if a field in this list has a non-empty value.
  5505. // This may be used to include null fields in Patch requests.
  5506. NullFields []string `json:"-"`
  5507. }
  5508. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  5509. type NoMethod DiskTypesScopedListWarning
  5510. raw := NoMethod(*s)
  5511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5512. }
  5513. type DiskTypesScopedListWarningData struct {
  5514. // Key: [Output Only] A key that provides more detail on the warning
  5515. // being returned. For example, for warnings where there are no results
  5516. // in a list request for a particular zone, this key might be scope and
  5517. // the key value might be the zone name. Other examples might be a key
  5518. // indicating a deprecated resource and a suggested replacement, or a
  5519. // warning about invalid network settings (for example, if an instance
  5520. // attempts to perform IP forwarding but is not enabled for IP
  5521. // forwarding).
  5522. Key string `json:"key,omitempty"`
  5523. // Value: [Output Only] A warning data value corresponding to the key.
  5524. Value string `json:"value,omitempty"`
  5525. // ForceSendFields is a list of field names (e.g. "Key") to
  5526. // unconditionally include in API requests. By default, fields with
  5527. // empty values are omitted from API requests. However, any non-pointer,
  5528. // non-interface field appearing in ForceSendFields will be sent to the
  5529. // server regardless of whether the field is empty or not. This may be
  5530. // used to include empty fields in Patch requests.
  5531. ForceSendFields []string `json:"-"`
  5532. // NullFields is a list of field names (e.g. "Key") to include in API
  5533. // requests with the JSON null value. By default, fields with empty
  5534. // values are omitted from API requests. However, any field with an
  5535. // empty value appearing in NullFields will be sent to the server as
  5536. // null. It is an error if a field in this list has a non-empty value.
  5537. // This may be used to include null fields in Patch requests.
  5538. NullFields []string `json:"-"`
  5539. }
  5540. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5541. type NoMethod DiskTypesScopedListWarningData
  5542. raw := NoMethod(*s)
  5543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5544. }
  5545. type DisksResizeRequest struct {
  5546. // SizeGb: The new size of the persistent disk, which is specified in
  5547. // GB.
  5548. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5549. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  5550. // unconditionally include in API requests. By default, fields with
  5551. // empty values are omitted from API requests. However, any non-pointer,
  5552. // non-interface field appearing in ForceSendFields will be sent to the
  5553. // server regardless of whether the field is empty or not. This may be
  5554. // used to include empty fields in Patch requests.
  5555. ForceSendFields []string `json:"-"`
  5556. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  5557. // requests with the JSON null value. By default, fields with empty
  5558. // values are omitted from API requests. However, any field with an
  5559. // empty value appearing in NullFields will be sent to the server as
  5560. // null. It is an error if a field in this list has a non-empty value.
  5561. // This may be used to include null fields in Patch requests.
  5562. NullFields []string `json:"-"`
  5563. }
  5564. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  5565. type NoMethod DisksResizeRequest
  5566. raw := NoMethod(*s)
  5567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5568. }
  5569. type DisksScopedList struct {
  5570. // Disks: [Output Only] A list of disks contained in this scope.
  5571. Disks []*Disk `json:"disks,omitempty"`
  5572. // Warning: [Output Only] Informational warning which replaces the list
  5573. // of disks when the list is empty.
  5574. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  5575. // ForceSendFields is a list of field names (e.g. "Disks") to
  5576. // unconditionally include in API requests. By default, fields with
  5577. // empty values are omitted from API requests. However, any non-pointer,
  5578. // non-interface field appearing in ForceSendFields will be sent to the
  5579. // server regardless of whether the field is empty or not. This may be
  5580. // used to include empty fields in Patch requests.
  5581. ForceSendFields []string `json:"-"`
  5582. // NullFields is a list of field names (e.g. "Disks") to include in API
  5583. // requests with the JSON null value. By default, fields with empty
  5584. // values are omitted from API requests. However, any field with an
  5585. // empty value appearing in NullFields will be sent to the server as
  5586. // null. It is an error if a field in this list has a non-empty value.
  5587. // This may be used to include null fields in Patch requests.
  5588. NullFields []string `json:"-"`
  5589. }
  5590. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  5591. type NoMethod DisksScopedList
  5592. raw := NoMethod(*s)
  5593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5594. }
  5595. // DisksScopedListWarning: [Output Only] Informational warning which
  5596. // replaces the list of disks when the list is empty.
  5597. type DisksScopedListWarning struct {
  5598. // Code: [Output Only] A warning code, if applicable. For example,
  5599. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5600. // the response.
  5601. //
  5602. // Possible values:
  5603. // "CLEANUP_FAILED"
  5604. // "DEPRECATED_RESOURCE_USED"
  5605. // "DEPRECATED_TYPE_USED"
  5606. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5607. // "EXPERIMENTAL_TYPE_USED"
  5608. // "EXTERNAL_API_WARNING"
  5609. // "FIELD_VALUE_OVERRIDEN"
  5610. // "INJECTED_KERNELS_DEPRECATED"
  5611. // "MISSING_TYPE_DEPENDENCY"
  5612. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5613. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5614. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5615. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5616. // "NEXT_HOP_NOT_RUNNING"
  5617. // "NOT_CRITICAL_ERROR"
  5618. // "NO_RESULTS_ON_PAGE"
  5619. // "REQUIRED_TOS_AGREEMENT"
  5620. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5621. // "RESOURCE_NOT_DELETED"
  5622. // "SCHEMA_VALIDATION_IGNORED"
  5623. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5624. // "UNDECLARED_PROPERTIES"
  5625. // "UNREACHABLE"
  5626. Code string `json:"code,omitempty"`
  5627. // Data: [Output Only] Metadata about this warning in key: value format.
  5628. // For example:
  5629. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5630. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  5631. // Message: [Output Only] A human-readable description of the warning
  5632. // code.
  5633. Message string `json:"message,omitempty"`
  5634. // ForceSendFields is a list of field names (e.g. "Code") to
  5635. // unconditionally include in API requests. By default, fields with
  5636. // empty values are omitted from API requests. However, any non-pointer,
  5637. // non-interface field appearing in ForceSendFields will be sent to the
  5638. // server regardless of whether the field is empty or not. This may be
  5639. // used to include empty fields in Patch requests.
  5640. ForceSendFields []string `json:"-"`
  5641. // NullFields is a list of field names (e.g. "Code") to include in API
  5642. // requests with the JSON null value. By default, fields with empty
  5643. // values are omitted from API requests. However, any field with an
  5644. // empty value appearing in NullFields will be sent to the server as
  5645. // null. It is an error if a field in this list has a non-empty value.
  5646. // This may be used to include null fields in Patch requests.
  5647. NullFields []string `json:"-"`
  5648. }
  5649. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  5650. type NoMethod DisksScopedListWarning
  5651. raw := NoMethod(*s)
  5652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5653. }
  5654. type DisksScopedListWarningData struct {
  5655. // Key: [Output Only] A key that provides more detail on the warning
  5656. // being returned. For example, for warnings where there are no results
  5657. // in a list request for a particular zone, this key might be scope and
  5658. // the key value might be the zone name. Other examples might be a key
  5659. // indicating a deprecated resource and a suggested replacement, or a
  5660. // warning about invalid network settings (for example, if an instance
  5661. // attempts to perform IP forwarding but is not enabled for IP
  5662. // forwarding).
  5663. Key string `json:"key,omitempty"`
  5664. // Value: [Output Only] A warning data value corresponding to the key.
  5665. Value string `json:"value,omitempty"`
  5666. // ForceSendFields is a list of field names (e.g. "Key") to
  5667. // unconditionally include in API requests. By default, fields with
  5668. // empty values are omitted from API requests. However, any non-pointer,
  5669. // non-interface field appearing in ForceSendFields will be sent to the
  5670. // server regardless of whether the field is empty or not. This may be
  5671. // used to include empty fields in Patch requests.
  5672. ForceSendFields []string `json:"-"`
  5673. // NullFields is a list of field names (e.g. "Key") to include in API
  5674. // requests with the JSON null value. By default, fields with empty
  5675. // values are omitted from API requests. However, any field with an
  5676. // empty value appearing in NullFields will be sent to the server as
  5677. // null. It is an error if a field in this list has a non-empty value.
  5678. // This may be used to include null fields in Patch requests.
  5679. NullFields []string `json:"-"`
  5680. }
  5681. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5682. type NoMethod DisksScopedListWarningData
  5683. raw := NoMethod(*s)
  5684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5685. }
  5686. type DistributionPolicy struct {
  5687. // Zones: Zones where the regional managed instance group will create
  5688. // and manage instances.
  5689. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  5690. // ForceSendFields is a list of field names (e.g. "Zones") to
  5691. // unconditionally include in API requests. By default, fields with
  5692. // empty values are omitted from API requests. However, any non-pointer,
  5693. // non-interface field appearing in ForceSendFields will be sent to the
  5694. // server regardless of whether the field is empty or not. This may be
  5695. // used to include empty fields in Patch requests.
  5696. ForceSendFields []string `json:"-"`
  5697. // NullFields is a list of field names (e.g. "Zones") to include in API
  5698. // requests with the JSON null value. By default, fields with empty
  5699. // values are omitted from API requests. However, any field with an
  5700. // empty value appearing in NullFields will be sent to the server as
  5701. // null. It is an error if a field in this list has a non-empty value.
  5702. // This may be used to include null fields in Patch requests.
  5703. NullFields []string `json:"-"`
  5704. }
  5705. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  5706. type NoMethod DistributionPolicy
  5707. raw := NoMethod(*s)
  5708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5709. }
  5710. type DistributionPolicyZoneConfiguration struct {
  5711. // Zone: The URL of the zone. The zone must exist in the region where
  5712. // the managed instance group is located.
  5713. Zone string `json:"zone,omitempty"`
  5714. // ForceSendFields is a list of field names (e.g. "Zone") to
  5715. // unconditionally include in API requests. By default, fields with
  5716. // empty values are omitted from API requests. However, any non-pointer,
  5717. // non-interface field appearing in ForceSendFields will be sent to the
  5718. // server regardless of whether the field is empty or not. This may be
  5719. // used to include empty fields in Patch requests.
  5720. ForceSendFields []string `json:"-"`
  5721. // NullFields is a list of field names (e.g. "Zone") to include in API
  5722. // requests with the JSON null value. By default, fields with empty
  5723. // values are omitted from API requests. However, any field with an
  5724. // empty value appearing in NullFields will be sent to the server as
  5725. // null. It is an error if a field in this list has a non-empty value.
  5726. // This may be used to include null fields in Patch requests.
  5727. NullFields []string `json:"-"`
  5728. }
  5729. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  5730. type NoMethod DistributionPolicyZoneConfiguration
  5731. raw := NoMethod(*s)
  5732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5733. }
  5734. // Expr: Represents an expression text. Example:
  5735. //
  5736. // title: "User account presence" description: "Determines whether the
  5737. // request has a user account" expression: "size(request.user) > 0"
  5738. type Expr struct {
  5739. // Description: An optional description of the expression. This is a
  5740. // longer text which describes the expression, e.g. when hovered over it
  5741. // in a UI.
  5742. Description string `json:"description,omitempty"`
  5743. // Expression: Textual representation of an expression in Common
  5744. // Expression Language syntax.
  5745. //
  5746. // The application context of the containing message determines which
  5747. // well-known feature set of CEL is supported.
  5748. Expression string `json:"expression,omitempty"`
  5749. // Location: An optional string indicating the location of the
  5750. // expression for error reporting, e.g. a file name and a position in
  5751. // the file.
  5752. Location string `json:"location,omitempty"`
  5753. // Title: An optional title for the expression, i.e. a short string
  5754. // describing its purpose. This can be used e.g. in UIs which allow to
  5755. // enter the expression.
  5756. Title string `json:"title,omitempty"`
  5757. // ForceSendFields is a list of field names (e.g. "Description") to
  5758. // unconditionally include in API requests. By default, fields with
  5759. // empty values are omitted from API requests. However, any non-pointer,
  5760. // non-interface field appearing in ForceSendFields will be sent to the
  5761. // server regardless of whether the field is empty or not. This may be
  5762. // used to include empty fields in Patch requests.
  5763. ForceSendFields []string `json:"-"`
  5764. // NullFields is a list of field names (e.g. "Description") to include
  5765. // in API requests with the JSON null value. By default, fields with
  5766. // empty values are omitted from API requests. However, any field with
  5767. // an empty value appearing in NullFields will be sent to the server as
  5768. // null. It is an error if a field in this list has a non-empty value.
  5769. // This may be used to include null fields in Patch requests.
  5770. NullFields []string `json:"-"`
  5771. }
  5772. func (s *Expr) MarshalJSON() ([]byte, error) {
  5773. type NoMethod Expr
  5774. raw := NoMethod(*s)
  5775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5776. }
  5777. // Firewall: Represents a Firewall resource.
  5778. type Firewall struct {
  5779. // Allowed: The list of ALLOW rules specified by this firewall. Each
  5780. // rule specifies a protocol and port-range tuple that describes a
  5781. // permitted connection.
  5782. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  5783. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5784. // format.
  5785. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5786. // Denied: The list of DENY rules specified by this firewall. Each rule
  5787. // specifies a protocol and port-range tuple that describes a denied
  5788. // connection.
  5789. Denied []*FirewallDenied `json:"denied,omitempty"`
  5790. // Description: An optional description of this resource. Provide this
  5791. // property when you create the resource.
  5792. Description string `json:"description,omitempty"`
  5793. // DestinationRanges: If destination ranges are specified, the firewall
  5794. // will apply only to traffic that has destination IP address in these
  5795. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  5796. // supported.
  5797. DestinationRanges []string `json:"destinationRanges,omitempty"`
  5798. // Direction: Direction of traffic to which this firewall applies;
  5799. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  5800. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  5801. // specify sourceRanges OR sourceTags.
  5802. //
  5803. // Possible values:
  5804. // "EGRESS"
  5805. // "INGRESS"
  5806. Direction string `json:"direction,omitempty"`
  5807. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  5808. // applied to the network it is associated with. When set to true, the
  5809. // firewall rule is not enforced and the network behaves as if it did
  5810. // not exist. If this is unspecified, the firewall rule will be enabled.
  5811. Disabled bool `json:"disabled,omitempty"`
  5812. // Id: [Output Only] The unique identifier for the resource. This
  5813. // identifier is defined by the server.
  5814. Id uint64 `json:"id,omitempty,string"`
  5815. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  5816. // firewall rules.
  5817. Kind string `json:"kind,omitempty"`
  5818. // LogConfig: This field denotes the logging options for a particular
  5819. // firewall rule. If logging is enabled, logs will be exported to
  5820. // Stackdriver.
  5821. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  5822. // Name: Name of the resource; provided by the client when the resource
  5823. // is created. The name must be 1-63 characters long, and comply with
  5824. // RFC1035. Specifically, the name must be 1-63 characters long and
  5825. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5826. // the first character must be a lowercase letter, and all following
  5827. // characters must be a dash, lowercase letter, or digit, except the
  5828. // last character, which cannot be a dash.
  5829. Name string `json:"name,omitempty"`
  5830. // Network: URL of the network resource for this firewall rule. If not
  5831. // specified when creating a firewall rule, the default network is
  5832. // used:
  5833. // global/networks/default
  5834. // If you choose to specify this property, you can specify the network
  5835. // as a full or partial URL. For example, the following are all valid
  5836. // URLs:
  5837. // -
  5838. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  5839. // - projects/myproject/global/networks/my-network
  5840. // - global/networks/default
  5841. Network string `json:"network,omitempty"`
  5842. // Priority: Priority for this rule. This is an integer between 0 and
  5843. // 65535, both inclusive. When not specified, the value assumed is 1000.
  5844. // Relative priorities determine precedence of conflicting rules. Lower
  5845. // value of priority implies higher precedence (eg, a rule with priority
  5846. // 0 has higher precedence than a rule with priority 1). DENY rules take
  5847. // precedence over ALLOW rules having equal priority.
  5848. Priority int64 `json:"priority,omitempty"`
  5849. // SelfLink: [Output Only] Server-defined URL for the resource.
  5850. SelfLink string `json:"selfLink,omitempty"`
  5851. // SourceRanges: If source ranges are specified, the firewall will apply
  5852. // only to traffic that has source IP address in these ranges. These
  5853. // ranges must be expressed in CIDR format. One or both of sourceRanges
  5854. // and sourceTags may be set. If both properties are set, the firewall
  5855. // will apply to traffic that has source IP address within sourceRanges
  5856. // OR the source IP that belongs to a tag listed in the sourceTags
  5857. // property. The connection does not need to match both properties for
  5858. // the firewall to apply. Only IPv4 is supported.
  5859. SourceRanges []string `json:"sourceRanges,omitempty"`
  5860. // SourceServiceAccounts: If source service accounts are specified, the
  5861. // firewall will apply only to traffic originating from an instance with
  5862. // a service account in this list. Source service accounts cannot be
  5863. // used to control traffic to an instance's external IP address because
  5864. // service accounts are associated with an instance, not an IP address.
  5865. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  5866. // both are set, the firewall will apply to traffic that has source IP
  5867. // address within sourceRanges OR the source IP belongs to an instance
  5868. // with service account listed in sourceServiceAccount. The connection
  5869. // does not need to match both properties for the firewall to apply.
  5870. // sourceServiceAccounts cannot be used at the same time as sourceTags
  5871. // or targetTags.
  5872. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  5873. // SourceTags: If source tags are specified, the firewall rule applies
  5874. // only to traffic with source IPs that match the primary network
  5875. // interfaces of VM instances that have the tag and are in the same VPC
  5876. // network. Source tags cannot be used to control traffic to an
  5877. // instance's external IP address, it only applies to traffic between
  5878. // instances in the same virtual network. Because tags are associated
  5879. // with instances, not IP addresses. One or both of sourceRanges and
  5880. // sourceTags may be set. If both properties are set, the firewall will
  5881. // apply to traffic that has source IP address within sourceRanges OR
  5882. // the source IP that belongs to a tag listed in the sourceTags
  5883. // property. The connection does not need to match both properties for
  5884. // the firewall to apply.
  5885. SourceTags []string `json:"sourceTags,omitempty"`
  5886. // TargetServiceAccounts: A list of service accounts indicating sets of
  5887. // instances located in the network that may make network connections as
  5888. // specified in allowed[]. targetServiceAccounts cannot be used at the
  5889. // same time as targetTags or sourceTags. If neither
  5890. // targetServiceAccounts nor targetTags are specified, the firewall rule
  5891. // applies to all instances on the specified network.
  5892. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  5893. // TargetTags: A list of tags that controls which instances the firewall
  5894. // rule applies to. If targetTags are specified, then the firewall rule
  5895. // applies only to instances in the VPC network that have one of those
  5896. // tags. If no targetTags are specified, the firewall rule applies to
  5897. // all instances on the specified network.
  5898. TargetTags []string `json:"targetTags,omitempty"`
  5899. // ServerResponse contains the HTTP response code and headers from the
  5900. // server.
  5901. googleapi.ServerResponse `json:"-"`
  5902. // ForceSendFields is a list of field names (e.g. "Allowed") to
  5903. // unconditionally include in API requests. By default, fields with
  5904. // empty values are omitted from API requests. However, any non-pointer,
  5905. // non-interface field appearing in ForceSendFields will be sent to the
  5906. // server regardless of whether the field is empty or not. This may be
  5907. // used to include empty fields in Patch requests.
  5908. ForceSendFields []string `json:"-"`
  5909. // NullFields is a list of field names (e.g. "Allowed") to include in
  5910. // API requests with the JSON null value. By default, fields with empty
  5911. // values are omitted from API requests. However, any field with an
  5912. // empty value appearing in NullFields will be sent to the server as
  5913. // null. It is an error if a field in this list has a non-empty value.
  5914. // This may be used to include null fields in Patch requests.
  5915. NullFields []string `json:"-"`
  5916. }
  5917. func (s *Firewall) MarshalJSON() ([]byte, error) {
  5918. type NoMethod Firewall
  5919. raw := NoMethod(*s)
  5920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5921. }
  5922. type FirewallAllowed struct {
  5923. // IPProtocol: The IP protocol to which this rule applies. The protocol
  5924. // type is required when creating a firewall rule. This value can either
  5925. // be one of the following well known protocol strings (tcp, udp, icmp,
  5926. // esp, ah, ipip, sctp), or the IP protocol number.
  5927. IPProtocol string `json:"IPProtocol,omitempty"`
  5928. // Ports: An optional list of ports to which this rule applies. This
  5929. // field is only applicable for UDP or TCP protocol. Each entry must be
  5930. // either an integer or a range. If not specified, this rule applies to
  5931. // connections through any port.
  5932. //
  5933. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  5934. Ports []string `json:"ports,omitempty"`
  5935. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  5936. // unconditionally include in API requests. By default, fields with
  5937. // empty values are omitted from API requests. However, any non-pointer,
  5938. // non-interface field appearing in ForceSendFields will be sent to the
  5939. // server regardless of whether the field is empty or not. This may be
  5940. // used to include empty fields in Patch requests.
  5941. ForceSendFields []string `json:"-"`
  5942. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  5943. // API requests with the JSON null value. By default, fields with empty
  5944. // values are omitted from API requests. However, any field with an
  5945. // empty value appearing in NullFields will be sent to the server as
  5946. // null. It is an error if a field in this list has a non-empty value.
  5947. // This may be used to include null fields in Patch requests.
  5948. NullFields []string `json:"-"`
  5949. }
  5950. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  5951. type NoMethod FirewallAllowed
  5952. raw := NoMethod(*s)
  5953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5954. }
  5955. type FirewallDenied struct {
  5956. // IPProtocol: The IP protocol to which this rule applies. The protocol
  5957. // type is required when creating a firewall rule. This value can either
  5958. // be one of the following well known protocol strings (tcp, udp, icmp,
  5959. // esp, ah, ipip, sctp), or the IP protocol number.
  5960. IPProtocol string `json:"IPProtocol,omitempty"`
  5961. // Ports: An optional list of ports to which this rule applies. This
  5962. // field is only applicable for UDP or TCP protocol. Each entry must be
  5963. // either an integer or a range. If not specified, this rule applies to
  5964. // connections through any port.
  5965. //
  5966. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  5967. Ports []string `json:"ports,omitempty"`
  5968. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  5969. // unconditionally include in API requests. By default, fields with
  5970. // empty values are omitted from API requests. However, any non-pointer,
  5971. // non-interface field appearing in ForceSendFields will be sent to the
  5972. // server regardless of whether the field is empty or not. This may be
  5973. // used to include empty fields in Patch requests.
  5974. ForceSendFields []string `json:"-"`
  5975. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  5976. // API requests with the JSON null value. By default, fields with empty
  5977. // values are omitted from API requests. However, any field with an
  5978. // empty value appearing in NullFields will be sent to the server as
  5979. // null. It is an error if a field in this list has a non-empty value.
  5980. // This may be used to include null fields in Patch requests.
  5981. NullFields []string `json:"-"`
  5982. }
  5983. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  5984. type NoMethod FirewallDenied
  5985. raw := NoMethod(*s)
  5986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5987. }
  5988. // FirewallList: Contains a list of firewalls.
  5989. type FirewallList struct {
  5990. // Id: [Output Only] Unique identifier for the resource; defined by the
  5991. // server.
  5992. Id string `json:"id,omitempty"`
  5993. // Items: A list of Firewall resources.
  5994. Items []*Firewall `json:"items,omitempty"`
  5995. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  5996. // lists of firewalls.
  5997. Kind string `json:"kind,omitempty"`
  5998. // NextPageToken: [Output Only] This token allows you to get the next
  5999. // page of results for list requests. If the number of results is larger
  6000. // than maxResults, use the nextPageToken as a value for the query
  6001. // parameter pageToken in the next list request. Subsequent list
  6002. // requests will have their own nextPageToken to continue paging through
  6003. // the results.
  6004. NextPageToken string `json:"nextPageToken,omitempty"`
  6005. // SelfLink: [Output Only] Server-defined URL for this resource.
  6006. SelfLink string `json:"selfLink,omitempty"`
  6007. // Warning: [Output Only] Informational warning message.
  6008. Warning *FirewallListWarning `json:"warning,omitempty"`
  6009. // ServerResponse contains the HTTP response code and headers from the
  6010. // server.
  6011. googleapi.ServerResponse `json:"-"`
  6012. // ForceSendFields is a list of field names (e.g. "Id") to
  6013. // unconditionally include in API requests. By default, fields with
  6014. // empty values are omitted from API requests. However, any non-pointer,
  6015. // non-interface field appearing in ForceSendFields will be sent to the
  6016. // server regardless of whether the field is empty or not. This may be
  6017. // used to include empty fields in Patch requests.
  6018. ForceSendFields []string `json:"-"`
  6019. // NullFields is a list of field names (e.g. "Id") to include in API
  6020. // requests with the JSON null value. By default, fields with empty
  6021. // values are omitted from API requests. However, any field with an
  6022. // empty value appearing in NullFields will be sent to the server as
  6023. // null. It is an error if a field in this list has a non-empty value.
  6024. // This may be used to include null fields in Patch requests.
  6025. NullFields []string `json:"-"`
  6026. }
  6027. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  6028. type NoMethod FirewallList
  6029. raw := NoMethod(*s)
  6030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6031. }
  6032. // FirewallListWarning: [Output Only] Informational warning message.
  6033. type FirewallListWarning struct {
  6034. // Code: [Output Only] A warning code, if applicable. For example,
  6035. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6036. // the response.
  6037. //
  6038. // Possible values:
  6039. // "CLEANUP_FAILED"
  6040. // "DEPRECATED_RESOURCE_USED"
  6041. // "DEPRECATED_TYPE_USED"
  6042. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6043. // "EXPERIMENTAL_TYPE_USED"
  6044. // "EXTERNAL_API_WARNING"
  6045. // "FIELD_VALUE_OVERRIDEN"
  6046. // "INJECTED_KERNELS_DEPRECATED"
  6047. // "MISSING_TYPE_DEPENDENCY"
  6048. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6049. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6050. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6051. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6052. // "NEXT_HOP_NOT_RUNNING"
  6053. // "NOT_CRITICAL_ERROR"
  6054. // "NO_RESULTS_ON_PAGE"
  6055. // "REQUIRED_TOS_AGREEMENT"
  6056. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6057. // "RESOURCE_NOT_DELETED"
  6058. // "SCHEMA_VALIDATION_IGNORED"
  6059. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6060. // "UNDECLARED_PROPERTIES"
  6061. // "UNREACHABLE"
  6062. Code string `json:"code,omitempty"`
  6063. // Data: [Output Only] Metadata about this warning in key: value format.
  6064. // For example:
  6065. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6066. Data []*FirewallListWarningData `json:"data,omitempty"`
  6067. // Message: [Output Only] A human-readable description of the warning
  6068. // code.
  6069. Message string `json:"message,omitempty"`
  6070. // ForceSendFields is a list of field names (e.g. "Code") to
  6071. // unconditionally include in API requests. By default, fields with
  6072. // empty values are omitted from API requests. However, any non-pointer,
  6073. // non-interface field appearing in ForceSendFields will be sent to the
  6074. // server regardless of whether the field is empty or not. This may be
  6075. // used to include empty fields in Patch requests.
  6076. ForceSendFields []string `json:"-"`
  6077. // NullFields is a list of field names (e.g. "Code") to include in API
  6078. // requests with the JSON null value. By default, fields with empty
  6079. // values are omitted from API requests. However, any field with an
  6080. // empty value appearing in NullFields will be sent to the server as
  6081. // null. It is an error if a field in this list has a non-empty value.
  6082. // This may be used to include null fields in Patch requests.
  6083. NullFields []string `json:"-"`
  6084. }
  6085. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  6086. type NoMethod FirewallListWarning
  6087. raw := NoMethod(*s)
  6088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6089. }
  6090. type FirewallListWarningData struct {
  6091. // Key: [Output Only] A key that provides more detail on the warning
  6092. // being returned. For example, for warnings where there are no results
  6093. // in a list request for a particular zone, this key might be scope and
  6094. // the key value might be the zone name. Other examples might be a key
  6095. // indicating a deprecated resource and a suggested replacement, or a
  6096. // warning about invalid network settings (for example, if an instance
  6097. // attempts to perform IP forwarding but is not enabled for IP
  6098. // forwarding).
  6099. Key string `json:"key,omitempty"`
  6100. // Value: [Output Only] A warning data value corresponding to the key.
  6101. Value string `json:"value,omitempty"`
  6102. // ForceSendFields is a list of field names (e.g. "Key") to
  6103. // unconditionally include in API requests. By default, fields with
  6104. // empty values are omitted from API requests. However, any non-pointer,
  6105. // non-interface field appearing in ForceSendFields will be sent to the
  6106. // server regardless of whether the field is empty or not. This may be
  6107. // used to include empty fields in Patch requests.
  6108. ForceSendFields []string `json:"-"`
  6109. // NullFields is a list of field names (e.g. "Key") to include in API
  6110. // requests with the JSON null value. By default, fields with empty
  6111. // values are omitted from API requests. However, any field with an
  6112. // empty value appearing in NullFields will be sent to the server as
  6113. // null. It is an error if a field in this list has a non-empty value.
  6114. // This may be used to include null fields in Patch requests.
  6115. NullFields []string `json:"-"`
  6116. }
  6117. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  6118. type NoMethod FirewallListWarningData
  6119. raw := NoMethod(*s)
  6120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6121. }
  6122. // FirewallLogConfig: The available logging options for a firewall rule.
  6123. type FirewallLogConfig struct {
  6124. // Enable: This field denotes whether to enable logging for a particular
  6125. // firewall rule.
  6126. Enable bool `json:"enable,omitempty"`
  6127. // ForceSendFields is a list of field names (e.g. "Enable") to
  6128. // unconditionally include in API requests. By default, fields with
  6129. // empty values are omitted from API requests. However, any non-pointer,
  6130. // non-interface field appearing in ForceSendFields will be sent to the
  6131. // server regardless of whether the field is empty or not. This may be
  6132. // used to include empty fields in Patch requests.
  6133. ForceSendFields []string `json:"-"`
  6134. // NullFields is a list of field names (e.g. "Enable") to include in API
  6135. // requests with the JSON null value. By default, fields with empty
  6136. // values are omitted from API requests. However, any field with an
  6137. // empty value appearing in NullFields will be sent to the server as
  6138. // null. It is an error if a field in this list has a non-empty value.
  6139. // This may be used to include null fields in Patch requests.
  6140. NullFields []string `json:"-"`
  6141. }
  6142. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  6143. type NoMethod FirewallLogConfig
  6144. raw := NoMethod(*s)
  6145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6146. }
  6147. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  6148. // specifies which pool of target virtual machines to forward a packet
  6149. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  6150. // resource_for beta.forwardingRules ==) (== resource_for
  6151. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  6152. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  6153. // beta.regionForwardingRules ==) (== resource_for
  6154. // v1.regionForwardingRules ==)
  6155. type ForwardingRule struct {
  6156. // IPAddress: The IP address that this forwarding rule is serving on
  6157. // behalf of.
  6158. //
  6159. // Addresses are restricted based on the forwarding rule's load
  6160. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  6161. // regional).
  6162. //
  6163. // When the load balancing scheme is EXTERNAL, for global forwarding
  6164. // rules, the address must be a global IP, and for regional forwarding
  6165. // rules, the address must live in the same region as the forwarding
  6166. // rule. If this field is empty, an ephemeral IPv4 address from the same
  6167. // scope (global or regional) will be assigned. A regional forwarding
  6168. // rule supports IPv4 only. A global forwarding rule supports either
  6169. // IPv4 or IPv6.
  6170. //
  6171. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  6172. // a URL reference to an existing Address resource ( internal regional
  6173. // static IP address), with a purpose of GCE_END_POINT and address_type
  6174. // of INTERNAL.
  6175. //
  6176. // When the load balancing scheme is INTERNAL, this can only be an RFC
  6177. // 1918 IP address belonging to the network/subnet configured for the
  6178. // forwarding rule. By default, if this field is empty, an ephemeral
  6179. // internal IP address will be automatically allocated from the IP range
  6180. // of the subnet or network configured for this forwarding rule.
  6181. //
  6182. // An address can be specified either by a literal IP address or a URL
  6183. // reference to an existing Address resource. The following examples are
  6184. // all valid:
  6185. // - 100.1.2.3
  6186. // -
  6187. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  6188. // - projects/project/regions/region/addresses/address
  6189. // - regions/region/addresses/address
  6190. // - global/addresses/address
  6191. // - address
  6192. IPAddress string `json:"IPAddress,omitempty"`
  6193. // IPProtocol: The IP protocol to which this rule applies. Valid options
  6194. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  6195. //
  6196. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  6197. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  6198. // TCPis valid.
  6199. //
  6200. // Possible values:
  6201. // "AH"
  6202. // "ESP"
  6203. // "ICMP"
  6204. // "SCTP"
  6205. // "TCP"
  6206. // "UDP"
  6207. IPProtocol string `json:"IPProtocol,omitempty"`
  6208. // BackendService: This field is only used for INTERNAL load
  6209. // balancing.
  6210. //
  6211. // For internal load balancing, this field identifies the BackendService
  6212. // resource to receive the matched traffic.
  6213. BackendService string `json:"backendService,omitempty"`
  6214. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6215. // format.
  6216. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6217. // Description: An optional description of this resource. Provide this
  6218. // property when you create the resource.
  6219. Description string `json:"description,omitempty"`
  6220. // Id: [Output Only] The unique identifier for the resource. This
  6221. // identifier is defined by the server.
  6222. Id uint64 `json:"id,omitempty,string"`
  6223. // IpVersion: The IP Version that will be used by this forwarding rule.
  6224. // Valid options are IPV4 or IPV6. This can only be specified for an
  6225. // external global forwarding rule.
  6226. //
  6227. // Possible values:
  6228. // "IPV4"
  6229. // "IPV6"
  6230. // "UNSPECIFIED_VERSION"
  6231. IpVersion string `json:"ipVersion,omitempty"`
  6232. // Kind: [Output Only] Type of the resource. Always
  6233. // compute#forwardingRule for Forwarding Rule resources.
  6234. Kind string `json:"kind,omitempty"`
  6235. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  6236. // used for and can only take the following values: INTERNAL,
  6237. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  6238. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  6239. // value of INTERNAL_SELF_MANAGED means that this will be used for
  6240. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  6241. // will be used for External Load Balancing (HTTP(S) LB, External
  6242. // TCP/UDP LB, SSL Proxy)
  6243. //
  6244. // Possible values:
  6245. // "EXTERNAL"
  6246. // "INTERNAL"
  6247. // "INVALID"
  6248. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  6249. // Name: Name of the resource; provided by the client when the resource
  6250. // is created. The name must be 1-63 characters long, and comply with
  6251. // RFC1035. Specifically, the name must be 1-63 characters long and
  6252. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6253. // the first character must be a lowercase letter, and all following
  6254. // characters must be a dash, lowercase letter, or digit, except the
  6255. // last character, which cannot be a dash.
  6256. Name string `json:"name,omitempty"`
  6257. // Network: This field is not used for external load balancing.
  6258. //
  6259. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  6260. // identifies the network that the load balanced IP should belong to for
  6261. // this Forwarding Rule. If this field is not specified, the default
  6262. // network will be used.
  6263. Network string `json:"network,omitempty"`
  6264. // NetworkTier: This signifies the networking tier used for configuring
  6265. // this load balancer and can only take the following values: PREMIUM ,
  6266. // STANDARD.
  6267. //
  6268. // For regional ForwardingRule, the valid values are PREMIUM and
  6269. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  6270. //
  6271. // If this field is not specified, it is assumed to be PREMIUM. If
  6272. // IPAddress is specified, this value must be equal to the networkTier
  6273. // of the Address.
  6274. //
  6275. // Possible values:
  6276. // "PREMIUM"
  6277. // "STANDARD"
  6278. NetworkTier string `json:"networkTier,omitempty"`
  6279. // PortRange: This field is used along with the target field for
  6280. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  6281. // TargetVpnGateway, TargetPool, TargetInstance.
  6282. //
  6283. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  6284. // addressed to ports in the specified range will be forwarded to
  6285. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  6286. // must have disjoint port ranges.
  6287. //
  6288. // Some types of forwarding target have constraints on the acceptable
  6289. // ports:
  6290. // - TargetHttpProxy: 80, 8080
  6291. // - TargetHttpsProxy: 443
  6292. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6293. // 995, 1688, 1883, 5222
  6294. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6295. // 995, 1688, 1883, 5222
  6296. // - TargetVpnGateway: 500, 4500
  6297. PortRange string `json:"portRange,omitempty"`
  6298. // Ports: This field is used along with the backend_service field for
  6299. // internal load balancing.
  6300. //
  6301. // When the load balancing scheme is INTERNAL, a list of ports can be
  6302. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  6303. // addressed to these ports will be forwarded to the backends configured
  6304. // with this forwarding rule.
  6305. //
  6306. // You may specify a maximum of up to 5 ports.
  6307. Ports []string `json:"ports,omitempty"`
  6308. // Region: [Output Only] URL of the region where the regional forwarding
  6309. // rule resides. This field is not applicable to global forwarding
  6310. // rules. You must specify this field as part of the HTTP request URL.
  6311. // It is not settable as a field in the request body.
  6312. Region string `json:"region,omitempty"`
  6313. // SelfLink: [Output Only] Server-defined URL for the resource.
  6314. SelfLink string `json:"selfLink,omitempty"`
  6315. // Subnetwork: This field is only used for INTERNAL load balancing.
  6316. //
  6317. // For internal load balancing, this field identifies the subnetwork
  6318. // that the load balanced IP should belong to for this Forwarding
  6319. // Rule.
  6320. //
  6321. // If the network specified is in auto subnet mode, this field is
  6322. // optional. However, if the network is in custom subnet mode, a
  6323. // subnetwork must be specified.
  6324. Subnetwork string `json:"subnetwork,omitempty"`
  6325. // Target: The URL of the target resource to receive the matched
  6326. // traffic. For regional forwarding rules, this target must live in the
  6327. // same region as the forwarding rule. For global forwarding rules, this
  6328. // target must be a global load balancing resource. The forwarded
  6329. // traffic must be of a type appropriate to the target object. For
  6330. // INTERNAL_SELF_MANAGED" load balancing, only HTTP and HTTPS targets
  6331. // are valid.
  6332. Target string `json:"target,omitempty"`
  6333. // ServerResponse contains the HTTP response code and headers from the
  6334. // server.
  6335. googleapi.ServerResponse `json:"-"`
  6336. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  6337. // unconditionally include in API requests. By default, fields with
  6338. // empty values are omitted from API requests. However, any non-pointer,
  6339. // non-interface field appearing in ForceSendFields will be sent to the
  6340. // server regardless of whether the field is empty or not. This may be
  6341. // used to include empty fields in Patch requests.
  6342. ForceSendFields []string `json:"-"`
  6343. // NullFields is a list of field names (e.g. "IPAddress") to include in
  6344. // API requests with the JSON null value. By default, fields with empty
  6345. // values are omitted from API requests. However, any field with an
  6346. // empty value appearing in NullFields will be sent to the server as
  6347. // null. It is an error if a field in this list has a non-empty value.
  6348. // This may be used to include null fields in Patch requests.
  6349. NullFields []string `json:"-"`
  6350. }
  6351. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  6352. type NoMethod ForwardingRule
  6353. raw := NoMethod(*s)
  6354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6355. }
  6356. type ForwardingRuleAggregatedList struct {
  6357. // Id: [Output Only] Unique identifier for the resource; defined by the
  6358. // server.
  6359. Id string `json:"id,omitempty"`
  6360. // Items: A list of ForwardingRulesScopedList resources.
  6361. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  6362. // Kind: [Output Only] Type of resource. Always
  6363. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  6364. Kind string `json:"kind,omitempty"`
  6365. // NextPageToken: [Output Only] This token allows you to get the next
  6366. // page of results for list requests. If the number of results is larger
  6367. // than maxResults, use the nextPageToken as a value for the query
  6368. // parameter pageToken in the next list request. Subsequent list
  6369. // requests will have their own nextPageToken to continue paging through
  6370. // the results.
  6371. NextPageToken string `json:"nextPageToken,omitempty"`
  6372. // SelfLink: [Output Only] Server-defined URL for this resource.
  6373. SelfLink string `json:"selfLink,omitempty"`
  6374. // Warning: [Output Only] Informational warning message.
  6375. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  6376. // ServerResponse contains the HTTP response code and headers from the
  6377. // server.
  6378. googleapi.ServerResponse `json:"-"`
  6379. // ForceSendFields is a list of field names (e.g. "Id") to
  6380. // unconditionally include in API requests. By default, fields with
  6381. // empty values are omitted from API requests. However, any non-pointer,
  6382. // non-interface field appearing in ForceSendFields will be sent to the
  6383. // server regardless of whether the field is empty or not. This may be
  6384. // used to include empty fields in Patch requests.
  6385. ForceSendFields []string `json:"-"`
  6386. // NullFields is a list of field names (e.g. "Id") to include in API
  6387. // requests with the JSON null value. By default, fields with empty
  6388. // values are omitted from API requests. However, any field with an
  6389. // empty value appearing in NullFields will be sent to the server as
  6390. // null. It is an error if a field in this list has a non-empty value.
  6391. // This may be used to include null fields in Patch requests.
  6392. NullFields []string `json:"-"`
  6393. }
  6394. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  6395. type NoMethod ForwardingRuleAggregatedList
  6396. raw := NoMethod(*s)
  6397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6398. }
  6399. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  6400. // warning message.
  6401. type ForwardingRuleAggregatedListWarning struct {
  6402. // Code: [Output Only] A warning code, if applicable. For example,
  6403. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6404. // the response.
  6405. //
  6406. // Possible values:
  6407. // "CLEANUP_FAILED"
  6408. // "DEPRECATED_RESOURCE_USED"
  6409. // "DEPRECATED_TYPE_USED"
  6410. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6411. // "EXPERIMENTAL_TYPE_USED"
  6412. // "EXTERNAL_API_WARNING"
  6413. // "FIELD_VALUE_OVERRIDEN"
  6414. // "INJECTED_KERNELS_DEPRECATED"
  6415. // "MISSING_TYPE_DEPENDENCY"
  6416. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6417. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6418. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6419. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6420. // "NEXT_HOP_NOT_RUNNING"
  6421. // "NOT_CRITICAL_ERROR"
  6422. // "NO_RESULTS_ON_PAGE"
  6423. // "REQUIRED_TOS_AGREEMENT"
  6424. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6425. // "RESOURCE_NOT_DELETED"
  6426. // "SCHEMA_VALIDATION_IGNORED"
  6427. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6428. // "UNDECLARED_PROPERTIES"
  6429. // "UNREACHABLE"
  6430. Code string `json:"code,omitempty"`
  6431. // Data: [Output Only] Metadata about this warning in key: value format.
  6432. // For example:
  6433. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6434. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  6435. // Message: [Output Only] A human-readable description of the warning
  6436. // code.
  6437. Message string `json:"message,omitempty"`
  6438. // ForceSendFields is a list of field names (e.g. "Code") to
  6439. // unconditionally include in API requests. By default, fields with
  6440. // empty values are omitted from API requests. However, any non-pointer,
  6441. // non-interface field appearing in ForceSendFields will be sent to the
  6442. // server regardless of whether the field is empty or not. This may be
  6443. // used to include empty fields in Patch requests.
  6444. ForceSendFields []string `json:"-"`
  6445. // NullFields is a list of field names (e.g. "Code") to include in API
  6446. // requests with the JSON null value. By default, fields with empty
  6447. // values are omitted from API requests. However, any field with an
  6448. // empty value appearing in NullFields will be sent to the server as
  6449. // null. It is an error if a field in this list has a non-empty value.
  6450. // This may be used to include null fields in Patch requests.
  6451. NullFields []string `json:"-"`
  6452. }
  6453. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6454. type NoMethod ForwardingRuleAggregatedListWarning
  6455. raw := NoMethod(*s)
  6456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6457. }
  6458. type ForwardingRuleAggregatedListWarningData struct {
  6459. // Key: [Output Only] A key that provides more detail on the warning
  6460. // being returned. For example, for warnings where there are no results
  6461. // in a list request for a particular zone, this key might be scope and
  6462. // the key value might be the zone name. Other examples might be a key
  6463. // indicating a deprecated resource and a suggested replacement, or a
  6464. // warning about invalid network settings (for example, if an instance
  6465. // attempts to perform IP forwarding but is not enabled for IP
  6466. // forwarding).
  6467. Key string `json:"key,omitempty"`
  6468. // Value: [Output Only] A warning data value corresponding to the key.
  6469. Value string `json:"value,omitempty"`
  6470. // ForceSendFields is a list of field names (e.g. "Key") to
  6471. // unconditionally include in API requests. By default, fields with
  6472. // empty values are omitted from API requests. However, any non-pointer,
  6473. // non-interface field appearing in ForceSendFields will be sent to the
  6474. // server regardless of whether the field is empty or not. This may be
  6475. // used to include empty fields in Patch requests.
  6476. ForceSendFields []string `json:"-"`
  6477. // NullFields is a list of field names (e.g. "Key") to include in API
  6478. // requests with the JSON null value. By default, fields with empty
  6479. // values are omitted from API requests. However, any field with an
  6480. // empty value appearing in NullFields will be sent to the server as
  6481. // null. It is an error if a field in this list has a non-empty value.
  6482. // This may be used to include null fields in Patch requests.
  6483. NullFields []string `json:"-"`
  6484. }
  6485. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6486. type NoMethod ForwardingRuleAggregatedListWarningData
  6487. raw := NoMethod(*s)
  6488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6489. }
  6490. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  6491. type ForwardingRuleList struct {
  6492. // Id: [Output Only] Unique identifier for the resource; defined by the
  6493. // server.
  6494. Id string `json:"id,omitempty"`
  6495. // Items: A list of ForwardingRule resources.
  6496. Items []*ForwardingRule `json:"items,omitempty"`
  6497. // Kind: Type of resource.
  6498. Kind string `json:"kind,omitempty"`
  6499. // NextPageToken: [Output Only] This token allows you to get the next
  6500. // page of results for list requests. If the number of results is larger
  6501. // than maxResults, use the nextPageToken as a value for the query
  6502. // parameter pageToken in the next list request. Subsequent list
  6503. // requests will have their own nextPageToken to continue paging through
  6504. // the results.
  6505. NextPageToken string `json:"nextPageToken,omitempty"`
  6506. // SelfLink: [Output Only] Server-defined URL for this resource.
  6507. SelfLink string `json:"selfLink,omitempty"`
  6508. // Warning: [Output Only] Informational warning message.
  6509. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  6510. // ServerResponse contains the HTTP response code and headers from the
  6511. // server.
  6512. googleapi.ServerResponse `json:"-"`
  6513. // ForceSendFields is a list of field names (e.g. "Id") to
  6514. // unconditionally include in API requests. By default, fields with
  6515. // empty values are omitted from API requests. However, any non-pointer,
  6516. // non-interface field appearing in ForceSendFields will be sent to the
  6517. // server regardless of whether the field is empty or not. This may be
  6518. // used to include empty fields in Patch requests.
  6519. ForceSendFields []string `json:"-"`
  6520. // NullFields is a list of field names (e.g. "Id") to include in API
  6521. // requests with the JSON null value. By default, fields with empty
  6522. // values are omitted from API requests. However, any field with an
  6523. // empty value appearing in NullFields will be sent to the server as
  6524. // null. It is an error if a field in this list has a non-empty value.
  6525. // This may be used to include null fields in Patch requests.
  6526. NullFields []string `json:"-"`
  6527. }
  6528. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  6529. type NoMethod ForwardingRuleList
  6530. raw := NoMethod(*s)
  6531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6532. }
  6533. // ForwardingRuleListWarning: [Output Only] Informational warning
  6534. // message.
  6535. type ForwardingRuleListWarning struct {
  6536. // Code: [Output Only] A warning code, if applicable. For example,
  6537. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6538. // the response.
  6539. //
  6540. // Possible values:
  6541. // "CLEANUP_FAILED"
  6542. // "DEPRECATED_RESOURCE_USED"
  6543. // "DEPRECATED_TYPE_USED"
  6544. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6545. // "EXPERIMENTAL_TYPE_USED"
  6546. // "EXTERNAL_API_WARNING"
  6547. // "FIELD_VALUE_OVERRIDEN"
  6548. // "INJECTED_KERNELS_DEPRECATED"
  6549. // "MISSING_TYPE_DEPENDENCY"
  6550. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6551. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6552. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6553. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6554. // "NEXT_HOP_NOT_RUNNING"
  6555. // "NOT_CRITICAL_ERROR"
  6556. // "NO_RESULTS_ON_PAGE"
  6557. // "REQUIRED_TOS_AGREEMENT"
  6558. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6559. // "RESOURCE_NOT_DELETED"
  6560. // "SCHEMA_VALIDATION_IGNORED"
  6561. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6562. // "UNDECLARED_PROPERTIES"
  6563. // "UNREACHABLE"
  6564. Code string `json:"code,omitempty"`
  6565. // Data: [Output Only] Metadata about this warning in key: value format.
  6566. // For example:
  6567. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6568. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  6569. // Message: [Output Only] A human-readable description of the warning
  6570. // code.
  6571. Message string `json:"message,omitempty"`
  6572. // ForceSendFields is a list of field names (e.g. "Code") to
  6573. // unconditionally include in API requests. By default, fields with
  6574. // empty values are omitted from API requests. However, any non-pointer,
  6575. // non-interface field appearing in ForceSendFields will be sent to the
  6576. // server regardless of whether the field is empty or not. This may be
  6577. // used to include empty fields in Patch requests.
  6578. ForceSendFields []string `json:"-"`
  6579. // NullFields is a list of field names (e.g. "Code") to include in API
  6580. // requests with the JSON null value. By default, fields with empty
  6581. // values are omitted from API requests. However, any field with an
  6582. // empty value appearing in NullFields will be sent to the server as
  6583. // null. It is an error if a field in this list has a non-empty value.
  6584. // This may be used to include null fields in Patch requests.
  6585. NullFields []string `json:"-"`
  6586. }
  6587. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  6588. type NoMethod ForwardingRuleListWarning
  6589. raw := NoMethod(*s)
  6590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6591. }
  6592. type ForwardingRuleListWarningData struct {
  6593. // Key: [Output Only] A key that provides more detail on the warning
  6594. // being returned. For example, for warnings where there are no results
  6595. // in a list request for a particular zone, this key might be scope and
  6596. // the key value might be the zone name. Other examples might be a key
  6597. // indicating a deprecated resource and a suggested replacement, or a
  6598. // warning about invalid network settings (for example, if an instance
  6599. // attempts to perform IP forwarding but is not enabled for IP
  6600. // forwarding).
  6601. Key string `json:"key,omitempty"`
  6602. // Value: [Output Only] A warning data value corresponding to the key.
  6603. Value string `json:"value,omitempty"`
  6604. // ForceSendFields is a list of field names (e.g. "Key") to
  6605. // unconditionally include in API requests. By default, fields with
  6606. // empty values are omitted from API requests. However, any non-pointer,
  6607. // non-interface field appearing in ForceSendFields will be sent to the
  6608. // server regardless of whether the field is empty or not. This may be
  6609. // used to include empty fields in Patch requests.
  6610. ForceSendFields []string `json:"-"`
  6611. // NullFields is a list of field names (e.g. "Key") to include in API
  6612. // requests with the JSON null value. By default, fields with empty
  6613. // values are omitted from API requests. However, any field with an
  6614. // empty value appearing in NullFields will be sent to the server as
  6615. // null. It is an error if a field in this list has a non-empty value.
  6616. // This may be used to include null fields in Patch requests.
  6617. NullFields []string `json:"-"`
  6618. }
  6619. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  6620. type NoMethod ForwardingRuleListWarningData
  6621. raw := NoMethod(*s)
  6622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6623. }
  6624. type ForwardingRulesScopedList struct {
  6625. // ForwardingRules: A list of forwarding rules contained in this scope.
  6626. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  6627. // Warning: Informational warning which replaces the list of forwarding
  6628. // rules when the list is empty.
  6629. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  6630. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  6631. // unconditionally include in API requests. By default, fields with
  6632. // empty values are omitted from API requests. However, any non-pointer,
  6633. // non-interface field appearing in ForceSendFields will be sent to the
  6634. // server regardless of whether the field is empty or not. This may be
  6635. // used to include empty fields in Patch requests.
  6636. ForceSendFields []string `json:"-"`
  6637. // NullFields is a list of field names (e.g. "ForwardingRules") to
  6638. // include in API requests with the JSON null value. By default, fields
  6639. // with empty values are omitted from API requests. However, any field
  6640. // with an empty value appearing in NullFields will be sent to the
  6641. // server as null. It is an error if a field in this list has a
  6642. // non-empty value. This may be used to include null fields in Patch
  6643. // requests.
  6644. NullFields []string `json:"-"`
  6645. }
  6646. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  6647. type NoMethod ForwardingRulesScopedList
  6648. raw := NoMethod(*s)
  6649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6650. }
  6651. // ForwardingRulesScopedListWarning: Informational warning which
  6652. // replaces the list of forwarding rules when the list is empty.
  6653. type ForwardingRulesScopedListWarning struct {
  6654. // Code: [Output Only] A warning code, if applicable. For example,
  6655. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6656. // the response.
  6657. //
  6658. // Possible values:
  6659. // "CLEANUP_FAILED"
  6660. // "DEPRECATED_RESOURCE_USED"
  6661. // "DEPRECATED_TYPE_USED"
  6662. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6663. // "EXPERIMENTAL_TYPE_USED"
  6664. // "EXTERNAL_API_WARNING"
  6665. // "FIELD_VALUE_OVERRIDEN"
  6666. // "INJECTED_KERNELS_DEPRECATED"
  6667. // "MISSING_TYPE_DEPENDENCY"
  6668. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6669. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6670. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6671. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6672. // "NEXT_HOP_NOT_RUNNING"
  6673. // "NOT_CRITICAL_ERROR"
  6674. // "NO_RESULTS_ON_PAGE"
  6675. // "REQUIRED_TOS_AGREEMENT"
  6676. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6677. // "RESOURCE_NOT_DELETED"
  6678. // "SCHEMA_VALIDATION_IGNORED"
  6679. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6680. // "UNDECLARED_PROPERTIES"
  6681. // "UNREACHABLE"
  6682. Code string `json:"code,omitempty"`
  6683. // Data: [Output Only] Metadata about this warning in key: value format.
  6684. // For example:
  6685. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6686. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  6687. // Message: [Output Only] A human-readable description of the warning
  6688. // code.
  6689. Message string `json:"message,omitempty"`
  6690. // ForceSendFields is a list of field names (e.g. "Code") to
  6691. // unconditionally include in API requests. By default, fields with
  6692. // empty values are omitted from API requests. However, any non-pointer,
  6693. // non-interface field appearing in ForceSendFields will be sent to the
  6694. // server regardless of whether the field is empty or not. This may be
  6695. // used to include empty fields in Patch requests.
  6696. ForceSendFields []string `json:"-"`
  6697. // NullFields is a list of field names (e.g. "Code") to include in API
  6698. // requests with the JSON null value. By default, fields with empty
  6699. // values are omitted from API requests. However, any field with an
  6700. // empty value appearing in NullFields will be sent to the server as
  6701. // null. It is an error if a field in this list has a non-empty value.
  6702. // This may be used to include null fields in Patch requests.
  6703. NullFields []string `json:"-"`
  6704. }
  6705. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  6706. type NoMethod ForwardingRulesScopedListWarning
  6707. raw := NoMethod(*s)
  6708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6709. }
  6710. type ForwardingRulesScopedListWarningData struct {
  6711. // Key: [Output Only] A key that provides more detail on the warning
  6712. // being returned. For example, for warnings where there are no results
  6713. // in a list request for a particular zone, this key might be scope and
  6714. // the key value might be the zone name. Other examples might be a key
  6715. // indicating a deprecated resource and a suggested replacement, or a
  6716. // warning about invalid network settings (for example, if an instance
  6717. // attempts to perform IP forwarding but is not enabled for IP
  6718. // forwarding).
  6719. Key string `json:"key,omitempty"`
  6720. // Value: [Output Only] A warning data value corresponding to the key.
  6721. Value string `json:"value,omitempty"`
  6722. // ForceSendFields is a list of field names (e.g. "Key") to
  6723. // unconditionally include in API requests. By default, fields with
  6724. // empty values are omitted from API requests. However, any non-pointer,
  6725. // non-interface field appearing in ForceSendFields will be sent to the
  6726. // server regardless of whether the field is empty or not. This may be
  6727. // used to include empty fields in Patch requests.
  6728. ForceSendFields []string `json:"-"`
  6729. // NullFields is a list of field names (e.g. "Key") to include in API
  6730. // requests with the JSON null value. By default, fields with empty
  6731. // values are omitted from API requests. However, any field with an
  6732. // empty value appearing in NullFields will be sent to the server as
  6733. // null. It is an error if a field in this list has a non-empty value.
  6734. // This may be used to include null fields in Patch requests.
  6735. NullFields []string `json:"-"`
  6736. }
  6737. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6738. type NoMethod ForwardingRulesScopedListWarningData
  6739. raw := NoMethod(*s)
  6740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6741. }
  6742. type GlobalSetLabelsRequest struct {
  6743. // LabelFingerprint: The fingerprint of the previous set of labels for
  6744. // this resource, used to detect conflicts. The fingerprint is initially
  6745. // generated by Compute Engine and changes after every request to modify
  6746. // or update labels. You must always provide an up-to-date fingerprint
  6747. // hash when updating or changing labels, otherwise the request will
  6748. // fail with error 412 conditionNotMet. Make a get() request to the
  6749. // resource to get the latest fingerprint.
  6750. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6751. // Labels: A list of labels to apply for this resource. Each label key &
  6752. // value must comply with RFC1035. Specifically, the name must be 1-63
  6753. // characters long and match the regular expression
  6754. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  6755. // a lowercase letter, and all following characters must be a dash,
  6756. // lowercase letter, or digit, except the last character, which cannot
  6757. // be a dash. For example, "webserver-frontend": "images". A label value
  6758. // can also be empty (e.g. "my-label": "").
  6759. Labels map[string]string `json:"labels,omitempty"`
  6760. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  6761. // unconditionally include in API requests. By default, fields with
  6762. // empty values are omitted from API requests. However, any non-pointer,
  6763. // non-interface field appearing in ForceSendFields will be sent to the
  6764. // server regardless of whether the field is empty or not. This may be
  6765. // used to include empty fields in Patch requests.
  6766. ForceSendFields []string `json:"-"`
  6767. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  6768. // include in API requests with the JSON null value. By default, fields
  6769. // with empty values are omitted from API requests. However, any field
  6770. // with an empty value appearing in NullFields will be sent to the
  6771. // server as null. It is an error if a field in this list has a
  6772. // non-empty value. This may be used to include null fields in Patch
  6773. // requests.
  6774. NullFields []string `json:"-"`
  6775. }
  6776. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  6777. type NoMethod GlobalSetLabelsRequest
  6778. raw := NoMethod(*s)
  6779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6780. }
  6781. type GlobalSetPolicyRequest struct {
  6782. // Bindings: Flatten Policy to create a backward compatible wire-format.
  6783. // Deprecated. Use 'policy' to specify bindings.
  6784. Bindings []*Binding `json:"bindings,omitempty"`
  6785. // Etag: Flatten Policy to create a backward compatible wire-format.
  6786. // Deprecated. Use 'policy' to specify the etag.
  6787. Etag string `json:"etag,omitempty"`
  6788. // Policy: REQUIRED: The complete policy to be applied to the
  6789. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  6790. // empty policy is in general a valid policy but certain services (like
  6791. // Projects) might reject them.
  6792. Policy *Policy `json:"policy,omitempty"`
  6793. // ForceSendFields is a list of field names (e.g. "Bindings") to
  6794. // unconditionally include in API requests. By default, fields with
  6795. // empty values are omitted from API requests. However, any non-pointer,
  6796. // non-interface field appearing in ForceSendFields will be sent to the
  6797. // server regardless of whether the field is empty or not. This may be
  6798. // used to include empty fields in Patch requests.
  6799. ForceSendFields []string `json:"-"`
  6800. // NullFields is a list of field names (e.g. "Bindings") to include in
  6801. // API requests with the JSON null value. By default, fields with empty
  6802. // values are omitted from API requests. However, any field with an
  6803. // empty value appearing in NullFields will be sent to the server as
  6804. // null. It is an error if a field in this list has a non-empty value.
  6805. // This may be used to include null fields in Patch requests.
  6806. NullFields []string `json:"-"`
  6807. }
  6808. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  6809. type NoMethod GlobalSetPolicyRequest
  6810. raw := NoMethod(*s)
  6811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6812. }
  6813. // GuestOsFeature: Guest OS features.
  6814. type GuestOsFeature struct {
  6815. // Type: The ID of a supported feature. Read Enabling guest operating
  6816. // system features to see a list of available options.
  6817. //
  6818. // Possible values:
  6819. // "FEATURE_TYPE_UNSPECIFIED"
  6820. // "MULTI_IP_SUBNET"
  6821. // "SECURE_BOOT"
  6822. // "UEFI_COMPATIBLE"
  6823. // "VIRTIO_SCSI_MULTIQUEUE"
  6824. // "WINDOWS"
  6825. Type string `json:"type,omitempty"`
  6826. // ForceSendFields is a list of field names (e.g. "Type") to
  6827. // unconditionally include in API requests. By default, fields with
  6828. // empty values are omitted from API requests. However, any non-pointer,
  6829. // non-interface field appearing in ForceSendFields will be sent to the
  6830. // server regardless of whether the field is empty or not. This may be
  6831. // used to include empty fields in Patch requests.
  6832. ForceSendFields []string `json:"-"`
  6833. // NullFields is a list of field names (e.g. "Type") to include in API
  6834. // requests with the JSON null value. By default, fields with empty
  6835. // values are omitted from API requests. However, any field with an
  6836. // empty value appearing in NullFields will be sent to the server as
  6837. // null. It is an error if a field in this list has a non-empty value.
  6838. // This may be used to include null fields in Patch requests.
  6839. NullFields []string `json:"-"`
  6840. }
  6841. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  6842. type NoMethod GuestOsFeature
  6843. raw := NoMethod(*s)
  6844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6845. }
  6846. type HTTPHealthCheck struct {
  6847. // Host: The value of the host header in the HTTP health check request.
  6848. // If left empty (default value), the IP on behalf of which this health
  6849. // check is performed will be used.
  6850. Host string `json:"host,omitempty"`
  6851. // Port: The TCP port number for the health check request. The default
  6852. // value is 80. Valid values are 1 through 65535.
  6853. Port int64 `json:"port,omitempty"`
  6854. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  6855. // both port and port_name are defined, port takes precedence.
  6856. PortName string `json:"portName,omitempty"`
  6857. // ProxyHeader: Specifies the type of proxy header to append before
  6858. // sending data to the backend, either NONE or PROXY_V1. The default is
  6859. // NONE.
  6860. //
  6861. // Possible values:
  6862. // "NONE"
  6863. // "PROXY_V1"
  6864. ProxyHeader string `json:"proxyHeader,omitempty"`
  6865. // RequestPath: The request path of the HTTP health check request. The
  6866. // default value is /.
  6867. RequestPath string `json:"requestPath,omitempty"`
  6868. // Response: The string to match anywhere in the first 1024 bytes of the
  6869. // response body. If left empty (the default value), the status code
  6870. // determines health. The response data can only be ASCII.
  6871. Response string `json:"response,omitempty"`
  6872. // ForceSendFields is a list of field names (e.g. "Host") to
  6873. // unconditionally include in API requests. By default, fields with
  6874. // empty values are omitted from API requests. However, any non-pointer,
  6875. // non-interface field appearing in ForceSendFields will be sent to the
  6876. // server regardless of whether the field is empty or not. This may be
  6877. // used to include empty fields in Patch requests.
  6878. ForceSendFields []string `json:"-"`
  6879. // NullFields is a list of field names (e.g. "Host") to include in API
  6880. // requests with the JSON null value. By default, fields with empty
  6881. // values are omitted from API requests. However, any field with an
  6882. // empty value appearing in NullFields will be sent to the server as
  6883. // null. It is an error if a field in this list has a non-empty value.
  6884. // This may be used to include null fields in Patch requests.
  6885. NullFields []string `json:"-"`
  6886. }
  6887. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  6888. type NoMethod HTTPHealthCheck
  6889. raw := NoMethod(*s)
  6890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6891. }
  6892. type HTTPSHealthCheck struct {
  6893. // Host: The value of the host header in the HTTPS health check request.
  6894. // If left empty (default value), the IP on behalf of which this health
  6895. // check is performed will be used.
  6896. Host string `json:"host,omitempty"`
  6897. // Port: The TCP port number for the health check request. The default
  6898. // value is 443. Valid values are 1 through 65535.
  6899. Port int64 `json:"port,omitempty"`
  6900. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  6901. // both port and port_name are defined, port takes precedence.
  6902. PortName string `json:"portName,omitempty"`
  6903. // ProxyHeader: Specifies the type of proxy header to append before
  6904. // sending data to the backend, either NONE or PROXY_V1. The default is
  6905. // NONE.
  6906. //
  6907. // Possible values:
  6908. // "NONE"
  6909. // "PROXY_V1"
  6910. ProxyHeader string `json:"proxyHeader,omitempty"`
  6911. // RequestPath: The request path of the HTTPS health check request. The
  6912. // default value is /.
  6913. RequestPath string `json:"requestPath,omitempty"`
  6914. // Response: The string to match anywhere in the first 1024 bytes of the
  6915. // response body. If left empty (the default value), the status code
  6916. // determines health. The response data can only be ASCII.
  6917. Response string `json:"response,omitempty"`
  6918. // ForceSendFields is a list of field names (e.g. "Host") to
  6919. // unconditionally include in API requests. By default, fields with
  6920. // empty values are omitted from API requests. However, any non-pointer,
  6921. // non-interface field appearing in ForceSendFields will be sent to the
  6922. // server regardless of whether the field is empty or not. This may be
  6923. // used to include empty fields in Patch requests.
  6924. ForceSendFields []string `json:"-"`
  6925. // NullFields is a list of field names (e.g. "Host") to include in API
  6926. // requests with the JSON null value. By default, fields with empty
  6927. // values are omitted from API requests. However, any field with an
  6928. // empty value appearing in NullFields will be sent to the server as
  6929. // null. It is an error if a field in this list has a non-empty value.
  6930. // This may be used to include null fields in Patch requests.
  6931. NullFields []string `json:"-"`
  6932. }
  6933. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  6934. type NoMethod HTTPSHealthCheck
  6935. raw := NoMethod(*s)
  6936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6937. }
  6938. // HealthCheck: An HealthCheck resource. This resource defines a
  6939. // template for how individual virtual machines should be checked for
  6940. // health, via one of the supported protocols.
  6941. type HealthCheck struct {
  6942. // CheckIntervalSec: How often (in seconds) to send a health check. The
  6943. // default value is 5 seconds.
  6944. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  6945. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  6946. // format.
  6947. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6948. // Description: An optional description of this resource. Provide this
  6949. // property when you create the resource.
  6950. Description string `json:"description,omitempty"`
  6951. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  6952. // after this many consecutive successes. The default value is 2.
  6953. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  6954. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  6955. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  6956. // Id: [Output Only] The unique identifier for the resource. This
  6957. // identifier is defined by the server.
  6958. Id uint64 `json:"id,omitempty,string"`
  6959. // Kind: Type of the resource.
  6960. Kind string `json:"kind,omitempty"`
  6961. // Name: Name of the resource. Provided by the client when the resource
  6962. // is created. The name must be 1-63 characters long, and comply with
  6963. // RFC1035. Specifically, the name must be 1-63 characters long and
  6964. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6965. // the first character must be a lowercase letter, and all following
  6966. // characters must be a dash, lowercase letter, or digit, except the
  6967. // last character, which cannot be a dash.
  6968. Name string `json:"name,omitempty"`
  6969. // SelfLink: [Output Only] Server-defined URL for the resource.
  6970. SelfLink string `json:"selfLink,omitempty"`
  6971. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  6972. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  6973. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  6974. // The default value is 5 seconds. It is invalid for timeoutSec to have
  6975. // greater value than checkIntervalSec.
  6976. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  6977. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  6978. // HTTPS. If not specified, the default is TCP. Exactly one of the
  6979. // protocol-specific health check field must be specified, which must
  6980. // match type field.
  6981. //
  6982. // Possible values:
  6983. // "HTTP"
  6984. // "HTTPS"
  6985. // "INVALID"
  6986. // "SSL"
  6987. // "TCP"
  6988. Type string `json:"type,omitempty"`
  6989. // UnhealthyThreshold: A so-far healthy instance will be marked
  6990. // unhealthy after this many consecutive failures. The default value is
  6991. // 2.
  6992. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  6993. // ServerResponse contains the HTTP response code and headers from the
  6994. // server.
  6995. googleapi.ServerResponse `json:"-"`
  6996. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  6997. // unconditionally include in API requests. By default, fields with
  6998. // empty values are omitted from API requests. However, any non-pointer,
  6999. // non-interface field appearing in ForceSendFields will be sent to the
  7000. // server regardless of whether the field is empty or not. This may be
  7001. // used to include empty fields in Patch requests.
  7002. ForceSendFields []string `json:"-"`
  7003. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7004. // include in API requests with the JSON null value. By default, fields
  7005. // with empty values are omitted from API requests. However, any field
  7006. // with an empty value appearing in NullFields will be sent to the
  7007. // server as null. It is an error if a field in this list has a
  7008. // non-empty value. This may be used to include null fields in Patch
  7009. // requests.
  7010. NullFields []string `json:"-"`
  7011. }
  7012. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  7013. type NoMethod HealthCheck
  7014. raw := NoMethod(*s)
  7015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7016. }
  7017. // HealthCheckList: Contains a list of HealthCheck resources.
  7018. type HealthCheckList struct {
  7019. // Id: [Output Only] Unique identifier for the resource; defined by the
  7020. // server.
  7021. Id string `json:"id,omitempty"`
  7022. // Items: A list of HealthCheck resources.
  7023. Items []*HealthCheck `json:"items,omitempty"`
  7024. // Kind: Type of resource.
  7025. Kind string `json:"kind,omitempty"`
  7026. // NextPageToken: [Output Only] This token allows you to get the next
  7027. // page of results for list requests. If the number of results is larger
  7028. // than maxResults, use the nextPageToken as a value for the query
  7029. // parameter pageToken in the next list request. Subsequent list
  7030. // requests will have their own nextPageToken to continue paging through
  7031. // the results.
  7032. NextPageToken string `json:"nextPageToken,omitempty"`
  7033. // SelfLink: [Output Only] Server-defined URL for this resource.
  7034. SelfLink string `json:"selfLink,omitempty"`
  7035. // Warning: [Output Only] Informational warning message.
  7036. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  7037. // ServerResponse contains the HTTP response code and headers from the
  7038. // server.
  7039. googleapi.ServerResponse `json:"-"`
  7040. // ForceSendFields is a list of field names (e.g. "Id") to
  7041. // unconditionally include in API requests. By default, fields with
  7042. // empty values are omitted from API requests. However, any non-pointer,
  7043. // non-interface field appearing in ForceSendFields will be sent to the
  7044. // server regardless of whether the field is empty or not. This may be
  7045. // used to include empty fields in Patch requests.
  7046. ForceSendFields []string `json:"-"`
  7047. // NullFields is a list of field names (e.g. "Id") to include in API
  7048. // requests with the JSON null value. By default, fields with empty
  7049. // values are omitted from API requests. However, any field with an
  7050. // empty value appearing in NullFields will be sent to the server as
  7051. // null. It is an error if a field in this list has a non-empty value.
  7052. // This may be used to include null fields in Patch requests.
  7053. NullFields []string `json:"-"`
  7054. }
  7055. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  7056. type NoMethod HealthCheckList
  7057. raw := NoMethod(*s)
  7058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7059. }
  7060. // HealthCheckListWarning: [Output Only] Informational warning message.
  7061. type HealthCheckListWarning struct {
  7062. // Code: [Output Only] A warning code, if applicable. For example,
  7063. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7064. // the response.
  7065. //
  7066. // Possible values:
  7067. // "CLEANUP_FAILED"
  7068. // "DEPRECATED_RESOURCE_USED"
  7069. // "DEPRECATED_TYPE_USED"
  7070. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7071. // "EXPERIMENTAL_TYPE_USED"
  7072. // "EXTERNAL_API_WARNING"
  7073. // "FIELD_VALUE_OVERRIDEN"
  7074. // "INJECTED_KERNELS_DEPRECATED"
  7075. // "MISSING_TYPE_DEPENDENCY"
  7076. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7077. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7078. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7079. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7080. // "NEXT_HOP_NOT_RUNNING"
  7081. // "NOT_CRITICAL_ERROR"
  7082. // "NO_RESULTS_ON_PAGE"
  7083. // "REQUIRED_TOS_AGREEMENT"
  7084. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7085. // "RESOURCE_NOT_DELETED"
  7086. // "SCHEMA_VALIDATION_IGNORED"
  7087. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7088. // "UNDECLARED_PROPERTIES"
  7089. // "UNREACHABLE"
  7090. Code string `json:"code,omitempty"`
  7091. // Data: [Output Only] Metadata about this warning in key: value format.
  7092. // For example:
  7093. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7094. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  7095. // Message: [Output Only] A human-readable description of the warning
  7096. // code.
  7097. Message string `json:"message,omitempty"`
  7098. // ForceSendFields is a list of field names (e.g. "Code") to
  7099. // unconditionally include in API requests. By default, fields with
  7100. // empty values are omitted from API requests. However, any non-pointer,
  7101. // non-interface field appearing in ForceSendFields will be sent to the
  7102. // server regardless of whether the field is empty or not. This may be
  7103. // used to include empty fields in Patch requests.
  7104. ForceSendFields []string `json:"-"`
  7105. // NullFields is a list of field names (e.g. "Code") to include in API
  7106. // requests with the JSON null value. By default, fields with empty
  7107. // values are omitted from API requests. However, any field with an
  7108. // empty value appearing in NullFields will be sent to the server as
  7109. // null. It is an error if a field in this list has a non-empty value.
  7110. // This may be used to include null fields in Patch requests.
  7111. NullFields []string `json:"-"`
  7112. }
  7113. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7114. type NoMethod HealthCheckListWarning
  7115. raw := NoMethod(*s)
  7116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7117. }
  7118. type HealthCheckListWarningData struct {
  7119. // Key: [Output Only] A key that provides more detail on the warning
  7120. // being returned. For example, for warnings where there are no results
  7121. // in a list request for a particular zone, this key might be scope and
  7122. // the key value might be the zone name. Other examples might be a key
  7123. // indicating a deprecated resource and a suggested replacement, or a
  7124. // warning about invalid network settings (for example, if an instance
  7125. // attempts to perform IP forwarding but is not enabled for IP
  7126. // forwarding).
  7127. Key string `json:"key,omitempty"`
  7128. // Value: [Output Only] A warning data value corresponding to the key.
  7129. Value string `json:"value,omitempty"`
  7130. // ForceSendFields is a list of field names (e.g. "Key") to
  7131. // unconditionally include in API requests. By default, fields with
  7132. // empty values are omitted from API requests. However, any non-pointer,
  7133. // non-interface field appearing in ForceSendFields will be sent to the
  7134. // server regardless of whether the field is empty or not. This may be
  7135. // used to include empty fields in Patch requests.
  7136. ForceSendFields []string `json:"-"`
  7137. // NullFields is a list of field names (e.g. "Key") to include in API
  7138. // requests with the JSON null value. By default, fields with empty
  7139. // values are omitted from API requests. However, any field with an
  7140. // empty value appearing in NullFields will be sent to the server as
  7141. // null. It is an error if a field in this list has a non-empty value.
  7142. // This may be used to include null fields in Patch requests.
  7143. NullFields []string `json:"-"`
  7144. }
  7145. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7146. type NoMethod HealthCheckListWarningData
  7147. raw := NoMethod(*s)
  7148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7149. }
  7150. // HealthCheckReference: A full or valid partial URL to a health check.
  7151. // For example, the following are valid URLs:
  7152. // -
  7153. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  7154. // - projects/project-id/global/httpHealthChecks/health-check
  7155. // - global/httpHealthChecks/health-check
  7156. type HealthCheckReference struct {
  7157. HealthCheck string `json:"healthCheck,omitempty"`
  7158. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  7159. // unconditionally include in API requests. By default, fields with
  7160. // empty values are omitted from API requests. However, any non-pointer,
  7161. // non-interface field appearing in ForceSendFields will be sent to the
  7162. // server regardless of whether the field is empty or not. This may be
  7163. // used to include empty fields in Patch requests.
  7164. ForceSendFields []string `json:"-"`
  7165. // NullFields is a list of field names (e.g. "HealthCheck") to include
  7166. // in API requests with the JSON null value. By default, fields with
  7167. // empty values are omitted from API requests. However, any field with
  7168. // an empty value appearing in NullFields will be sent to the server as
  7169. // null. It is an error if a field in this list has a non-empty value.
  7170. // This may be used to include null fields in Patch requests.
  7171. NullFields []string `json:"-"`
  7172. }
  7173. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  7174. type NoMethod HealthCheckReference
  7175. raw := NoMethod(*s)
  7176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7177. }
  7178. type HealthStatus struct {
  7179. // HealthState: Health state of the instance.
  7180. //
  7181. // Possible values:
  7182. // "HEALTHY"
  7183. // "UNHEALTHY"
  7184. HealthState string `json:"healthState,omitempty"`
  7185. // Instance: URL of the instance resource.
  7186. Instance string `json:"instance,omitempty"`
  7187. // IpAddress: The IP address represented by this resource.
  7188. IpAddress string `json:"ipAddress,omitempty"`
  7189. // Port: The port on the instance.
  7190. Port int64 `json:"port,omitempty"`
  7191. // ForceSendFields is a list of field names (e.g. "HealthState") to
  7192. // unconditionally include in API requests. By default, fields with
  7193. // empty values are omitted from API requests. However, any non-pointer,
  7194. // non-interface field appearing in ForceSendFields will be sent to the
  7195. // server regardless of whether the field is empty or not. This may be
  7196. // used to include empty fields in Patch requests.
  7197. ForceSendFields []string `json:"-"`
  7198. // NullFields is a list of field names (e.g. "HealthState") to include
  7199. // in API requests with the JSON null value. By default, fields with
  7200. // empty values are omitted from API requests. However, any field with
  7201. // an empty value appearing in NullFields will be sent to the server as
  7202. // null. It is an error if a field in this list has a non-empty value.
  7203. // This may be used to include null fields in Patch requests.
  7204. NullFields []string `json:"-"`
  7205. }
  7206. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  7207. type NoMethod HealthStatus
  7208. raw := NoMethod(*s)
  7209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7210. }
  7211. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  7212. // use the named PathMatcher to select the BackendService.
  7213. type HostRule struct {
  7214. // Description: An optional description of this resource. Provide this
  7215. // property when you create the resource.
  7216. Description string `json:"description,omitempty"`
  7217. // Hosts: The list of host patterns to match. They must be valid
  7218. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  7219. // case, * must be the first character and must be followed in the
  7220. // pattern by either - or ..
  7221. Hosts []string `json:"hosts,omitempty"`
  7222. // PathMatcher: The name of the PathMatcher to use to match the path
  7223. // portion of the URL if the hostRule matches the URL's host portion.
  7224. PathMatcher string `json:"pathMatcher,omitempty"`
  7225. // ForceSendFields is a list of field names (e.g. "Description") to
  7226. // unconditionally include in API requests. By default, fields with
  7227. // empty values are omitted from API requests. However, any non-pointer,
  7228. // non-interface field appearing in ForceSendFields will be sent to the
  7229. // server regardless of whether the field is empty or not. This may be
  7230. // used to include empty fields in Patch requests.
  7231. ForceSendFields []string `json:"-"`
  7232. // NullFields is a list of field names (e.g. "Description") to include
  7233. // in API requests with the JSON null value. By default, fields with
  7234. // empty values are omitted from API requests. However, any field with
  7235. // an empty value appearing in NullFields will be sent to the server as
  7236. // null. It is an error if a field in this list has a non-empty value.
  7237. // This may be used to include null fields in Patch requests.
  7238. NullFields []string `json:"-"`
  7239. }
  7240. func (s *HostRule) MarshalJSON() ([]byte, error) {
  7241. type NoMethod HostRule
  7242. raw := NoMethod(*s)
  7243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7244. }
  7245. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  7246. // template for how individual instances should be checked for health,
  7247. // via HTTP.
  7248. type HttpHealthCheck struct {
  7249. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7250. // default value is 5 seconds.
  7251. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7252. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7253. // format.
  7254. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7255. // Description: An optional description of this resource. Provide this
  7256. // property when you create the resource.
  7257. Description string `json:"description,omitempty"`
  7258. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7259. // after this many consecutive successes. The default value is 2.
  7260. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7261. // Host: The value of the host header in the HTTP health check request.
  7262. // If left empty (default value), the public IP on behalf of which this
  7263. // health check is performed will be used.
  7264. Host string `json:"host,omitempty"`
  7265. // Id: [Output Only] The unique identifier for the resource. This
  7266. // identifier is defined by the server.
  7267. Id uint64 `json:"id,omitempty,string"`
  7268. // Kind: [Output Only] Type of the resource. Always
  7269. // compute#httpHealthCheck for HTTP health checks.
  7270. Kind string `json:"kind,omitempty"`
  7271. // Name: Name of the resource. Provided by the client when the resource
  7272. // is created. The name must be 1-63 characters long, and comply with
  7273. // RFC1035. Specifically, the name must be 1-63 characters long and
  7274. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7275. // the first character must be a lowercase letter, and all following
  7276. // characters must be a dash, lowercase letter, or digit, except the
  7277. // last character, which cannot be a dash.
  7278. Name string `json:"name,omitempty"`
  7279. // Port: The TCP port number for the HTTP health check request. The
  7280. // default value is 80.
  7281. Port int64 `json:"port,omitempty"`
  7282. // RequestPath: The request path of the HTTP health check request. The
  7283. // default value is /.
  7284. RequestPath string `json:"requestPath,omitempty"`
  7285. // SelfLink: [Output Only] Server-defined URL for the resource.
  7286. SelfLink string `json:"selfLink,omitempty"`
  7287. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7288. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7289. // greater value than checkIntervalSec.
  7290. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7291. // UnhealthyThreshold: A so-far healthy instance will be marked
  7292. // unhealthy after this many consecutive failures. The default value is
  7293. // 2.
  7294. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7295. // ServerResponse contains the HTTP response code and headers from the
  7296. // server.
  7297. googleapi.ServerResponse `json:"-"`
  7298. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7299. // unconditionally include in API requests. By default, fields with
  7300. // empty values are omitted from API requests. However, any non-pointer,
  7301. // non-interface field appearing in ForceSendFields will be sent to the
  7302. // server regardless of whether the field is empty or not. This may be
  7303. // used to include empty fields in Patch requests.
  7304. ForceSendFields []string `json:"-"`
  7305. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7306. // include in API requests with the JSON null value. By default, fields
  7307. // with empty values are omitted from API requests. However, any field
  7308. // with an empty value appearing in NullFields will be sent to the
  7309. // server as null. It is an error if a field in this list has a
  7310. // non-empty value. This may be used to include null fields in Patch
  7311. // requests.
  7312. NullFields []string `json:"-"`
  7313. }
  7314. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  7315. type NoMethod HttpHealthCheck
  7316. raw := NoMethod(*s)
  7317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7318. }
  7319. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  7320. type HttpHealthCheckList struct {
  7321. // Id: [Output Only] Unique identifier for the resource; defined by the
  7322. // server.
  7323. Id string `json:"id,omitempty"`
  7324. // Items: A list of HttpHealthCheck resources.
  7325. Items []*HttpHealthCheck `json:"items,omitempty"`
  7326. // Kind: Type of resource.
  7327. Kind string `json:"kind,omitempty"`
  7328. // NextPageToken: [Output Only] This token allows you to get the next
  7329. // page of results for list requests. If the number of results is larger
  7330. // than maxResults, use the nextPageToken as a value for the query
  7331. // parameter pageToken in the next list request. Subsequent list
  7332. // requests will have their own nextPageToken to continue paging through
  7333. // the results.
  7334. NextPageToken string `json:"nextPageToken,omitempty"`
  7335. // SelfLink: [Output Only] Server-defined URL for this resource.
  7336. SelfLink string `json:"selfLink,omitempty"`
  7337. // Warning: [Output Only] Informational warning message.
  7338. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  7339. // ServerResponse contains the HTTP response code and headers from the
  7340. // server.
  7341. googleapi.ServerResponse `json:"-"`
  7342. // ForceSendFields is a list of field names (e.g. "Id") to
  7343. // unconditionally include in API requests. By default, fields with
  7344. // empty values are omitted from API requests. However, any non-pointer,
  7345. // non-interface field appearing in ForceSendFields will be sent to the
  7346. // server regardless of whether the field is empty or not. This may be
  7347. // used to include empty fields in Patch requests.
  7348. ForceSendFields []string `json:"-"`
  7349. // NullFields is a list of field names (e.g. "Id") to include in API
  7350. // requests with the JSON null value. By default, fields with empty
  7351. // values are omitted from API requests. However, any field with an
  7352. // empty value appearing in NullFields will be sent to the server as
  7353. // null. It is an error if a field in this list has a non-empty value.
  7354. // This may be used to include null fields in Patch requests.
  7355. NullFields []string `json:"-"`
  7356. }
  7357. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  7358. type NoMethod HttpHealthCheckList
  7359. raw := NoMethod(*s)
  7360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7361. }
  7362. // HttpHealthCheckListWarning: [Output Only] Informational warning
  7363. // message.
  7364. type HttpHealthCheckListWarning struct {
  7365. // Code: [Output Only] A warning code, if applicable. For example,
  7366. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7367. // the response.
  7368. //
  7369. // Possible values:
  7370. // "CLEANUP_FAILED"
  7371. // "DEPRECATED_RESOURCE_USED"
  7372. // "DEPRECATED_TYPE_USED"
  7373. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7374. // "EXPERIMENTAL_TYPE_USED"
  7375. // "EXTERNAL_API_WARNING"
  7376. // "FIELD_VALUE_OVERRIDEN"
  7377. // "INJECTED_KERNELS_DEPRECATED"
  7378. // "MISSING_TYPE_DEPENDENCY"
  7379. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7380. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7381. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7382. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7383. // "NEXT_HOP_NOT_RUNNING"
  7384. // "NOT_CRITICAL_ERROR"
  7385. // "NO_RESULTS_ON_PAGE"
  7386. // "REQUIRED_TOS_AGREEMENT"
  7387. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7388. // "RESOURCE_NOT_DELETED"
  7389. // "SCHEMA_VALIDATION_IGNORED"
  7390. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7391. // "UNDECLARED_PROPERTIES"
  7392. // "UNREACHABLE"
  7393. Code string `json:"code,omitempty"`
  7394. // Data: [Output Only] Metadata about this warning in key: value format.
  7395. // For example:
  7396. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7397. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  7398. // Message: [Output Only] A human-readable description of the warning
  7399. // code.
  7400. Message string `json:"message,omitempty"`
  7401. // ForceSendFields is a list of field names (e.g. "Code") to
  7402. // unconditionally include in API requests. By default, fields with
  7403. // empty values are omitted from API requests. However, any non-pointer,
  7404. // non-interface field appearing in ForceSendFields will be sent to the
  7405. // server regardless of whether the field is empty or not. This may be
  7406. // used to include empty fields in Patch requests.
  7407. ForceSendFields []string `json:"-"`
  7408. // NullFields is a list of field names (e.g. "Code") to include in API
  7409. // requests with the JSON null value. By default, fields with empty
  7410. // values are omitted from API requests. However, any field with an
  7411. // empty value appearing in NullFields will be sent to the server as
  7412. // null. It is an error if a field in this list has a non-empty value.
  7413. // This may be used to include null fields in Patch requests.
  7414. NullFields []string `json:"-"`
  7415. }
  7416. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7417. type NoMethod HttpHealthCheckListWarning
  7418. raw := NoMethod(*s)
  7419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7420. }
  7421. type HttpHealthCheckListWarningData struct {
  7422. // Key: [Output Only] A key that provides more detail on the warning
  7423. // being returned. For example, for warnings where there are no results
  7424. // in a list request for a particular zone, this key might be scope and
  7425. // the key value might be the zone name. Other examples might be a key
  7426. // indicating a deprecated resource and a suggested replacement, or a
  7427. // warning about invalid network settings (for example, if an instance
  7428. // attempts to perform IP forwarding but is not enabled for IP
  7429. // forwarding).
  7430. Key string `json:"key,omitempty"`
  7431. // Value: [Output Only] A warning data value corresponding to the key.
  7432. Value string `json:"value,omitempty"`
  7433. // ForceSendFields is a list of field names (e.g. "Key") to
  7434. // unconditionally include in API requests. By default, fields with
  7435. // empty values are omitted from API requests. However, any non-pointer,
  7436. // non-interface field appearing in ForceSendFields will be sent to the
  7437. // server regardless of whether the field is empty or not. This may be
  7438. // used to include empty fields in Patch requests.
  7439. ForceSendFields []string `json:"-"`
  7440. // NullFields is a list of field names (e.g. "Key") to include in API
  7441. // requests with the JSON null value. By default, fields with empty
  7442. // values are omitted from API requests. However, any field with an
  7443. // empty value appearing in NullFields will be sent to the server as
  7444. // null. It is an error if a field in this list has a non-empty value.
  7445. // This may be used to include null fields in Patch requests.
  7446. NullFields []string `json:"-"`
  7447. }
  7448. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7449. type NoMethod HttpHealthCheckListWarningData
  7450. raw := NoMethod(*s)
  7451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7452. }
  7453. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  7454. // a template for how individual instances should be checked for health,
  7455. // via HTTPS.
  7456. type HttpsHealthCheck struct {
  7457. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7458. // default value is 5 seconds.
  7459. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7460. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7461. // format.
  7462. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7463. // Description: An optional description of this resource. Provide this
  7464. // property when you create the resource.
  7465. Description string `json:"description,omitempty"`
  7466. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7467. // after this many consecutive successes. The default value is 2.
  7468. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7469. // Host: The value of the host header in the HTTPS health check request.
  7470. // If left empty (default value), the public IP on behalf of which this
  7471. // health check is performed will be used.
  7472. Host string `json:"host,omitempty"`
  7473. // Id: [Output Only] The unique identifier for the resource. This
  7474. // identifier is defined by the server.
  7475. Id uint64 `json:"id,omitempty,string"`
  7476. // Kind: Type of the resource.
  7477. Kind string `json:"kind,omitempty"`
  7478. // Name: Name of the resource. Provided by the client when the resource
  7479. // is created. The name must be 1-63 characters long, and comply with
  7480. // RFC1035. Specifically, the name must be 1-63 characters long and
  7481. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7482. // the first character must be a lowercase letter, and all following
  7483. // characters must be a dash, lowercase letter, or digit, except the
  7484. // last character, which cannot be a dash.
  7485. Name string `json:"name,omitempty"`
  7486. // Port: The TCP port number for the HTTPS health check request. The
  7487. // default value is 443.
  7488. Port int64 `json:"port,omitempty"`
  7489. // RequestPath: The request path of the HTTPS health check request. The
  7490. // default value is "/".
  7491. RequestPath string `json:"requestPath,omitempty"`
  7492. // SelfLink: [Output Only] Server-defined URL for the resource.
  7493. SelfLink string `json:"selfLink,omitempty"`
  7494. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7495. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7496. // a greater value than checkIntervalSec.
  7497. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7498. // UnhealthyThreshold: A so-far healthy instance will be marked
  7499. // unhealthy after this many consecutive failures. The default value is
  7500. // 2.
  7501. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7502. // ServerResponse contains the HTTP response code and headers from the
  7503. // server.
  7504. googleapi.ServerResponse `json:"-"`
  7505. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7506. // unconditionally include in API requests. By default, fields with
  7507. // empty values are omitted from API requests. However, any non-pointer,
  7508. // non-interface field appearing in ForceSendFields will be sent to the
  7509. // server regardless of whether the field is empty or not. This may be
  7510. // used to include empty fields in Patch requests.
  7511. ForceSendFields []string `json:"-"`
  7512. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7513. // include in API requests with the JSON null value. By default, fields
  7514. // with empty values are omitted from API requests. However, any field
  7515. // with an empty value appearing in NullFields will be sent to the
  7516. // server as null. It is an error if a field in this list has a
  7517. // non-empty value. This may be used to include null fields in Patch
  7518. // requests.
  7519. NullFields []string `json:"-"`
  7520. }
  7521. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  7522. type NoMethod HttpsHealthCheck
  7523. raw := NoMethod(*s)
  7524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7525. }
  7526. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  7527. type HttpsHealthCheckList struct {
  7528. // Id: [Output Only] Unique identifier for the resource; defined by the
  7529. // server.
  7530. Id string `json:"id,omitempty"`
  7531. // Items: A list of HttpsHealthCheck resources.
  7532. Items []*HttpsHealthCheck `json:"items,omitempty"`
  7533. // Kind: Type of resource.
  7534. Kind string `json:"kind,omitempty"`
  7535. // NextPageToken: [Output Only] This token allows you to get the next
  7536. // page of results for list requests. If the number of results is larger
  7537. // than maxResults, use the nextPageToken as a value for the query
  7538. // parameter pageToken in the next list request. Subsequent list
  7539. // requests will have their own nextPageToken to continue paging through
  7540. // the results.
  7541. NextPageToken string `json:"nextPageToken,omitempty"`
  7542. // SelfLink: [Output Only] Server-defined URL for this resource.
  7543. SelfLink string `json:"selfLink,omitempty"`
  7544. // Warning: [Output Only] Informational warning message.
  7545. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  7546. // ServerResponse contains the HTTP response code and headers from the
  7547. // server.
  7548. googleapi.ServerResponse `json:"-"`
  7549. // ForceSendFields is a list of field names (e.g. "Id") to
  7550. // unconditionally include in API requests. By default, fields with
  7551. // empty values are omitted from API requests. However, any non-pointer,
  7552. // non-interface field appearing in ForceSendFields will be sent to the
  7553. // server regardless of whether the field is empty or not. This may be
  7554. // used to include empty fields in Patch requests.
  7555. ForceSendFields []string `json:"-"`
  7556. // NullFields is a list of field names (e.g. "Id") to include in API
  7557. // requests with the JSON null value. By default, fields with empty
  7558. // values are omitted from API requests. However, any field with an
  7559. // empty value appearing in NullFields will be sent to the server as
  7560. // null. It is an error if a field in this list has a non-empty value.
  7561. // This may be used to include null fields in Patch requests.
  7562. NullFields []string `json:"-"`
  7563. }
  7564. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  7565. type NoMethod HttpsHealthCheckList
  7566. raw := NoMethod(*s)
  7567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7568. }
  7569. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  7570. // message.
  7571. type HttpsHealthCheckListWarning struct {
  7572. // Code: [Output Only] A warning code, if applicable. For example,
  7573. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7574. // the response.
  7575. //
  7576. // Possible values:
  7577. // "CLEANUP_FAILED"
  7578. // "DEPRECATED_RESOURCE_USED"
  7579. // "DEPRECATED_TYPE_USED"
  7580. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7581. // "EXPERIMENTAL_TYPE_USED"
  7582. // "EXTERNAL_API_WARNING"
  7583. // "FIELD_VALUE_OVERRIDEN"
  7584. // "INJECTED_KERNELS_DEPRECATED"
  7585. // "MISSING_TYPE_DEPENDENCY"
  7586. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7587. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7588. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7589. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7590. // "NEXT_HOP_NOT_RUNNING"
  7591. // "NOT_CRITICAL_ERROR"
  7592. // "NO_RESULTS_ON_PAGE"
  7593. // "REQUIRED_TOS_AGREEMENT"
  7594. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7595. // "RESOURCE_NOT_DELETED"
  7596. // "SCHEMA_VALIDATION_IGNORED"
  7597. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7598. // "UNDECLARED_PROPERTIES"
  7599. // "UNREACHABLE"
  7600. Code string `json:"code,omitempty"`
  7601. // Data: [Output Only] Metadata about this warning in key: value format.
  7602. // For example:
  7603. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7604. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  7605. // Message: [Output Only] A human-readable description of the warning
  7606. // code.
  7607. Message string `json:"message,omitempty"`
  7608. // ForceSendFields is a list of field names (e.g. "Code") to
  7609. // unconditionally include in API requests. By default, fields with
  7610. // empty values are omitted from API requests. However, any non-pointer,
  7611. // non-interface field appearing in ForceSendFields will be sent to the
  7612. // server regardless of whether the field is empty or not. This may be
  7613. // used to include empty fields in Patch requests.
  7614. ForceSendFields []string `json:"-"`
  7615. // NullFields is a list of field names (e.g. "Code") to include in API
  7616. // requests with the JSON null value. By default, fields with empty
  7617. // values are omitted from API requests. However, any field with an
  7618. // empty value appearing in NullFields will be sent to the server as
  7619. // null. It is an error if a field in this list has a non-empty value.
  7620. // This may be used to include null fields in Patch requests.
  7621. NullFields []string `json:"-"`
  7622. }
  7623. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7624. type NoMethod HttpsHealthCheckListWarning
  7625. raw := NoMethod(*s)
  7626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7627. }
  7628. type HttpsHealthCheckListWarningData struct {
  7629. // Key: [Output Only] A key that provides more detail on the warning
  7630. // being returned. For example, for warnings where there are no results
  7631. // in a list request for a particular zone, this key might be scope and
  7632. // the key value might be the zone name. Other examples might be a key
  7633. // indicating a deprecated resource and a suggested replacement, or a
  7634. // warning about invalid network settings (for example, if an instance
  7635. // attempts to perform IP forwarding but is not enabled for IP
  7636. // forwarding).
  7637. Key string `json:"key,omitempty"`
  7638. // Value: [Output Only] A warning data value corresponding to the key.
  7639. Value string `json:"value,omitempty"`
  7640. // ForceSendFields is a list of field names (e.g. "Key") to
  7641. // unconditionally include in API requests. By default, fields with
  7642. // empty values are omitted from API requests. However, any non-pointer,
  7643. // non-interface field appearing in ForceSendFields will be sent to the
  7644. // server regardless of whether the field is empty or not. This may be
  7645. // used to include empty fields in Patch requests.
  7646. ForceSendFields []string `json:"-"`
  7647. // NullFields is a list of field names (e.g. "Key") to include in API
  7648. // requests with the JSON null value. By default, fields with empty
  7649. // values are omitted from API requests. However, any field with an
  7650. // empty value appearing in NullFields will be sent to the server as
  7651. // null. It is an error if a field in this list has a non-empty value.
  7652. // This may be used to include null fields in Patch requests.
  7653. NullFields []string `json:"-"`
  7654. }
  7655. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7656. type NoMethod HttpsHealthCheckListWarningData
  7657. raw := NoMethod(*s)
  7658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7659. }
  7660. // Image: An Image resource. (== resource_for beta.images ==) (==
  7661. // resource_for v1.images ==)
  7662. type Image struct {
  7663. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  7664. // Cloud Storage (in bytes).
  7665. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  7666. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7667. // format.
  7668. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7669. // Deprecated: The deprecation status associated with this image.
  7670. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7671. // Description: An optional description of this resource. Provide this
  7672. // property when you create the resource.
  7673. Description string `json:"description,omitempty"`
  7674. // DiskSizeGb: Size of the image when restored onto a persistent disk
  7675. // (in GB).
  7676. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  7677. // Family: The name of the image family to which this image belongs. You
  7678. // can create disks by specifying an image family instead of a specific
  7679. // image name. The image family always returns its latest image that is
  7680. // not deprecated. The name of the image family must comply with
  7681. // RFC1035.
  7682. Family string `json:"family,omitempty"`
  7683. // GuestOsFeatures: A list of features to enable on the guest operating
  7684. // system. Applicable only for bootable images. Read Enabling guest
  7685. // operating system features to see a list of available options.
  7686. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  7687. // Id: [Output Only] The unique identifier for the resource. This
  7688. // identifier is defined by the server.
  7689. Id uint64 `json:"id,omitempty,string"`
  7690. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  7691. // encryption key.
  7692. //
  7693. // After you encrypt an image with a customer-supplied key, you must
  7694. // provide the same key if you use the image later (e.g. to create a
  7695. // disk from the image).
  7696. //
  7697. // Customer-supplied encryption keys do not protect access to metadata
  7698. // of the disk.
  7699. //
  7700. // If you do not provide an encryption key when creating the image, then
  7701. // the disk will be encrypted using an automatically generated key and
  7702. // you do not need to provide a key to use the image later.
  7703. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  7704. // Kind: [Output Only] Type of the resource. Always compute#image for
  7705. // images.
  7706. Kind string `json:"kind,omitempty"`
  7707. // LabelFingerprint: A fingerprint for the labels being applied to this
  7708. // image, which is essentially a hash of the labels used for optimistic
  7709. // locking. The fingerprint is initially generated by Compute Engine and
  7710. // changes after every request to modify or update labels. You must
  7711. // always provide an up-to-date fingerprint hash in order to update or
  7712. // change labels, otherwise the request will fail with error 412
  7713. // conditionNotMet.
  7714. //
  7715. // To see the latest fingerprint, make a get() request to retrieve an
  7716. // image.
  7717. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7718. // Labels: Labels to apply to this image. These can be later modified by
  7719. // the setLabels method.
  7720. Labels map[string]string `json:"labels,omitempty"`
  7721. // LicenseCodes: Integer license codes indicating which licenses are
  7722. // attached to this image.
  7723. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  7724. // Licenses: Any applicable license URI.
  7725. Licenses []string `json:"licenses,omitempty"`
  7726. // Name: Name of the resource; provided by the client when the resource
  7727. // is created. The name must be 1-63 characters long, and comply with
  7728. // RFC1035. Specifically, the name must be 1-63 characters long and
  7729. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7730. // the first character must be a lowercase letter, and all following
  7731. // characters must be a dash, lowercase letter, or digit, except the
  7732. // last character, which cannot be a dash.
  7733. Name string `json:"name,omitempty"`
  7734. // RawDisk: The parameters of the raw disk image.
  7735. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  7736. // SelfLink: [Output Only] Server-defined URL for the resource.
  7737. SelfLink string `json:"selfLink,omitempty"`
  7738. // SourceDisk: URL of the source disk used to create this image. This
  7739. // can be a full or valid partial URL. You must provide either this
  7740. // property or the rawDisk.source property but not both to create an
  7741. // image. For example, the following are valid values:
  7742. // -
  7743. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  7744. // - projects/project/zones/zone/disks/disk
  7745. // - zones/zone/disks/disk
  7746. SourceDisk string `json:"sourceDisk,omitempty"`
  7747. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  7748. // source disk. Required if the source disk is protected by a
  7749. // customer-supplied encryption key.
  7750. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  7751. // SourceDiskId: [Output Only] The ID value of the disk used to create
  7752. // this image. This value may be used to determine whether the image was
  7753. // taken from the current or a previous instance of a given disk name.
  7754. SourceDiskId string `json:"sourceDiskId,omitempty"`
  7755. // SourceImage: URL of the source image used to create this image. This
  7756. // can be a full or valid partial URL. You must provide exactly one of:
  7757. //
  7758. // - this property, or
  7759. // - the rawDisk.source property, or
  7760. // - the sourceDisk property in order to create an image.
  7761. SourceImage string `json:"sourceImage,omitempty"`
  7762. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  7763. // source image. Required if the source image is protected by a
  7764. // customer-supplied encryption key.
  7765. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  7766. // SourceImageId: [Output Only] The ID value of the image used to create
  7767. // this image. This value may be used to determine whether the image was
  7768. // taken from the current or a previous instance of a given image name.
  7769. SourceImageId string `json:"sourceImageId,omitempty"`
  7770. // SourceSnapshot: URL of the source snapshot used to create this image.
  7771. // This can be a full or valid partial URL. You must provide exactly one
  7772. // of:
  7773. // - this property, or
  7774. // - the sourceImage property, or
  7775. // - the rawDisk.source property, or
  7776. // - the sourceDisk property in order to create an image.
  7777. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  7778. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  7779. // the source snapshot. Required if the source snapshot is protected by
  7780. // a customer-supplied encryption key.
  7781. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  7782. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  7783. // create this image. This value may be used to determine whether the
  7784. // snapshot was taken from the current or a previous instance of a given
  7785. // snapshot name.
  7786. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  7787. // SourceType: The type of the image used to create this disk. The
  7788. // default and only value is RAW
  7789. //
  7790. // Possible values:
  7791. // "RAW" (default)
  7792. SourceType string `json:"sourceType,omitempty"`
  7793. // Status: [Output Only] The status of the image. An image can be used
  7794. // to create other resources, such as instances, only after the image
  7795. // has been successfully created and the status is set to READY.
  7796. // Possible values are FAILED, PENDING, or READY.
  7797. //
  7798. // Possible values:
  7799. // "FAILED"
  7800. // "PENDING"
  7801. // "READY"
  7802. Status string `json:"status,omitempty"`
  7803. // ServerResponse contains the HTTP response code and headers from the
  7804. // server.
  7805. googleapi.ServerResponse `json:"-"`
  7806. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  7807. // unconditionally include in API requests. By default, fields with
  7808. // empty values are omitted from API requests. However, any non-pointer,
  7809. // non-interface field appearing in ForceSendFields will be sent to the
  7810. // server regardless of whether the field is empty or not. This may be
  7811. // used to include empty fields in Patch requests.
  7812. ForceSendFields []string `json:"-"`
  7813. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  7814. // include in API requests with the JSON null value. By default, fields
  7815. // with empty values are omitted from API requests. However, any field
  7816. // with an empty value appearing in NullFields will be sent to the
  7817. // server as null. It is an error if a field in this list has a
  7818. // non-empty value. This may be used to include null fields in Patch
  7819. // requests.
  7820. NullFields []string `json:"-"`
  7821. }
  7822. func (s *Image) MarshalJSON() ([]byte, error) {
  7823. type NoMethod Image
  7824. raw := NoMethod(*s)
  7825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7826. }
  7827. // ImageRawDisk: The parameters of the raw disk image.
  7828. type ImageRawDisk struct {
  7829. // ContainerType: The format used to encode and transmit the block
  7830. // device, which should be TAR. This is just a container and
  7831. // transmission format and not a runtime format. Provided by the client
  7832. // when the disk image is created.
  7833. //
  7834. // Possible values:
  7835. // "TAR"
  7836. ContainerType string `json:"containerType,omitempty"`
  7837. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  7838. // unpackaging; provided by the client when the disk image is created.
  7839. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  7840. // Source: The full Google Cloud Storage URL where the disk image is
  7841. // stored. You must provide either this property or the sourceDisk
  7842. // property but not both.
  7843. Source string `json:"source,omitempty"`
  7844. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  7845. // unconditionally include in API requests. By default, fields with
  7846. // empty values are omitted from API requests. However, any non-pointer,
  7847. // non-interface field appearing in ForceSendFields will be sent to the
  7848. // server regardless of whether the field is empty or not. This may be
  7849. // used to include empty fields in Patch requests.
  7850. ForceSendFields []string `json:"-"`
  7851. // NullFields is a list of field names (e.g. "ContainerType") to include
  7852. // in API requests with the JSON null value. By default, fields with
  7853. // empty values are omitted from API requests. However, any field with
  7854. // an empty value appearing in NullFields will be sent to the server as
  7855. // null. It is an error if a field in this list has a non-empty value.
  7856. // This may be used to include null fields in Patch requests.
  7857. NullFields []string `json:"-"`
  7858. }
  7859. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  7860. type NoMethod ImageRawDisk
  7861. raw := NoMethod(*s)
  7862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7863. }
  7864. // ImageList: Contains a list of images.
  7865. type ImageList struct {
  7866. // Id: [Output Only] Unique identifier for the resource; defined by the
  7867. // server.
  7868. Id string `json:"id,omitempty"`
  7869. // Items: A list of Image resources.
  7870. Items []*Image `json:"items,omitempty"`
  7871. // Kind: Type of resource.
  7872. Kind string `json:"kind,omitempty"`
  7873. // NextPageToken: [Output Only] This token allows you to get the next
  7874. // page of results for list requests. If the number of results is larger
  7875. // than maxResults, use the nextPageToken as a value for the query
  7876. // parameter pageToken in the next list request. Subsequent list
  7877. // requests will have their own nextPageToken to continue paging through
  7878. // the results.
  7879. NextPageToken string `json:"nextPageToken,omitempty"`
  7880. // SelfLink: [Output Only] Server-defined URL for this resource.
  7881. SelfLink string `json:"selfLink,omitempty"`
  7882. // Warning: [Output Only] Informational warning message.
  7883. Warning *ImageListWarning `json:"warning,omitempty"`
  7884. // ServerResponse contains the HTTP response code and headers from the
  7885. // server.
  7886. googleapi.ServerResponse `json:"-"`
  7887. // ForceSendFields is a list of field names (e.g. "Id") to
  7888. // unconditionally include in API requests. By default, fields with
  7889. // empty values are omitted from API requests. However, any non-pointer,
  7890. // non-interface field appearing in ForceSendFields will be sent to the
  7891. // server regardless of whether the field is empty or not. This may be
  7892. // used to include empty fields in Patch requests.
  7893. ForceSendFields []string `json:"-"`
  7894. // NullFields is a list of field names (e.g. "Id") to include in API
  7895. // requests with the JSON null value. By default, fields with empty
  7896. // values are omitted from API requests. However, any field with an
  7897. // empty value appearing in NullFields will be sent to the server as
  7898. // null. It is an error if a field in this list has a non-empty value.
  7899. // This may be used to include null fields in Patch requests.
  7900. NullFields []string `json:"-"`
  7901. }
  7902. func (s *ImageList) MarshalJSON() ([]byte, error) {
  7903. type NoMethod ImageList
  7904. raw := NoMethod(*s)
  7905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7906. }
  7907. // ImageListWarning: [Output Only] Informational warning message.
  7908. type ImageListWarning struct {
  7909. // Code: [Output Only] A warning code, if applicable. For example,
  7910. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7911. // the response.
  7912. //
  7913. // Possible values:
  7914. // "CLEANUP_FAILED"
  7915. // "DEPRECATED_RESOURCE_USED"
  7916. // "DEPRECATED_TYPE_USED"
  7917. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7918. // "EXPERIMENTAL_TYPE_USED"
  7919. // "EXTERNAL_API_WARNING"
  7920. // "FIELD_VALUE_OVERRIDEN"
  7921. // "INJECTED_KERNELS_DEPRECATED"
  7922. // "MISSING_TYPE_DEPENDENCY"
  7923. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7924. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7925. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7926. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7927. // "NEXT_HOP_NOT_RUNNING"
  7928. // "NOT_CRITICAL_ERROR"
  7929. // "NO_RESULTS_ON_PAGE"
  7930. // "REQUIRED_TOS_AGREEMENT"
  7931. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7932. // "RESOURCE_NOT_DELETED"
  7933. // "SCHEMA_VALIDATION_IGNORED"
  7934. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7935. // "UNDECLARED_PROPERTIES"
  7936. // "UNREACHABLE"
  7937. Code string `json:"code,omitempty"`
  7938. // Data: [Output Only] Metadata about this warning in key: value format.
  7939. // For example:
  7940. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7941. Data []*ImageListWarningData `json:"data,omitempty"`
  7942. // Message: [Output Only] A human-readable description of the warning
  7943. // code.
  7944. Message string `json:"message,omitempty"`
  7945. // ForceSendFields is a list of field names (e.g. "Code") to
  7946. // unconditionally include in API requests. By default, fields with
  7947. // empty values are omitted from API requests. However, any non-pointer,
  7948. // non-interface field appearing in ForceSendFields will be sent to the
  7949. // server regardless of whether the field is empty or not. This may be
  7950. // used to include empty fields in Patch requests.
  7951. ForceSendFields []string `json:"-"`
  7952. // NullFields is a list of field names (e.g. "Code") to include in API
  7953. // requests with the JSON null value. By default, fields with empty
  7954. // values are omitted from API requests. However, any field with an
  7955. // empty value appearing in NullFields will be sent to the server as
  7956. // null. It is an error if a field in this list has a non-empty value.
  7957. // This may be used to include null fields in Patch requests.
  7958. NullFields []string `json:"-"`
  7959. }
  7960. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  7961. type NoMethod ImageListWarning
  7962. raw := NoMethod(*s)
  7963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7964. }
  7965. type ImageListWarningData struct {
  7966. // Key: [Output Only] A key that provides more detail on the warning
  7967. // being returned. For example, for warnings where there are no results
  7968. // in a list request for a particular zone, this key might be scope and
  7969. // the key value might be the zone name. Other examples might be a key
  7970. // indicating a deprecated resource and a suggested replacement, or a
  7971. // warning about invalid network settings (for example, if an instance
  7972. // attempts to perform IP forwarding but is not enabled for IP
  7973. // forwarding).
  7974. Key string `json:"key,omitempty"`
  7975. // Value: [Output Only] A warning data value corresponding to the key.
  7976. Value string `json:"value,omitempty"`
  7977. // ForceSendFields is a list of field names (e.g. "Key") to
  7978. // unconditionally include in API requests. By default, fields with
  7979. // empty values are omitted from API requests. However, any non-pointer,
  7980. // non-interface field appearing in ForceSendFields will be sent to the
  7981. // server regardless of whether the field is empty or not. This may be
  7982. // used to include empty fields in Patch requests.
  7983. ForceSendFields []string `json:"-"`
  7984. // NullFields is a list of field names (e.g. "Key") to include in API
  7985. // requests with the JSON null value. By default, fields with empty
  7986. // values are omitted from API requests. However, any field with an
  7987. // empty value appearing in NullFields will be sent to the server as
  7988. // null. It is an error if a field in this list has a non-empty value.
  7989. // This may be used to include null fields in Patch requests.
  7990. NullFields []string `json:"-"`
  7991. }
  7992. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  7993. type NoMethod ImageListWarningData
  7994. raw := NoMethod(*s)
  7995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7996. }
  7997. // Instance: An Instance resource. (== resource_for beta.instances ==)
  7998. // (== resource_for v1.instances ==)
  7999. type Instance struct {
  8000. // CanIpForward: Allows this instance to send and receive packets with
  8001. // non-matching destination or source IPs. This is required if you plan
  8002. // to use this instance to forward routes. For more information, see
  8003. // Enabling IP Forwarding.
  8004. CanIpForward bool `json:"canIpForward,omitempty"`
  8005. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  8006. CpuPlatform string `json:"cpuPlatform,omitempty"`
  8007. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8008. // format.
  8009. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8010. // DeletionProtection: Whether the resource should be protected against
  8011. // deletion.
  8012. DeletionProtection bool `json:"deletionProtection,omitempty"`
  8013. // Description: An optional description of this resource. Provide this
  8014. // property when you create the resource.
  8015. Description string `json:"description,omitempty"`
  8016. // Disks: Array of disks associated with this instance. Persistent disks
  8017. // must be created before you can assign them.
  8018. Disks []*AttachedDisk `json:"disks,omitempty"`
  8019. // GuestAccelerators: A list of the type and count of accelerator cards
  8020. // attached to the instance.
  8021. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  8022. // Id: [Output Only] The unique identifier for the resource. This
  8023. // identifier is defined by the server.
  8024. Id uint64 `json:"id,omitempty,string"`
  8025. // Kind: [Output Only] Type of the resource. Always compute#instance for
  8026. // instances.
  8027. Kind string `json:"kind,omitempty"`
  8028. // LabelFingerprint: A fingerprint for this request, which is
  8029. // essentially a hash of the label's contents and used for optimistic
  8030. // locking. The fingerprint is initially generated by Compute Engine and
  8031. // changes after every request to modify or update labels. You must
  8032. // always provide an up-to-date fingerprint hash in order to update or
  8033. // change labels.
  8034. //
  8035. // To see the latest fingerprint, make get() request to the instance.
  8036. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8037. // Labels: Labels to apply to this instance. These can be later modified
  8038. // by the setLabels method.
  8039. Labels map[string]string `json:"labels,omitempty"`
  8040. // MachineType: Full or partial URL of the machine type resource to use
  8041. // for this instance, in the format:
  8042. // zones/zone/machineTypes/machine-type. This is provided by the client
  8043. // when the instance is created. For example, the following is a valid
  8044. // partial url to a predefined machine
  8045. // type:
  8046. // zones/us-central1-f/machineTypes/n1-standard-1
  8047. //
  8048. //
  8049. // To create a custom machine type, provide a URL to a machine type in
  8050. // the following format, where CPUS is 1 or an even number up to 32 (2,
  8051. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  8052. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  8053. // 5 GB of memory is 5120
  8054. // MB):
  8055. // zones/zone/machineTypes/custom-CPUS-MEMORY
  8056. //
  8057. //
  8058. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  8059. //
  8060. // For a full list of restrictions, read the Specifications for custom
  8061. // machine types.
  8062. MachineType string `json:"machineType,omitempty"`
  8063. // Metadata: The metadata key/value pairs assigned to this instance.
  8064. // This includes custom metadata and predefined keys.
  8065. Metadata *Metadata `json:"metadata,omitempty"`
  8066. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  8067. // Applicable values are the friendly names of CPU platforms, such as
  8068. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  8069. // Bridge".
  8070. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  8071. // Name: The name of the resource, provided by the client when initially
  8072. // creating the resource. The resource name must be 1-63 characters
  8073. // long, and comply with RFC1035. Specifically, the name must be 1-63
  8074. // characters long and match the regular expression
  8075. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8076. // a lowercase letter, and all following characters must be a dash,
  8077. // lowercase letter, or digit, except the last character, which cannot
  8078. // be a dash.
  8079. Name string `json:"name,omitempty"`
  8080. // NetworkInterfaces: An array of network configurations for this
  8081. // instance. These specify how interfaces are configured to interact
  8082. // with other network services, such as connecting to the internet.
  8083. // Multiple interfaces are supported per instance.
  8084. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  8085. // Scheduling: Sets the scheduling options for this instance.
  8086. Scheduling *Scheduling `json:"scheduling,omitempty"`
  8087. // SelfLink: [Output Only] Server-defined URL for this resource.
  8088. SelfLink string `json:"selfLink,omitempty"`
  8089. // ServiceAccounts: A list of service accounts, with their specified
  8090. // scopes, authorized for this instance. Only one service account per VM
  8091. // instance is supported.
  8092. //
  8093. // Service accounts generate access tokens that can be accessed through
  8094. // the metadata server and used to authenticate applications on the
  8095. // instance. See Service Accounts for more information.
  8096. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  8097. // StartRestricted: [Output Only] Whether a VM has been restricted for
  8098. // start because Compute Engine has detected suspicious activity.
  8099. StartRestricted bool `json:"startRestricted,omitempty"`
  8100. // Status: [Output Only] The status of the instance. One of the
  8101. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  8102. // SUSPENDING, SUSPENDED, and TERMINATED.
  8103. //
  8104. // Possible values:
  8105. // "PROVISIONING"
  8106. // "RUNNING"
  8107. // "STAGING"
  8108. // "STOPPED"
  8109. // "STOPPING"
  8110. // "SUSPENDED"
  8111. // "SUSPENDING"
  8112. // "TERMINATED"
  8113. Status string `json:"status,omitempty"`
  8114. // StatusMessage: [Output Only] An optional, human-readable explanation
  8115. // of the status.
  8116. StatusMessage string `json:"statusMessage,omitempty"`
  8117. // Tags: Tags to apply to this instance. Tags are used to identify valid
  8118. // sources or targets for network firewalls and are specified by the
  8119. // client during instance creation. The tags can be later modified by
  8120. // the setTags method. Each tag within the list must comply with
  8121. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  8122. Tags *Tags `json:"tags,omitempty"`
  8123. // Zone: [Output Only] URL of the zone where the instance resides. You
  8124. // must specify this field as part of the HTTP request URL. It is not
  8125. // settable as a field in the request body.
  8126. Zone string `json:"zone,omitempty"`
  8127. // ServerResponse contains the HTTP response code and headers from the
  8128. // server.
  8129. googleapi.ServerResponse `json:"-"`
  8130. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  8131. // unconditionally include in API requests. By default, fields with
  8132. // empty values are omitted from API requests. However, any non-pointer,
  8133. // non-interface field appearing in ForceSendFields will be sent to the
  8134. // server regardless of whether the field is empty or not. This may be
  8135. // used to include empty fields in Patch requests.
  8136. ForceSendFields []string `json:"-"`
  8137. // NullFields is a list of field names (e.g. "CanIpForward") to include
  8138. // in API requests with the JSON null value. By default, fields with
  8139. // empty values are omitted from API requests. However, any field with
  8140. // an empty value appearing in NullFields will be sent to the server as
  8141. // null. It is an error if a field in this list has a non-empty value.
  8142. // This may be used to include null fields in Patch requests.
  8143. NullFields []string `json:"-"`
  8144. }
  8145. func (s *Instance) MarshalJSON() ([]byte, error) {
  8146. type NoMethod Instance
  8147. raw := NoMethod(*s)
  8148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8149. }
  8150. type InstanceAggregatedList struct {
  8151. // Id: [Output Only] Unique identifier for the resource; defined by the
  8152. // server.
  8153. Id string `json:"id,omitempty"`
  8154. // Items: A list of InstancesScopedList resources.
  8155. Items map[string]InstancesScopedList `json:"items,omitempty"`
  8156. // Kind: [Output Only] Type of resource. Always
  8157. // compute#instanceAggregatedList for aggregated lists of Instance
  8158. // resources.
  8159. Kind string `json:"kind,omitempty"`
  8160. // NextPageToken: [Output Only] This token allows you to get the next
  8161. // page of results for list requests. If the number of results is larger
  8162. // than maxResults, use the nextPageToken as a value for the query
  8163. // parameter pageToken in the next list request. Subsequent list
  8164. // requests will have their own nextPageToken to continue paging through
  8165. // the results.
  8166. NextPageToken string `json:"nextPageToken,omitempty"`
  8167. // SelfLink: [Output Only] Server-defined URL for this resource.
  8168. SelfLink string `json:"selfLink,omitempty"`
  8169. // Warning: [Output Only] Informational warning message.
  8170. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  8171. // ServerResponse contains the HTTP response code and headers from the
  8172. // server.
  8173. googleapi.ServerResponse `json:"-"`
  8174. // ForceSendFields is a list of field names (e.g. "Id") to
  8175. // unconditionally include in API requests. By default, fields with
  8176. // empty values are omitted from API requests. However, any non-pointer,
  8177. // non-interface field appearing in ForceSendFields will be sent to the
  8178. // server regardless of whether the field is empty or not. This may be
  8179. // used to include empty fields in Patch requests.
  8180. ForceSendFields []string `json:"-"`
  8181. // NullFields is a list of field names (e.g. "Id") to include in API
  8182. // requests with the JSON null value. By default, fields with empty
  8183. // values are omitted from API requests. However, any field with an
  8184. // empty value appearing in NullFields will be sent to the server as
  8185. // null. It is an error if a field in this list has a non-empty value.
  8186. // This may be used to include null fields in Patch requests.
  8187. NullFields []string `json:"-"`
  8188. }
  8189. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  8190. type NoMethod InstanceAggregatedList
  8191. raw := NoMethod(*s)
  8192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8193. }
  8194. // InstanceAggregatedListWarning: [Output Only] Informational warning
  8195. // message.
  8196. type InstanceAggregatedListWarning struct {
  8197. // Code: [Output Only] A warning code, if applicable. For example,
  8198. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8199. // the response.
  8200. //
  8201. // Possible values:
  8202. // "CLEANUP_FAILED"
  8203. // "DEPRECATED_RESOURCE_USED"
  8204. // "DEPRECATED_TYPE_USED"
  8205. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8206. // "EXPERIMENTAL_TYPE_USED"
  8207. // "EXTERNAL_API_WARNING"
  8208. // "FIELD_VALUE_OVERRIDEN"
  8209. // "INJECTED_KERNELS_DEPRECATED"
  8210. // "MISSING_TYPE_DEPENDENCY"
  8211. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8212. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8213. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8214. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8215. // "NEXT_HOP_NOT_RUNNING"
  8216. // "NOT_CRITICAL_ERROR"
  8217. // "NO_RESULTS_ON_PAGE"
  8218. // "REQUIRED_TOS_AGREEMENT"
  8219. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8220. // "RESOURCE_NOT_DELETED"
  8221. // "SCHEMA_VALIDATION_IGNORED"
  8222. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8223. // "UNDECLARED_PROPERTIES"
  8224. // "UNREACHABLE"
  8225. Code string `json:"code,omitempty"`
  8226. // Data: [Output Only] Metadata about this warning in key: value format.
  8227. // For example:
  8228. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8229. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  8230. // Message: [Output Only] A human-readable description of the warning
  8231. // code.
  8232. Message string `json:"message,omitempty"`
  8233. // ForceSendFields is a list of field names (e.g. "Code") to
  8234. // unconditionally include in API requests. By default, fields with
  8235. // empty values are omitted from API requests. However, any non-pointer,
  8236. // non-interface field appearing in ForceSendFields will be sent to the
  8237. // server regardless of whether the field is empty or not. This may be
  8238. // used to include empty fields in Patch requests.
  8239. ForceSendFields []string `json:"-"`
  8240. // NullFields is a list of field names (e.g. "Code") to include in API
  8241. // requests with the JSON null value. By default, fields with empty
  8242. // values are omitted from API requests. However, any field with an
  8243. // empty value appearing in NullFields will be sent to the server as
  8244. // null. It is an error if a field in this list has a non-empty value.
  8245. // This may be used to include null fields in Patch requests.
  8246. NullFields []string `json:"-"`
  8247. }
  8248. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8249. type NoMethod InstanceAggregatedListWarning
  8250. raw := NoMethod(*s)
  8251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8252. }
  8253. type InstanceAggregatedListWarningData struct {
  8254. // Key: [Output Only] A key that provides more detail on the warning
  8255. // being returned. For example, for warnings where there are no results
  8256. // in a list request for a particular zone, this key might be scope and
  8257. // the key value might be the zone name. Other examples might be a key
  8258. // indicating a deprecated resource and a suggested replacement, or a
  8259. // warning about invalid network settings (for example, if an instance
  8260. // attempts to perform IP forwarding but is not enabled for IP
  8261. // forwarding).
  8262. Key string `json:"key,omitempty"`
  8263. // Value: [Output Only] A warning data value corresponding to the key.
  8264. Value string `json:"value,omitempty"`
  8265. // ForceSendFields is a list of field names (e.g. "Key") to
  8266. // unconditionally include in API requests. By default, fields with
  8267. // empty values are omitted from API requests. However, any non-pointer,
  8268. // non-interface field appearing in ForceSendFields will be sent to the
  8269. // server regardless of whether the field is empty or not. This may be
  8270. // used to include empty fields in Patch requests.
  8271. ForceSendFields []string `json:"-"`
  8272. // NullFields is a list of field names (e.g. "Key") to include in API
  8273. // requests with the JSON null value. By default, fields with empty
  8274. // values are omitted from API requests. However, any field with an
  8275. // empty value appearing in NullFields will be sent to the server as
  8276. // null. It is an error if a field in this list has a non-empty value.
  8277. // This may be used to include null fields in Patch requests.
  8278. NullFields []string `json:"-"`
  8279. }
  8280. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8281. type NoMethod InstanceAggregatedListWarningData
  8282. raw := NoMethod(*s)
  8283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8284. }
  8285. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  8286. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  8287. // beta.regionInstanceGroups ==) (== resource_for
  8288. // v1.regionInstanceGroups ==)
  8289. type InstanceGroup struct {
  8290. // CreationTimestamp: [Output Only] The creation timestamp for this
  8291. // instance group in RFC3339 text format.
  8292. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8293. // Description: An optional description of this resource. Provide this
  8294. // property when you create the resource.
  8295. Description string `json:"description,omitempty"`
  8296. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  8297. // system uses this fingerprint to detect conflicts when multiple users
  8298. // change the named ports concurrently.
  8299. Fingerprint string `json:"fingerprint,omitempty"`
  8300. // Id: [Output Only] A unique identifier for this instance group,
  8301. // generated by the server.
  8302. Id uint64 `json:"id,omitempty,string"`
  8303. // Kind: [Output Only] The resource type, which is always
  8304. // compute#instanceGroup for instance groups.
  8305. Kind string `json:"kind,omitempty"`
  8306. // Name: The name of the instance group. The name must be 1-63
  8307. // characters long, and comply with RFC1035.
  8308. Name string `json:"name,omitempty"`
  8309. // NamedPorts: Assigns a name to a port number. For example: {name:
  8310. // "http", port: 80}
  8311. //
  8312. // This allows the system to reference ports by the assigned name
  8313. // instead of a port number. Named ports can also contain multiple
  8314. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  8315. // 8080}]
  8316. //
  8317. // Named ports apply to all instances in this instance group.
  8318. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8319. // Network: The URL of the network to which all instances in the
  8320. // instance group belong.
  8321. Network string `json:"network,omitempty"`
  8322. // Region: [Output Only] The URL of the region where the instance group
  8323. // is located (for regional resources).
  8324. Region string `json:"region,omitempty"`
  8325. // SelfLink: [Output Only] The URL for this instance group. The server
  8326. // generates this URL.
  8327. SelfLink string `json:"selfLink,omitempty"`
  8328. // Size: [Output Only] The total number of instances in the instance
  8329. // group.
  8330. Size int64 `json:"size,omitempty"`
  8331. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  8332. // instances in the instance group belong.
  8333. Subnetwork string `json:"subnetwork,omitempty"`
  8334. // Zone: [Output Only] The URL of the zone where the instance group is
  8335. // located (for zonal resources).
  8336. Zone string `json:"zone,omitempty"`
  8337. // ServerResponse contains the HTTP response code and headers from the
  8338. // server.
  8339. googleapi.ServerResponse `json:"-"`
  8340. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  8341. // to unconditionally include in API requests. By default, fields with
  8342. // empty values are omitted from API requests. However, any non-pointer,
  8343. // non-interface field appearing in ForceSendFields will be sent to the
  8344. // server regardless of whether the field is empty or not. This may be
  8345. // used to include empty fields in Patch requests.
  8346. ForceSendFields []string `json:"-"`
  8347. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  8348. // include in API requests with the JSON null value. By default, fields
  8349. // with empty values are omitted from API requests. However, any field
  8350. // with an empty value appearing in NullFields will be sent to the
  8351. // server as null. It is an error if a field in this list has a
  8352. // non-empty value. This may be used to include null fields in Patch
  8353. // requests.
  8354. NullFields []string `json:"-"`
  8355. }
  8356. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  8357. type NoMethod InstanceGroup
  8358. raw := NoMethod(*s)
  8359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8360. }
  8361. type InstanceGroupAggregatedList struct {
  8362. // Id: [Output Only] Unique identifier for the resource; defined by the
  8363. // server.
  8364. Id string `json:"id,omitempty"`
  8365. // Items: A list of InstanceGroupsScopedList resources.
  8366. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  8367. // Kind: [Output Only] The resource type, which is always
  8368. // compute#instanceGroupAggregatedList for aggregated lists of instance
  8369. // groups.
  8370. Kind string `json:"kind,omitempty"`
  8371. // NextPageToken: [Output Only] This token allows you to get the next
  8372. // page of results for list requests. If the number of results is larger
  8373. // than maxResults, use the nextPageToken as a value for the query
  8374. // parameter pageToken in the next list request. Subsequent list
  8375. // requests will have their own nextPageToken to continue paging through
  8376. // the results.
  8377. NextPageToken string `json:"nextPageToken,omitempty"`
  8378. // SelfLink: [Output Only] Server-defined URL for this resource.
  8379. SelfLink string `json:"selfLink,omitempty"`
  8380. // Warning: [Output Only] Informational warning message.
  8381. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  8382. // ServerResponse contains the HTTP response code and headers from the
  8383. // server.
  8384. googleapi.ServerResponse `json:"-"`
  8385. // ForceSendFields is a list of field names (e.g. "Id") to
  8386. // unconditionally include in API requests. By default, fields with
  8387. // empty values are omitted from API requests. However, any non-pointer,
  8388. // non-interface field appearing in ForceSendFields will be sent to the
  8389. // server regardless of whether the field is empty or not. This may be
  8390. // used to include empty fields in Patch requests.
  8391. ForceSendFields []string `json:"-"`
  8392. // NullFields is a list of field names (e.g. "Id") to include in API
  8393. // requests with the JSON null value. By default, fields with empty
  8394. // values are omitted from API requests. However, any field with an
  8395. // empty value appearing in NullFields will be sent to the server as
  8396. // null. It is an error if a field in this list has a non-empty value.
  8397. // This may be used to include null fields in Patch requests.
  8398. NullFields []string `json:"-"`
  8399. }
  8400. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  8401. type NoMethod InstanceGroupAggregatedList
  8402. raw := NoMethod(*s)
  8403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8404. }
  8405. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  8406. // warning message.
  8407. type InstanceGroupAggregatedListWarning struct {
  8408. // Code: [Output Only] A warning code, if applicable. For example,
  8409. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8410. // the response.
  8411. //
  8412. // Possible values:
  8413. // "CLEANUP_FAILED"
  8414. // "DEPRECATED_RESOURCE_USED"
  8415. // "DEPRECATED_TYPE_USED"
  8416. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8417. // "EXPERIMENTAL_TYPE_USED"
  8418. // "EXTERNAL_API_WARNING"
  8419. // "FIELD_VALUE_OVERRIDEN"
  8420. // "INJECTED_KERNELS_DEPRECATED"
  8421. // "MISSING_TYPE_DEPENDENCY"
  8422. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8423. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8424. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8425. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8426. // "NEXT_HOP_NOT_RUNNING"
  8427. // "NOT_CRITICAL_ERROR"
  8428. // "NO_RESULTS_ON_PAGE"
  8429. // "REQUIRED_TOS_AGREEMENT"
  8430. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8431. // "RESOURCE_NOT_DELETED"
  8432. // "SCHEMA_VALIDATION_IGNORED"
  8433. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8434. // "UNDECLARED_PROPERTIES"
  8435. // "UNREACHABLE"
  8436. Code string `json:"code,omitempty"`
  8437. // Data: [Output Only] Metadata about this warning in key: value format.
  8438. // For example:
  8439. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8440. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  8441. // Message: [Output Only] A human-readable description of the warning
  8442. // code.
  8443. Message string `json:"message,omitempty"`
  8444. // ForceSendFields is a list of field names (e.g. "Code") to
  8445. // unconditionally include in API requests. By default, fields with
  8446. // empty values are omitted from API requests. However, any non-pointer,
  8447. // non-interface field appearing in ForceSendFields will be sent to the
  8448. // server regardless of whether the field is empty or not. This may be
  8449. // used to include empty fields in Patch requests.
  8450. ForceSendFields []string `json:"-"`
  8451. // NullFields is a list of field names (e.g. "Code") to include in API
  8452. // requests with the JSON null value. By default, fields with empty
  8453. // values are omitted from API requests. However, any field with an
  8454. // empty value appearing in NullFields will be sent to the server as
  8455. // null. It is an error if a field in this list has a non-empty value.
  8456. // This may be used to include null fields in Patch requests.
  8457. NullFields []string `json:"-"`
  8458. }
  8459. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8460. type NoMethod InstanceGroupAggregatedListWarning
  8461. raw := NoMethod(*s)
  8462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8463. }
  8464. type InstanceGroupAggregatedListWarningData struct {
  8465. // Key: [Output Only] A key that provides more detail on the warning
  8466. // being returned. For example, for warnings where there are no results
  8467. // in a list request for a particular zone, this key might be scope and
  8468. // the key value might be the zone name. Other examples might be a key
  8469. // indicating a deprecated resource and a suggested replacement, or a
  8470. // warning about invalid network settings (for example, if an instance
  8471. // attempts to perform IP forwarding but is not enabled for IP
  8472. // forwarding).
  8473. Key string `json:"key,omitempty"`
  8474. // Value: [Output Only] A warning data value corresponding to the key.
  8475. Value string `json:"value,omitempty"`
  8476. // ForceSendFields is a list of field names (e.g. "Key") to
  8477. // unconditionally include in API requests. By default, fields with
  8478. // empty values are omitted from API requests. However, any non-pointer,
  8479. // non-interface field appearing in ForceSendFields will be sent to the
  8480. // server regardless of whether the field is empty or not. This may be
  8481. // used to include empty fields in Patch requests.
  8482. ForceSendFields []string `json:"-"`
  8483. // NullFields is a list of field names (e.g. "Key") to include in API
  8484. // requests with the JSON null value. By default, fields with empty
  8485. // values are omitted from API requests. However, any field with an
  8486. // empty value appearing in NullFields will be sent to the server as
  8487. // null. It is an error if a field in this list has a non-empty value.
  8488. // This may be used to include null fields in Patch requests.
  8489. NullFields []string `json:"-"`
  8490. }
  8491. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8492. type NoMethod InstanceGroupAggregatedListWarningData
  8493. raw := NoMethod(*s)
  8494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8495. }
  8496. // InstanceGroupList: A list of InstanceGroup resources.
  8497. type InstanceGroupList struct {
  8498. // Id: [Output Only] Unique identifier for the resource; defined by the
  8499. // server.
  8500. Id string `json:"id,omitempty"`
  8501. // Items: A list of InstanceGroup resources.
  8502. Items []*InstanceGroup `json:"items,omitempty"`
  8503. // Kind: [Output Only] The resource type, which is always
  8504. // compute#instanceGroupList for instance group lists.
  8505. Kind string `json:"kind,omitempty"`
  8506. // NextPageToken: [Output Only] This token allows you to get the next
  8507. // page of results for list requests. If the number of results is larger
  8508. // than maxResults, use the nextPageToken as a value for the query
  8509. // parameter pageToken in the next list request. Subsequent list
  8510. // requests will have their own nextPageToken to continue paging through
  8511. // the results.
  8512. NextPageToken string `json:"nextPageToken,omitempty"`
  8513. // SelfLink: [Output Only] Server-defined URL for this resource.
  8514. SelfLink string `json:"selfLink,omitempty"`
  8515. // Warning: [Output Only] Informational warning message.
  8516. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  8517. // ServerResponse contains the HTTP response code and headers from the
  8518. // server.
  8519. googleapi.ServerResponse `json:"-"`
  8520. // ForceSendFields is a list of field names (e.g. "Id") to
  8521. // unconditionally include in API requests. By default, fields with
  8522. // empty values are omitted from API requests. However, any non-pointer,
  8523. // non-interface field appearing in ForceSendFields will be sent to the
  8524. // server regardless of whether the field is empty or not. This may be
  8525. // used to include empty fields in Patch requests.
  8526. ForceSendFields []string `json:"-"`
  8527. // NullFields is a list of field names (e.g. "Id") to include in API
  8528. // requests with the JSON null value. By default, fields with empty
  8529. // values are omitted from API requests. However, any field with an
  8530. // empty value appearing in NullFields will be sent to the server as
  8531. // null. It is an error if a field in this list has a non-empty value.
  8532. // This may be used to include null fields in Patch requests.
  8533. NullFields []string `json:"-"`
  8534. }
  8535. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  8536. type NoMethod InstanceGroupList
  8537. raw := NoMethod(*s)
  8538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8539. }
  8540. // InstanceGroupListWarning: [Output Only] Informational warning
  8541. // message.
  8542. type InstanceGroupListWarning struct {
  8543. // Code: [Output Only] A warning code, if applicable. For example,
  8544. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8545. // the response.
  8546. //
  8547. // Possible values:
  8548. // "CLEANUP_FAILED"
  8549. // "DEPRECATED_RESOURCE_USED"
  8550. // "DEPRECATED_TYPE_USED"
  8551. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8552. // "EXPERIMENTAL_TYPE_USED"
  8553. // "EXTERNAL_API_WARNING"
  8554. // "FIELD_VALUE_OVERRIDEN"
  8555. // "INJECTED_KERNELS_DEPRECATED"
  8556. // "MISSING_TYPE_DEPENDENCY"
  8557. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8558. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8559. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8560. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8561. // "NEXT_HOP_NOT_RUNNING"
  8562. // "NOT_CRITICAL_ERROR"
  8563. // "NO_RESULTS_ON_PAGE"
  8564. // "REQUIRED_TOS_AGREEMENT"
  8565. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8566. // "RESOURCE_NOT_DELETED"
  8567. // "SCHEMA_VALIDATION_IGNORED"
  8568. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8569. // "UNDECLARED_PROPERTIES"
  8570. // "UNREACHABLE"
  8571. Code string `json:"code,omitempty"`
  8572. // Data: [Output Only] Metadata about this warning in key: value format.
  8573. // For example:
  8574. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8575. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  8576. // Message: [Output Only] A human-readable description of the warning
  8577. // code.
  8578. Message string `json:"message,omitempty"`
  8579. // ForceSendFields is a list of field names (e.g. "Code") to
  8580. // unconditionally include in API requests. By default, fields with
  8581. // empty values are omitted from API requests. However, any non-pointer,
  8582. // non-interface field appearing in ForceSendFields will be sent to the
  8583. // server regardless of whether the field is empty or not. This may be
  8584. // used to include empty fields in Patch requests.
  8585. ForceSendFields []string `json:"-"`
  8586. // NullFields is a list of field names (e.g. "Code") to include in API
  8587. // requests with the JSON null value. By default, fields with empty
  8588. // values are omitted from API requests. However, any field with an
  8589. // empty value appearing in NullFields will be sent to the server as
  8590. // null. It is an error if a field in this list has a non-empty value.
  8591. // This may be used to include null fields in Patch requests.
  8592. NullFields []string `json:"-"`
  8593. }
  8594. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  8595. type NoMethod InstanceGroupListWarning
  8596. raw := NoMethod(*s)
  8597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8598. }
  8599. type InstanceGroupListWarningData struct {
  8600. // Key: [Output Only] A key that provides more detail on the warning
  8601. // being returned. For example, for warnings where there are no results
  8602. // in a list request for a particular zone, this key might be scope and
  8603. // the key value might be the zone name. Other examples might be a key
  8604. // indicating a deprecated resource and a suggested replacement, or a
  8605. // warning about invalid network settings (for example, if an instance
  8606. // attempts to perform IP forwarding but is not enabled for IP
  8607. // forwarding).
  8608. Key string `json:"key,omitempty"`
  8609. // Value: [Output Only] A warning data value corresponding to the key.
  8610. Value string `json:"value,omitempty"`
  8611. // ForceSendFields is a list of field names (e.g. "Key") to
  8612. // unconditionally include in API requests. By default, fields with
  8613. // empty values are omitted from API requests. However, any non-pointer,
  8614. // non-interface field appearing in ForceSendFields will be sent to the
  8615. // server regardless of whether the field is empty or not. This may be
  8616. // used to include empty fields in Patch requests.
  8617. ForceSendFields []string `json:"-"`
  8618. // NullFields is a list of field names (e.g. "Key") to include in API
  8619. // requests with the JSON null value. By default, fields with empty
  8620. // values are omitted from API requests. However, any field with an
  8621. // empty value appearing in NullFields will be sent to the server as
  8622. // null. It is an error if a field in this list has a non-empty value.
  8623. // This may be used to include null fields in Patch requests.
  8624. NullFields []string `json:"-"`
  8625. }
  8626. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  8627. type NoMethod InstanceGroupListWarningData
  8628. raw := NoMethod(*s)
  8629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8630. }
  8631. // InstanceGroupManager: An Instance Group Manager resource. (==
  8632. // resource_for beta.instanceGroupManagers ==) (== resource_for
  8633. // v1.instanceGroupManagers ==) (== resource_for
  8634. // beta.regionInstanceGroupManagers ==) (== resource_for
  8635. // v1.regionInstanceGroupManagers ==)
  8636. type InstanceGroupManager struct {
  8637. // BaseInstanceName: The base instance name to use for instances in this
  8638. // group. The value must be 1-58 characters long. Instances are named by
  8639. // appending a hyphen and a random four-character string to the base
  8640. // instance name. The base instance name must comply with RFC1035.
  8641. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  8642. // CreationTimestamp: [Output Only] The creation timestamp for this
  8643. // managed instance group in RFC3339 text format.
  8644. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8645. // CurrentActions: [Output Only] The list of instance actions and the
  8646. // number of instances in this managed instance group that are scheduled
  8647. // for each of those actions.
  8648. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  8649. // Description: An optional description of this resource. Provide this
  8650. // property when you create the resource.
  8651. Description string `json:"description,omitempty"`
  8652. // DistributionPolicy: Policy specifying intended distribution of
  8653. // instances in regional managed instance group.
  8654. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  8655. // Fingerprint: Fingerprint of this resource. This field may be used in
  8656. // optimistic locking. It will be ignored when inserting an
  8657. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  8658. // order to update the InstanceGroupManager, otherwise the request will
  8659. // fail with error 412 conditionNotMet.
  8660. //
  8661. // To see the latest fingerprint, make a get() request to retrieve an
  8662. // InstanceGroupManager.
  8663. Fingerprint string `json:"fingerprint,omitempty"`
  8664. // Id: [Output Only] A unique identifier for this resource type. The
  8665. // server generates this identifier.
  8666. Id uint64 `json:"id,omitempty,string"`
  8667. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  8668. InstanceGroup string `json:"instanceGroup,omitempty"`
  8669. // InstanceTemplate: The URL of the instance template that is specified
  8670. // for this managed instance group. The group uses this template to
  8671. // create all new instances in the managed instance group.
  8672. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  8673. // Kind: [Output Only] The resource type, which is always
  8674. // compute#instanceGroupManager for managed instance groups.
  8675. Kind string `json:"kind,omitempty"`
  8676. // Name: The name of the managed instance group. The name must be 1-63
  8677. // characters long, and comply with RFC1035.
  8678. Name string `json:"name,omitempty"`
  8679. // NamedPorts: Named ports configured for the Instance Groups
  8680. // complementary to this Instance Group Manager.
  8681. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8682. // Region: [Output Only] The URL of the region where the managed
  8683. // instance group resides (for regional resources).
  8684. Region string `json:"region,omitempty"`
  8685. // SelfLink: [Output Only] The URL for this managed instance group. The
  8686. // server defines this URL.
  8687. SelfLink string `json:"selfLink,omitempty"`
  8688. // TargetPools: The URLs for all TargetPool resources to which instances
  8689. // in the instanceGroup field are added. The target pools automatically
  8690. // apply to all of the instances in the managed instance group.
  8691. TargetPools []string `json:"targetPools,omitempty"`
  8692. // TargetSize: The target number of running instances for this managed
  8693. // instance group. Deleting or abandoning instances reduces this number.
  8694. // Resizing the group changes this number.
  8695. TargetSize int64 `json:"targetSize,omitempty"`
  8696. // Zone: [Output Only] The URL of the zone where the managed instance
  8697. // group is located (for zonal resources).
  8698. Zone string `json:"zone,omitempty"`
  8699. // ServerResponse contains the HTTP response code and headers from the
  8700. // server.
  8701. googleapi.ServerResponse `json:"-"`
  8702. // ForceSendFields is a list of field names (e.g. "BaseInstanceName") to
  8703. // unconditionally include in API requests. By default, fields with
  8704. // empty values are omitted from API requests. However, any non-pointer,
  8705. // non-interface field appearing in ForceSendFields will be sent to the
  8706. // server regardless of whether the field is empty or not. This may be
  8707. // used to include empty fields in Patch requests.
  8708. ForceSendFields []string `json:"-"`
  8709. // NullFields is a list of field names (e.g. "BaseInstanceName") to
  8710. // include in API requests with the JSON null value. By default, fields
  8711. // with empty values are omitted from API requests. However, any field
  8712. // with an empty value appearing in NullFields will be sent to the
  8713. // server as null. It is an error if a field in this list has a
  8714. // non-empty value. This may be used to include null fields in Patch
  8715. // requests.
  8716. NullFields []string `json:"-"`
  8717. }
  8718. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  8719. type NoMethod InstanceGroupManager
  8720. raw := NoMethod(*s)
  8721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8722. }
  8723. type InstanceGroupManagerActionsSummary struct {
  8724. // Abandoning: [Output Only] The total number of instances in the
  8725. // managed instance group that are scheduled to be abandoned. Abandoning
  8726. // an instance removes it from the managed instance group without
  8727. // deleting it.
  8728. Abandoning int64 `json:"abandoning,omitempty"`
  8729. // Creating: [Output Only] The number of instances in the managed
  8730. // instance group that are scheduled to be created or are currently
  8731. // being created. If the group fails to create any of these instances,
  8732. // it tries again until it creates the instance successfully.
  8733. //
  8734. // If you have disabled creation retries, this field will not be
  8735. // populated; instead, the creatingWithoutRetries field will be
  8736. // populated.
  8737. Creating int64 `json:"creating,omitempty"`
  8738. // CreatingWithoutRetries: [Output Only] The number of instances that
  8739. // the managed instance group will attempt to create. The group attempts
  8740. // to create each instance only once. If the group fails to create any
  8741. // of these instances, it decreases the group's targetSize value
  8742. // accordingly.
  8743. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  8744. // Deleting: [Output Only] The number of instances in the managed
  8745. // instance group that are scheduled to be deleted or are currently
  8746. // being deleted.
  8747. Deleting int64 `json:"deleting,omitempty"`
  8748. // None: [Output Only] The number of instances in the managed instance
  8749. // group that are running and have no scheduled actions.
  8750. None int64 `json:"none,omitempty"`
  8751. // Recreating: [Output Only] The number of instances in the managed
  8752. // instance group that are scheduled to be recreated or are currently
  8753. // being being recreated. Recreating an instance deletes the existing
  8754. // root persistent disk and creates a new disk from the image that is
  8755. // defined in the instance template.
  8756. Recreating int64 `json:"recreating,omitempty"`
  8757. // Refreshing: [Output Only] The number of instances in the managed
  8758. // instance group that are being reconfigured with properties that do
  8759. // not require a restart or a recreate action. For example, setting or
  8760. // removing target pools for the instance.
  8761. Refreshing int64 `json:"refreshing,omitempty"`
  8762. // Restarting: [Output Only] The number of instances in the managed
  8763. // instance group that are scheduled to be restarted or are currently
  8764. // being restarted.
  8765. Restarting int64 `json:"restarting,omitempty"`
  8766. // Verifying: [Output Only] The number of instances in the managed
  8767. // instance group that are being verified. See the
  8768. // managedInstances[].currentAction property in the listManagedInstances
  8769. // method documentation.
  8770. Verifying int64 `json:"verifying,omitempty"`
  8771. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  8772. // unconditionally include in API requests. By default, fields with
  8773. // empty values are omitted from API requests. However, any non-pointer,
  8774. // non-interface field appearing in ForceSendFields will be sent to the
  8775. // server regardless of whether the field is empty or not. This may be
  8776. // used to include empty fields in Patch requests.
  8777. ForceSendFields []string `json:"-"`
  8778. // NullFields is a list of field names (e.g. "Abandoning") to include in
  8779. // API requests with the JSON null value. By default, fields with empty
  8780. // values are omitted from API requests. However, any field with an
  8781. // empty value appearing in NullFields will be sent to the server as
  8782. // null. It is an error if a field in this list has a non-empty value.
  8783. // This may be used to include null fields in Patch requests.
  8784. NullFields []string `json:"-"`
  8785. }
  8786. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  8787. type NoMethod InstanceGroupManagerActionsSummary
  8788. raw := NoMethod(*s)
  8789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8790. }
  8791. type InstanceGroupManagerAggregatedList struct {
  8792. // Id: [Output Only] Unique identifier for the resource; defined by the
  8793. // server.
  8794. Id string `json:"id,omitempty"`
  8795. // Items: A list of InstanceGroupManagersScopedList resources.
  8796. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  8797. // Kind: [Output Only] The resource type, which is always
  8798. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  8799. // managed instance groups.
  8800. Kind string `json:"kind,omitempty"`
  8801. // NextPageToken: [Output Only] This token allows you to get the next
  8802. // page of results for list requests. If the number of results is larger
  8803. // than maxResults, use the nextPageToken as a value for the query
  8804. // parameter pageToken in the next list request. Subsequent list
  8805. // requests will have their own nextPageToken to continue paging through
  8806. // the results.
  8807. NextPageToken string `json:"nextPageToken,omitempty"`
  8808. // SelfLink: [Output Only] Server-defined URL for this resource.
  8809. SelfLink string `json:"selfLink,omitempty"`
  8810. // Warning: [Output Only] Informational warning message.
  8811. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  8812. // ServerResponse contains the HTTP response code and headers from the
  8813. // server.
  8814. googleapi.ServerResponse `json:"-"`
  8815. // ForceSendFields is a list of field names (e.g. "Id") to
  8816. // unconditionally include in API requests. By default, fields with
  8817. // empty values are omitted from API requests. However, any non-pointer,
  8818. // non-interface field appearing in ForceSendFields will be sent to the
  8819. // server regardless of whether the field is empty or not. This may be
  8820. // used to include empty fields in Patch requests.
  8821. ForceSendFields []string `json:"-"`
  8822. // NullFields is a list of field names (e.g. "Id") to include in API
  8823. // requests with the JSON null value. By default, fields with empty
  8824. // values are omitted from API requests. However, any field with an
  8825. // empty value appearing in NullFields will be sent to the server as
  8826. // null. It is an error if a field in this list has a non-empty value.
  8827. // This may be used to include null fields in Patch requests.
  8828. NullFields []string `json:"-"`
  8829. }
  8830. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  8831. type NoMethod InstanceGroupManagerAggregatedList
  8832. raw := NoMethod(*s)
  8833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8834. }
  8835. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  8836. // Informational warning message.
  8837. type InstanceGroupManagerAggregatedListWarning struct {
  8838. // Code: [Output Only] A warning code, if applicable. For example,
  8839. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8840. // the response.
  8841. //
  8842. // Possible values:
  8843. // "CLEANUP_FAILED"
  8844. // "DEPRECATED_RESOURCE_USED"
  8845. // "DEPRECATED_TYPE_USED"
  8846. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8847. // "EXPERIMENTAL_TYPE_USED"
  8848. // "EXTERNAL_API_WARNING"
  8849. // "FIELD_VALUE_OVERRIDEN"
  8850. // "INJECTED_KERNELS_DEPRECATED"
  8851. // "MISSING_TYPE_DEPENDENCY"
  8852. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8853. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8854. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8855. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8856. // "NEXT_HOP_NOT_RUNNING"
  8857. // "NOT_CRITICAL_ERROR"
  8858. // "NO_RESULTS_ON_PAGE"
  8859. // "REQUIRED_TOS_AGREEMENT"
  8860. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8861. // "RESOURCE_NOT_DELETED"
  8862. // "SCHEMA_VALIDATION_IGNORED"
  8863. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8864. // "UNDECLARED_PROPERTIES"
  8865. // "UNREACHABLE"
  8866. Code string `json:"code,omitempty"`
  8867. // Data: [Output Only] Metadata about this warning in key: value format.
  8868. // For example:
  8869. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8870. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  8871. // Message: [Output Only] A human-readable description of the warning
  8872. // code.
  8873. Message string `json:"message,omitempty"`
  8874. // ForceSendFields is a list of field names (e.g. "Code") to
  8875. // unconditionally include in API requests. By default, fields with
  8876. // empty values are omitted from API requests. However, any non-pointer,
  8877. // non-interface field appearing in ForceSendFields will be sent to the
  8878. // server regardless of whether the field is empty or not. This may be
  8879. // used to include empty fields in Patch requests.
  8880. ForceSendFields []string `json:"-"`
  8881. // NullFields is a list of field names (e.g. "Code") to include in API
  8882. // requests with the JSON null value. By default, fields with empty
  8883. // values are omitted from API requests. However, any field with an
  8884. // empty value appearing in NullFields will be sent to the server as
  8885. // null. It is an error if a field in this list has a non-empty value.
  8886. // This may be used to include null fields in Patch requests.
  8887. NullFields []string `json:"-"`
  8888. }
  8889. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8890. type NoMethod InstanceGroupManagerAggregatedListWarning
  8891. raw := NoMethod(*s)
  8892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8893. }
  8894. type InstanceGroupManagerAggregatedListWarningData struct {
  8895. // Key: [Output Only] A key that provides more detail on the warning
  8896. // being returned. For example, for warnings where there are no results
  8897. // in a list request for a particular zone, this key might be scope and
  8898. // the key value might be the zone name. Other examples might be a key
  8899. // indicating a deprecated resource and a suggested replacement, or a
  8900. // warning about invalid network settings (for example, if an instance
  8901. // attempts to perform IP forwarding but is not enabled for IP
  8902. // forwarding).
  8903. Key string `json:"key,omitempty"`
  8904. // Value: [Output Only] A warning data value corresponding to the key.
  8905. Value string `json:"value,omitempty"`
  8906. // ForceSendFields is a list of field names (e.g. "Key") to
  8907. // unconditionally include in API requests. By default, fields with
  8908. // empty values are omitted from API requests. However, any non-pointer,
  8909. // non-interface field appearing in ForceSendFields will be sent to the
  8910. // server regardless of whether the field is empty or not. This may be
  8911. // used to include empty fields in Patch requests.
  8912. ForceSendFields []string `json:"-"`
  8913. // NullFields is a list of field names (e.g. "Key") to include in API
  8914. // requests with the JSON null value. By default, fields with empty
  8915. // values are omitted from API requests. However, any field with an
  8916. // empty value appearing in NullFields will be sent to the server as
  8917. // null. It is an error if a field in this list has a non-empty value.
  8918. // This may be used to include null fields in Patch requests.
  8919. NullFields []string `json:"-"`
  8920. }
  8921. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8922. type NoMethod InstanceGroupManagerAggregatedListWarningData
  8923. raw := NoMethod(*s)
  8924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8925. }
  8926. // InstanceGroupManagerList: [Output Only] A list of managed instance
  8927. // groups.
  8928. type InstanceGroupManagerList struct {
  8929. // Id: [Output Only] Unique identifier for the resource; defined by the
  8930. // server.
  8931. Id string `json:"id,omitempty"`
  8932. // Items: A list of InstanceGroupManager resources.
  8933. Items []*InstanceGroupManager `json:"items,omitempty"`
  8934. // Kind: [Output Only] The resource type, which is always
  8935. // compute#instanceGroupManagerList for a list of managed instance
  8936. // groups.
  8937. Kind string `json:"kind,omitempty"`
  8938. // NextPageToken: [Output Only] This token allows you to get the next
  8939. // page of results for list requests. If the number of results is larger
  8940. // than maxResults, use the nextPageToken as a value for the query
  8941. // parameter pageToken in the next list request. Subsequent list
  8942. // requests will have their own nextPageToken to continue paging through
  8943. // the results.
  8944. NextPageToken string `json:"nextPageToken,omitempty"`
  8945. // SelfLink: [Output Only] Server-defined URL for this resource.
  8946. SelfLink string `json:"selfLink,omitempty"`
  8947. // Warning: [Output Only] Informational warning message.
  8948. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  8949. // ServerResponse contains the HTTP response code and headers from the
  8950. // server.
  8951. googleapi.ServerResponse `json:"-"`
  8952. // ForceSendFields is a list of field names (e.g. "Id") to
  8953. // unconditionally include in API requests. By default, fields with
  8954. // empty values are omitted from API requests. However, any non-pointer,
  8955. // non-interface field appearing in ForceSendFields will be sent to the
  8956. // server regardless of whether the field is empty or not. This may be
  8957. // used to include empty fields in Patch requests.
  8958. ForceSendFields []string `json:"-"`
  8959. // NullFields is a list of field names (e.g. "Id") to include in API
  8960. // requests with the JSON null value. By default, fields with empty
  8961. // values are omitted from API requests. However, any field with an
  8962. // empty value appearing in NullFields will be sent to the server as
  8963. // null. It is an error if a field in this list has a non-empty value.
  8964. // This may be used to include null fields in Patch requests.
  8965. NullFields []string `json:"-"`
  8966. }
  8967. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  8968. type NoMethod InstanceGroupManagerList
  8969. raw := NoMethod(*s)
  8970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8971. }
  8972. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  8973. // message.
  8974. type InstanceGroupManagerListWarning struct {
  8975. // Code: [Output Only] A warning code, if applicable. For example,
  8976. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8977. // the response.
  8978. //
  8979. // Possible values:
  8980. // "CLEANUP_FAILED"
  8981. // "DEPRECATED_RESOURCE_USED"
  8982. // "DEPRECATED_TYPE_USED"
  8983. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8984. // "EXPERIMENTAL_TYPE_USED"
  8985. // "EXTERNAL_API_WARNING"
  8986. // "FIELD_VALUE_OVERRIDEN"
  8987. // "INJECTED_KERNELS_DEPRECATED"
  8988. // "MISSING_TYPE_DEPENDENCY"
  8989. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8990. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8991. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8992. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8993. // "NEXT_HOP_NOT_RUNNING"
  8994. // "NOT_CRITICAL_ERROR"
  8995. // "NO_RESULTS_ON_PAGE"
  8996. // "REQUIRED_TOS_AGREEMENT"
  8997. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8998. // "RESOURCE_NOT_DELETED"
  8999. // "SCHEMA_VALIDATION_IGNORED"
  9000. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9001. // "UNDECLARED_PROPERTIES"
  9002. // "UNREACHABLE"
  9003. Code string `json:"code,omitempty"`
  9004. // Data: [Output Only] Metadata about this warning in key: value format.
  9005. // For example:
  9006. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9007. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  9008. // Message: [Output Only] A human-readable description of the warning
  9009. // code.
  9010. Message string `json:"message,omitempty"`
  9011. // ForceSendFields is a list of field names (e.g. "Code") to
  9012. // unconditionally include in API requests. By default, fields with
  9013. // empty values are omitted from API requests. However, any non-pointer,
  9014. // non-interface field appearing in ForceSendFields will be sent to the
  9015. // server regardless of whether the field is empty or not. This may be
  9016. // used to include empty fields in Patch requests.
  9017. ForceSendFields []string `json:"-"`
  9018. // NullFields is a list of field names (e.g. "Code") to include in API
  9019. // requests with the JSON null value. By default, fields with empty
  9020. // values are omitted from API requests. However, any field with an
  9021. // empty value appearing in NullFields will be sent to the server as
  9022. // null. It is an error if a field in this list has a non-empty value.
  9023. // This may be used to include null fields in Patch requests.
  9024. NullFields []string `json:"-"`
  9025. }
  9026. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  9027. type NoMethod InstanceGroupManagerListWarning
  9028. raw := NoMethod(*s)
  9029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9030. }
  9031. type InstanceGroupManagerListWarningData struct {
  9032. // Key: [Output Only] A key that provides more detail on the warning
  9033. // being returned. For example, for warnings where there are no results
  9034. // in a list request for a particular zone, this key might be scope and
  9035. // the key value might be the zone name. Other examples might be a key
  9036. // indicating a deprecated resource and a suggested replacement, or a
  9037. // warning about invalid network settings (for example, if an instance
  9038. // attempts to perform IP forwarding but is not enabled for IP
  9039. // forwarding).
  9040. Key string `json:"key,omitempty"`
  9041. // Value: [Output Only] A warning data value corresponding to the key.
  9042. Value string `json:"value,omitempty"`
  9043. // ForceSendFields is a list of field names (e.g. "Key") to
  9044. // unconditionally include in API requests. By default, fields with
  9045. // empty values are omitted from API requests. However, any non-pointer,
  9046. // non-interface field appearing in ForceSendFields will be sent to the
  9047. // server regardless of whether the field is empty or not. This may be
  9048. // used to include empty fields in Patch requests.
  9049. ForceSendFields []string `json:"-"`
  9050. // NullFields is a list of field names (e.g. "Key") to include in API
  9051. // requests with the JSON null value. By default, fields with empty
  9052. // values are omitted from API requests. However, any field with an
  9053. // empty value appearing in NullFields will be sent to the server as
  9054. // null. It is an error if a field in this list has a non-empty value.
  9055. // This may be used to include null fields in Patch requests.
  9056. NullFields []string `json:"-"`
  9057. }
  9058. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  9059. type NoMethod InstanceGroupManagerListWarningData
  9060. raw := NoMethod(*s)
  9061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9062. }
  9063. type InstanceGroupManagersAbandonInstancesRequest struct {
  9064. // Instances: The URLs of one or more instances to abandon. This can be
  9065. // a full URL or a partial URL, such as
  9066. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9067. Instances []string `json:"instances,omitempty"`
  9068. // ForceSendFields is a list of field names (e.g. "Instances") to
  9069. // unconditionally include in API requests. By default, fields with
  9070. // empty values are omitted from API requests. However, any non-pointer,
  9071. // non-interface field appearing in ForceSendFields will be sent to the
  9072. // server regardless of whether the field is empty or not. This may be
  9073. // used to include empty fields in Patch requests.
  9074. ForceSendFields []string `json:"-"`
  9075. // NullFields is a list of field names (e.g. "Instances") to include in
  9076. // API requests with the JSON null value. By default, fields with empty
  9077. // values are omitted from API requests. However, any field with an
  9078. // empty value appearing in NullFields will be sent to the server as
  9079. // null. It is an error if a field in this list has a non-empty value.
  9080. // This may be used to include null fields in Patch requests.
  9081. NullFields []string `json:"-"`
  9082. }
  9083. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  9084. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  9085. raw := NoMethod(*s)
  9086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9087. }
  9088. type InstanceGroupManagersDeleteInstancesRequest struct {
  9089. // Instances: The URLs of one or more instances to delete. This can be a
  9090. // full URL or a partial URL, such as
  9091. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9092. Instances []string `json:"instances,omitempty"`
  9093. // ForceSendFields is a list of field names (e.g. "Instances") to
  9094. // unconditionally include in API requests. By default, fields with
  9095. // empty values are omitted from API requests. However, any non-pointer,
  9096. // non-interface field appearing in ForceSendFields will be sent to the
  9097. // server regardless of whether the field is empty or not. This may be
  9098. // used to include empty fields in Patch requests.
  9099. ForceSendFields []string `json:"-"`
  9100. // NullFields is a list of field names (e.g. "Instances") to include in
  9101. // API requests with the JSON null value. By default, fields with empty
  9102. // values are omitted from API requests. However, any field with an
  9103. // empty value appearing in NullFields will be sent to the server as
  9104. // null. It is an error if a field in this list has a non-empty value.
  9105. // This may be used to include null fields in Patch requests.
  9106. NullFields []string `json:"-"`
  9107. }
  9108. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  9109. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  9110. raw := NoMethod(*s)
  9111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9112. }
  9113. type InstanceGroupManagersListManagedInstancesResponse struct {
  9114. // ManagedInstances: [Output Only] The list of instances in the managed
  9115. // instance group.
  9116. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  9117. // ServerResponse contains the HTTP response code and headers from the
  9118. // server.
  9119. googleapi.ServerResponse `json:"-"`
  9120. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  9121. // unconditionally include in API requests. By default, fields with
  9122. // empty values are omitted from API requests. However, any non-pointer,
  9123. // non-interface field appearing in ForceSendFields will be sent to the
  9124. // server regardless of whether the field is empty or not. This may be
  9125. // used to include empty fields in Patch requests.
  9126. ForceSendFields []string `json:"-"`
  9127. // NullFields is a list of field names (e.g. "ManagedInstances") to
  9128. // include in API requests with the JSON null value. By default, fields
  9129. // with empty values are omitted from API requests. However, any field
  9130. // with an empty value appearing in NullFields will be sent to the
  9131. // server as null. It is an error if a field in this list has a
  9132. // non-empty value. This may be used to include null fields in Patch
  9133. // requests.
  9134. NullFields []string `json:"-"`
  9135. }
  9136. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  9137. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  9138. raw := NoMethod(*s)
  9139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9140. }
  9141. type InstanceGroupManagersRecreateInstancesRequest struct {
  9142. // Instances: The URLs of one or more instances to recreate. This can be
  9143. // a full URL or a partial URL, such as
  9144. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9145. Instances []string `json:"instances,omitempty"`
  9146. // ForceSendFields is a list of field names (e.g. "Instances") to
  9147. // unconditionally include in API requests. By default, fields with
  9148. // empty values are omitted from API requests. However, any non-pointer,
  9149. // non-interface field appearing in ForceSendFields will be sent to the
  9150. // server regardless of whether the field is empty or not. This may be
  9151. // used to include empty fields in Patch requests.
  9152. ForceSendFields []string `json:"-"`
  9153. // NullFields is a list of field names (e.g. "Instances") to include in
  9154. // API requests with the JSON null value. By default, fields with empty
  9155. // values are omitted from API requests. However, any field with an
  9156. // empty value appearing in NullFields will be sent to the server as
  9157. // null. It is an error if a field in this list has a non-empty value.
  9158. // This may be used to include null fields in Patch requests.
  9159. NullFields []string `json:"-"`
  9160. }
  9161. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  9162. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  9163. raw := NoMethod(*s)
  9164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9165. }
  9166. type InstanceGroupManagersScopedList struct {
  9167. // InstanceGroupManagers: [Output Only] The list of managed instance
  9168. // groups that are contained in the specified project and zone.
  9169. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  9170. // Warning: [Output Only] The warning that replaces the list of managed
  9171. // instance groups when the list is empty.
  9172. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  9173. // ForceSendFields is a list of field names (e.g.
  9174. // "InstanceGroupManagers") to unconditionally include in API requests.
  9175. // By default, fields with empty values are omitted from API requests.
  9176. // However, any non-pointer, non-interface field appearing in
  9177. // ForceSendFields will be sent to the server regardless of whether the
  9178. // field is empty or not. This may be used to include empty fields in
  9179. // Patch requests.
  9180. ForceSendFields []string `json:"-"`
  9181. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  9182. // include in API requests with the JSON null value. By default, fields
  9183. // with empty values are omitted from API requests. However, any field
  9184. // with an empty value appearing in NullFields will be sent to the
  9185. // server as null. It is an error if a field in this list has a
  9186. // non-empty value. This may be used to include null fields in Patch
  9187. // requests.
  9188. NullFields []string `json:"-"`
  9189. }
  9190. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  9191. type NoMethod InstanceGroupManagersScopedList
  9192. raw := NoMethod(*s)
  9193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9194. }
  9195. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  9196. // that replaces the list of managed instance groups when the list is
  9197. // empty.
  9198. type InstanceGroupManagersScopedListWarning struct {
  9199. // Code: [Output Only] A warning code, if applicable. For example,
  9200. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9201. // the response.
  9202. //
  9203. // Possible values:
  9204. // "CLEANUP_FAILED"
  9205. // "DEPRECATED_RESOURCE_USED"
  9206. // "DEPRECATED_TYPE_USED"
  9207. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9208. // "EXPERIMENTAL_TYPE_USED"
  9209. // "EXTERNAL_API_WARNING"
  9210. // "FIELD_VALUE_OVERRIDEN"
  9211. // "INJECTED_KERNELS_DEPRECATED"
  9212. // "MISSING_TYPE_DEPENDENCY"
  9213. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9214. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9215. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9216. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9217. // "NEXT_HOP_NOT_RUNNING"
  9218. // "NOT_CRITICAL_ERROR"
  9219. // "NO_RESULTS_ON_PAGE"
  9220. // "REQUIRED_TOS_AGREEMENT"
  9221. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9222. // "RESOURCE_NOT_DELETED"
  9223. // "SCHEMA_VALIDATION_IGNORED"
  9224. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9225. // "UNDECLARED_PROPERTIES"
  9226. // "UNREACHABLE"
  9227. Code string `json:"code,omitempty"`
  9228. // Data: [Output Only] Metadata about this warning in key: value format.
  9229. // For example:
  9230. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9231. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  9232. // Message: [Output Only] A human-readable description of the warning
  9233. // code.
  9234. Message string `json:"message,omitempty"`
  9235. // ForceSendFields is a list of field names (e.g. "Code") to
  9236. // unconditionally include in API requests. By default, fields with
  9237. // empty values are omitted from API requests. However, any non-pointer,
  9238. // non-interface field appearing in ForceSendFields will be sent to the
  9239. // server regardless of whether the field is empty or not. This may be
  9240. // used to include empty fields in Patch requests.
  9241. ForceSendFields []string `json:"-"`
  9242. // NullFields is a list of field names (e.g. "Code") to include in API
  9243. // requests with the JSON null value. By default, fields with empty
  9244. // values are omitted from API requests. However, any field with an
  9245. // empty value appearing in NullFields will be sent to the server as
  9246. // null. It is an error if a field in this list has a non-empty value.
  9247. // This may be used to include null fields in Patch requests.
  9248. NullFields []string `json:"-"`
  9249. }
  9250. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  9251. type NoMethod InstanceGroupManagersScopedListWarning
  9252. raw := NoMethod(*s)
  9253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9254. }
  9255. type InstanceGroupManagersScopedListWarningData struct {
  9256. // Key: [Output Only] A key that provides more detail on the warning
  9257. // being returned. For example, for warnings where there are no results
  9258. // in a list request for a particular zone, this key might be scope and
  9259. // the key value might be the zone name. Other examples might be a key
  9260. // indicating a deprecated resource and a suggested replacement, or a
  9261. // warning about invalid network settings (for example, if an instance
  9262. // attempts to perform IP forwarding but is not enabled for IP
  9263. // forwarding).
  9264. Key string `json:"key,omitempty"`
  9265. // Value: [Output Only] A warning data value corresponding to the key.
  9266. Value string `json:"value,omitempty"`
  9267. // ForceSendFields is a list of field names (e.g. "Key") to
  9268. // unconditionally include in API requests. By default, fields with
  9269. // empty values are omitted from API requests. However, any non-pointer,
  9270. // non-interface field appearing in ForceSendFields will be sent to the
  9271. // server regardless of whether the field is empty or not. This may be
  9272. // used to include empty fields in Patch requests.
  9273. ForceSendFields []string `json:"-"`
  9274. // NullFields is a list of field names (e.g. "Key") to include in API
  9275. // requests with the JSON null value. By default, fields with empty
  9276. // values are omitted from API requests. However, any field with an
  9277. // empty value appearing in NullFields will be sent to the server as
  9278. // null. It is an error if a field in this list has a non-empty value.
  9279. // This may be used to include null fields in Patch requests.
  9280. NullFields []string `json:"-"`
  9281. }
  9282. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  9283. type NoMethod InstanceGroupManagersScopedListWarningData
  9284. raw := NoMethod(*s)
  9285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9286. }
  9287. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  9288. // InstanceTemplate: The URL of the instance template that is specified
  9289. // for this managed instance group. The group uses this template to
  9290. // create all new instances in the managed instance group.
  9291. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9292. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  9293. // unconditionally include in API requests. By default, fields with
  9294. // empty values are omitted from API requests. However, any non-pointer,
  9295. // non-interface field appearing in ForceSendFields will be sent to the
  9296. // server regardless of whether the field is empty or not. This may be
  9297. // used to include empty fields in Patch requests.
  9298. ForceSendFields []string `json:"-"`
  9299. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  9300. // include in API requests with the JSON null value. By default, fields
  9301. // with empty values are omitted from API requests. However, any field
  9302. // with an empty value appearing in NullFields will be sent to the
  9303. // server as null. It is an error if a field in this list has a
  9304. // non-empty value. This may be used to include null fields in Patch
  9305. // requests.
  9306. NullFields []string `json:"-"`
  9307. }
  9308. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  9309. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  9310. raw := NoMethod(*s)
  9311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9312. }
  9313. type InstanceGroupManagersSetTargetPoolsRequest struct {
  9314. // Fingerprint: The fingerprint of the target pools information. Use
  9315. // this optional property to prevent conflicts when multiple users
  9316. // change the target pools settings concurrently. Obtain the fingerprint
  9317. // with the instanceGroupManagers.get method. Then, include the
  9318. // fingerprint in your request to ensure that you do not overwrite
  9319. // changes that were applied from another concurrent request.
  9320. Fingerprint string `json:"fingerprint,omitempty"`
  9321. // TargetPools: The list of target pool URLs that instances in this
  9322. // managed instance group belong to. The managed instance group applies
  9323. // these target pools to all of the instances in the group. Existing
  9324. // instances and new instances in the group all receive these target
  9325. // pool settings.
  9326. TargetPools []string `json:"targetPools,omitempty"`
  9327. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9328. // unconditionally include in API requests. By default, fields with
  9329. // empty values are omitted from API requests. However, any non-pointer,
  9330. // non-interface field appearing in ForceSendFields will be sent to the
  9331. // server regardless of whether the field is empty or not. This may be
  9332. // used to include empty fields in Patch requests.
  9333. ForceSendFields []string `json:"-"`
  9334. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9335. // in API requests with the JSON null value. By default, fields with
  9336. // empty values are omitted from API requests. However, any field with
  9337. // an empty value appearing in NullFields will be sent to the server as
  9338. // null. It is an error if a field in this list has a non-empty value.
  9339. // This may be used to include null fields in Patch requests.
  9340. NullFields []string `json:"-"`
  9341. }
  9342. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  9343. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  9344. raw := NoMethod(*s)
  9345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9346. }
  9347. type InstanceGroupsAddInstancesRequest struct {
  9348. // Instances: The list of instances to add to the instance group.
  9349. Instances []*InstanceReference `json:"instances,omitempty"`
  9350. // ForceSendFields is a list of field names (e.g. "Instances") to
  9351. // unconditionally include in API requests. By default, fields with
  9352. // empty values are omitted from API requests. However, any non-pointer,
  9353. // non-interface field appearing in ForceSendFields will be sent to the
  9354. // server regardless of whether the field is empty or not. This may be
  9355. // used to include empty fields in Patch requests.
  9356. ForceSendFields []string `json:"-"`
  9357. // NullFields is a list of field names (e.g. "Instances") to include in
  9358. // API requests with the JSON null value. By default, fields with empty
  9359. // values are omitted from API requests. However, any field with an
  9360. // empty value appearing in NullFields will be sent to the server as
  9361. // null. It is an error if a field in this list has a non-empty value.
  9362. // This may be used to include null fields in Patch requests.
  9363. NullFields []string `json:"-"`
  9364. }
  9365. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  9366. type NoMethod InstanceGroupsAddInstancesRequest
  9367. raw := NoMethod(*s)
  9368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9369. }
  9370. type InstanceGroupsListInstances struct {
  9371. // Id: [Output Only] Unique identifier for the resource; defined by the
  9372. // server.
  9373. Id string `json:"id,omitempty"`
  9374. // Items: A list of InstanceWithNamedPorts resources.
  9375. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  9376. // Kind: [Output Only] The resource type, which is always
  9377. // compute#instanceGroupsListInstances for the list of instances in the
  9378. // specified instance group.
  9379. Kind string `json:"kind,omitempty"`
  9380. // NextPageToken: [Output Only] This token allows you to get the next
  9381. // page of results for list requests. If the number of results is larger
  9382. // than maxResults, use the nextPageToken as a value for the query
  9383. // parameter pageToken in the next list request. Subsequent list
  9384. // requests will have their own nextPageToken to continue paging through
  9385. // the results.
  9386. NextPageToken string `json:"nextPageToken,omitempty"`
  9387. // SelfLink: [Output Only] Server-defined URL for this resource.
  9388. SelfLink string `json:"selfLink,omitempty"`
  9389. // Warning: [Output Only] Informational warning message.
  9390. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  9391. // ServerResponse contains the HTTP response code and headers from the
  9392. // server.
  9393. googleapi.ServerResponse `json:"-"`
  9394. // ForceSendFields is a list of field names (e.g. "Id") to
  9395. // unconditionally include in API requests. By default, fields with
  9396. // empty values are omitted from API requests. However, any non-pointer,
  9397. // non-interface field appearing in ForceSendFields will be sent to the
  9398. // server regardless of whether the field is empty or not. This may be
  9399. // used to include empty fields in Patch requests.
  9400. ForceSendFields []string `json:"-"`
  9401. // NullFields is a list of field names (e.g. "Id") to include in API
  9402. // requests with the JSON null value. By default, fields with empty
  9403. // values are omitted from API requests. However, any field with an
  9404. // empty value appearing in NullFields will be sent to the server as
  9405. // null. It is an error if a field in this list has a non-empty value.
  9406. // This may be used to include null fields in Patch requests.
  9407. NullFields []string `json:"-"`
  9408. }
  9409. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  9410. type NoMethod InstanceGroupsListInstances
  9411. raw := NoMethod(*s)
  9412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9413. }
  9414. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  9415. // warning message.
  9416. type InstanceGroupsListInstancesWarning struct {
  9417. // Code: [Output Only] A warning code, if applicable. For example,
  9418. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9419. // the response.
  9420. //
  9421. // Possible values:
  9422. // "CLEANUP_FAILED"
  9423. // "DEPRECATED_RESOURCE_USED"
  9424. // "DEPRECATED_TYPE_USED"
  9425. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9426. // "EXPERIMENTAL_TYPE_USED"
  9427. // "EXTERNAL_API_WARNING"
  9428. // "FIELD_VALUE_OVERRIDEN"
  9429. // "INJECTED_KERNELS_DEPRECATED"
  9430. // "MISSING_TYPE_DEPENDENCY"
  9431. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9432. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9433. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9434. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9435. // "NEXT_HOP_NOT_RUNNING"
  9436. // "NOT_CRITICAL_ERROR"
  9437. // "NO_RESULTS_ON_PAGE"
  9438. // "REQUIRED_TOS_AGREEMENT"
  9439. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9440. // "RESOURCE_NOT_DELETED"
  9441. // "SCHEMA_VALIDATION_IGNORED"
  9442. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9443. // "UNDECLARED_PROPERTIES"
  9444. // "UNREACHABLE"
  9445. Code string `json:"code,omitempty"`
  9446. // Data: [Output Only] Metadata about this warning in key: value format.
  9447. // For example:
  9448. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9449. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  9450. // Message: [Output Only] A human-readable description of the warning
  9451. // code.
  9452. Message string `json:"message,omitempty"`
  9453. // ForceSendFields is a list of field names (e.g. "Code") to
  9454. // unconditionally include in API requests. By default, fields with
  9455. // empty values are omitted from API requests. However, any non-pointer,
  9456. // non-interface field appearing in ForceSendFields will be sent to the
  9457. // server regardless of whether the field is empty or not. This may be
  9458. // used to include empty fields in Patch requests.
  9459. ForceSendFields []string `json:"-"`
  9460. // NullFields is a list of field names (e.g. "Code") to include in API
  9461. // requests with the JSON null value. By default, fields with empty
  9462. // values are omitted from API requests. However, any field with an
  9463. // empty value appearing in NullFields will be sent to the server as
  9464. // null. It is an error if a field in this list has a non-empty value.
  9465. // This may be used to include null fields in Patch requests.
  9466. NullFields []string `json:"-"`
  9467. }
  9468. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  9469. type NoMethod InstanceGroupsListInstancesWarning
  9470. raw := NoMethod(*s)
  9471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9472. }
  9473. type InstanceGroupsListInstancesWarningData struct {
  9474. // Key: [Output Only] A key that provides more detail on the warning
  9475. // being returned. For example, for warnings where there are no results
  9476. // in a list request for a particular zone, this key might be scope and
  9477. // the key value might be the zone name. Other examples might be a key
  9478. // indicating a deprecated resource and a suggested replacement, or a
  9479. // warning about invalid network settings (for example, if an instance
  9480. // attempts to perform IP forwarding but is not enabled for IP
  9481. // forwarding).
  9482. Key string `json:"key,omitempty"`
  9483. // Value: [Output Only] A warning data value corresponding to the key.
  9484. Value string `json:"value,omitempty"`
  9485. // ForceSendFields is a list of field names (e.g. "Key") to
  9486. // unconditionally include in API requests. By default, fields with
  9487. // empty values are omitted from API requests. However, any non-pointer,
  9488. // non-interface field appearing in ForceSendFields will be sent to the
  9489. // server regardless of whether the field is empty or not. This may be
  9490. // used to include empty fields in Patch requests.
  9491. ForceSendFields []string `json:"-"`
  9492. // NullFields is a list of field names (e.g. "Key") to include in API
  9493. // requests with the JSON null value. By default, fields with empty
  9494. // values are omitted from API requests. However, any field with an
  9495. // empty value appearing in NullFields will be sent to the server as
  9496. // null. It is an error if a field in this list has a non-empty value.
  9497. // This may be used to include null fields in Patch requests.
  9498. NullFields []string `json:"-"`
  9499. }
  9500. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  9501. type NoMethod InstanceGroupsListInstancesWarningData
  9502. raw := NoMethod(*s)
  9503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9504. }
  9505. type InstanceGroupsListInstancesRequest struct {
  9506. // InstanceState: A filter for the state of the instances in the
  9507. // instance group. Valid options are ALL or RUNNING. If you do not
  9508. // specify this parameter the list includes all instances regardless of
  9509. // their state.
  9510. //
  9511. // Possible values:
  9512. // "ALL"
  9513. // "RUNNING"
  9514. InstanceState string `json:"instanceState,omitempty"`
  9515. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  9516. // unconditionally include in API requests. By default, fields with
  9517. // empty values are omitted from API requests. However, any non-pointer,
  9518. // non-interface field appearing in ForceSendFields will be sent to the
  9519. // server regardless of whether the field is empty or not. This may be
  9520. // used to include empty fields in Patch requests.
  9521. ForceSendFields []string `json:"-"`
  9522. // NullFields is a list of field names (e.g. "InstanceState") to include
  9523. // in API requests with the JSON null value. By default, fields with
  9524. // empty values are omitted from API requests. However, any field with
  9525. // an empty value appearing in NullFields will be sent to the server as
  9526. // null. It is an error if a field in this list has a non-empty value.
  9527. // This may be used to include null fields in Patch requests.
  9528. NullFields []string `json:"-"`
  9529. }
  9530. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  9531. type NoMethod InstanceGroupsListInstancesRequest
  9532. raw := NoMethod(*s)
  9533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9534. }
  9535. type InstanceGroupsRemoveInstancesRequest struct {
  9536. // Instances: The list of instances to remove from the instance group.
  9537. Instances []*InstanceReference `json:"instances,omitempty"`
  9538. // ForceSendFields is a list of field names (e.g. "Instances") to
  9539. // unconditionally include in API requests. By default, fields with
  9540. // empty values are omitted from API requests. However, any non-pointer,
  9541. // non-interface field appearing in ForceSendFields will be sent to the
  9542. // server regardless of whether the field is empty or not. This may be
  9543. // used to include empty fields in Patch requests.
  9544. ForceSendFields []string `json:"-"`
  9545. // NullFields is a list of field names (e.g. "Instances") to include in
  9546. // API requests with the JSON null value. By default, fields with empty
  9547. // values are omitted from API requests. However, any field with an
  9548. // empty value appearing in NullFields will be sent to the server as
  9549. // null. It is an error if a field in this list has a non-empty value.
  9550. // This may be used to include null fields in Patch requests.
  9551. NullFields []string `json:"-"`
  9552. }
  9553. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  9554. type NoMethod InstanceGroupsRemoveInstancesRequest
  9555. raw := NoMethod(*s)
  9556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9557. }
  9558. type InstanceGroupsScopedList struct {
  9559. // InstanceGroups: [Output Only] The list of instance groups that are
  9560. // contained in this scope.
  9561. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  9562. // Warning: [Output Only] An informational warning that replaces the
  9563. // list of instance groups when the list is empty.
  9564. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  9565. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  9566. // unconditionally include in API requests. By default, fields with
  9567. // empty values are omitted from API requests. However, any non-pointer,
  9568. // non-interface field appearing in ForceSendFields will be sent to the
  9569. // server regardless of whether the field is empty or not. This may be
  9570. // used to include empty fields in Patch requests.
  9571. ForceSendFields []string `json:"-"`
  9572. // NullFields is a list of field names (e.g. "InstanceGroups") to
  9573. // include in API requests with the JSON null value. By default, fields
  9574. // with empty values are omitted from API requests. However, any field
  9575. // with an empty value appearing in NullFields will be sent to the
  9576. // server as null. It is an error if a field in this list has a
  9577. // non-empty value. This may be used to include null fields in Patch
  9578. // requests.
  9579. NullFields []string `json:"-"`
  9580. }
  9581. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  9582. type NoMethod InstanceGroupsScopedList
  9583. raw := NoMethod(*s)
  9584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9585. }
  9586. // InstanceGroupsScopedListWarning: [Output Only] An informational
  9587. // warning that replaces the list of instance groups when the list is
  9588. // empty.
  9589. type InstanceGroupsScopedListWarning struct {
  9590. // Code: [Output Only] A warning code, if applicable. For example,
  9591. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9592. // the response.
  9593. //
  9594. // Possible values:
  9595. // "CLEANUP_FAILED"
  9596. // "DEPRECATED_RESOURCE_USED"
  9597. // "DEPRECATED_TYPE_USED"
  9598. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9599. // "EXPERIMENTAL_TYPE_USED"
  9600. // "EXTERNAL_API_WARNING"
  9601. // "FIELD_VALUE_OVERRIDEN"
  9602. // "INJECTED_KERNELS_DEPRECATED"
  9603. // "MISSING_TYPE_DEPENDENCY"
  9604. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9605. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9606. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9607. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9608. // "NEXT_HOP_NOT_RUNNING"
  9609. // "NOT_CRITICAL_ERROR"
  9610. // "NO_RESULTS_ON_PAGE"
  9611. // "REQUIRED_TOS_AGREEMENT"
  9612. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9613. // "RESOURCE_NOT_DELETED"
  9614. // "SCHEMA_VALIDATION_IGNORED"
  9615. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9616. // "UNDECLARED_PROPERTIES"
  9617. // "UNREACHABLE"
  9618. Code string `json:"code,omitempty"`
  9619. // Data: [Output Only] Metadata about this warning in key: value format.
  9620. // For example:
  9621. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9622. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  9623. // Message: [Output Only] A human-readable description of the warning
  9624. // code.
  9625. Message string `json:"message,omitempty"`
  9626. // ForceSendFields is a list of field names (e.g. "Code") to
  9627. // unconditionally include in API requests. By default, fields with
  9628. // empty values are omitted from API requests. However, any non-pointer,
  9629. // non-interface field appearing in ForceSendFields will be sent to the
  9630. // server regardless of whether the field is empty or not. This may be
  9631. // used to include empty fields in Patch requests.
  9632. ForceSendFields []string `json:"-"`
  9633. // NullFields is a list of field names (e.g. "Code") to include in API
  9634. // requests with the JSON null value. By default, fields with empty
  9635. // values are omitted from API requests. However, any field with an
  9636. // empty value appearing in NullFields will be sent to the server as
  9637. // null. It is an error if a field in this list has a non-empty value.
  9638. // This may be used to include null fields in Patch requests.
  9639. NullFields []string `json:"-"`
  9640. }
  9641. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  9642. type NoMethod InstanceGroupsScopedListWarning
  9643. raw := NoMethod(*s)
  9644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9645. }
  9646. type InstanceGroupsScopedListWarningData struct {
  9647. // Key: [Output Only] A key that provides more detail on the warning
  9648. // being returned. For example, for warnings where there are no results
  9649. // in a list request for a particular zone, this key might be scope and
  9650. // the key value might be the zone name. Other examples might be a key
  9651. // indicating a deprecated resource and a suggested replacement, or a
  9652. // warning about invalid network settings (for example, if an instance
  9653. // attempts to perform IP forwarding but is not enabled for IP
  9654. // forwarding).
  9655. Key string `json:"key,omitempty"`
  9656. // Value: [Output Only] A warning data value corresponding to the key.
  9657. Value string `json:"value,omitempty"`
  9658. // ForceSendFields is a list of field names (e.g. "Key") to
  9659. // unconditionally include in API requests. By default, fields with
  9660. // empty values are omitted from API requests. However, any non-pointer,
  9661. // non-interface field appearing in ForceSendFields will be sent to the
  9662. // server regardless of whether the field is empty or not. This may be
  9663. // used to include empty fields in Patch requests.
  9664. ForceSendFields []string `json:"-"`
  9665. // NullFields is a list of field names (e.g. "Key") to include in API
  9666. // requests with the JSON null value. By default, fields with empty
  9667. // values are omitted from API requests. However, any field with an
  9668. // empty value appearing in NullFields will be sent to the server as
  9669. // null. It is an error if a field in this list has a non-empty value.
  9670. // This may be used to include null fields in Patch requests.
  9671. NullFields []string `json:"-"`
  9672. }
  9673. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  9674. type NoMethod InstanceGroupsScopedListWarningData
  9675. raw := NoMethod(*s)
  9676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9677. }
  9678. type InstanceGroupsSetNamedPortsRequest struct {
  9679. // Fingerprint: The fingerprint of the named ports information for this
  9680. // instance group. Use this optional property to prevent conflicts when
  9681. // multiple users change the named ports settings concurrently. Obtain
  9682. // the fingerprint with the instanceGroups.get method. Then, include the
  9683. // fingerprint in your request to ensure that you do not overwrite
  9684. // changes that were applied from another concurrent request. A request
  9685. // with an incorrect fingerprint will fail with error 412
  9686. // conditionNotMet.
  9687. Fingerprint string `json:"fingerprint,omitempty"`
  9688. // NamedPorts: The list of named ports to set for this instance group.
  9689. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  9690. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9691. // unconditionally include in API requests. By default, fields with
  9692. // empty values are omitted from API requests. However, any non-pointer,
  9693. // non-interface field appearing in ForceSendFields will be sent to the
  9694. // server regardless of whether the field is empty or not. This may be
  9695. // used to include empty fields in Patch requests.
  9696. ForceSendFields []string `json:"-"`
  9697. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9698. // in API requests with the JSON null value. By default, fields with
  9699. // empty values are omitted from API requests. However, any field with
  9700. // an empty value appearing in NullFields will be sent to the server as
  9701. // null. It is an error if a field in this list has a non-empty value.
  9702. // This may be used to include null fields in Patch requests.
  9703. NullFields []string `json:"-"`
  9704. }
  9705. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  9706. type NoMethod InstanceGroupsSetNamedPortsRequest
  9707. raw := NoMethod(*s)
  9708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9709. }
  9710. // InstanceList: Contains a list of instances.
  9711. type InstanceList struct {
  9712. // Id: [Output Only] Unique identifier for the resource; defined by the
  9713. // server.
  9714. Id string `json:"id,omitempty"`
  9715. // Items: A list of Instance resources.
  9716. Items []*Instance `json:"items,omitempty"`
  9717. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  9718. // lists of Instance resources.
  9719. Kind string `json:"kind,omitempty"`
  9720. // NextPageToken: [Output Only] This token allows you to get the next
  9721. // page of results for list requests. If the number of results is larger
  9722. // than maxResults, use the nextPageToken as a value for the query
  9723. // parameter pageToken in the next list request. Subsequent list
  9724. // requests will have their own nextPageToken to continue paging through
  9725. // the results.
  9726. NextPageToken string `json:"nextPageToken,omitempty"`
  9727. // SelfLink: [Output Only] Server-defined URL for this resource.
  9728. SelfLink string `json:"selfLink,omitempty"`
  9729. // Warning: [Output Only] Informational warning message.
  9730. Warning *InstanceListWarning `json:"warning,omitempty"`
  9731. // ServerResponse contains the HTTP response code and headers from the
  9732. // server.
  9733. googleapi.ServerResponse `json:"-"`
  9734. // ForceSendFields is a list of field names (e.g. "Id") to
  9735. // unconditionally include in API requests. By default, fields with
  9736. // empty values are omitted from API requests. However, any non-pointer,
  9737. // non-interface field appearing in ForceSendFields will be sent to the
  9738. // server regardless of whether the field is empty or not. This may be
  9739. // used to include empty fields in Patch requests.
  9740. ForceSendFields []string `json:"-"`
  9741. // NullFields is a list of field names (e.g. "Id") to include in API
  9742. // requests with the JSON null value. By default, fields with empty
  9743. // values are omitted from API requests. However, any field with an
  9744. // empty value appearing in NullFields will be sent to the server as
  9745. // null. It is an error if a field in this list has a non-empty value.
  9746. // This may be used to include null fields in Patch requests.
  9747. NullFields []string `json:"-"`
  9748. }
  9749. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  9750. type NoMethod InstanceList
  9751. raw := NoMethod(*s)
  9752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9753. }
  9754. // InstanceListWarning: [Output Only] Informational warning message.
  9755. type InstanceListWarning struct {
  9756. // Code: [Output Only] A warning code, if applicable. For example,
  9757. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9758. // the response.
  9759. //
  9760. // Possible values:
  9761. // "CLEANUP_FAILED"
  9762. // "DEPRECATED_RESOURCE_USED"
  9763. // "DEPRECATED_TYPE_USED"
  9764. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9765. // "EXPERIMENTAL_TYPE_USED"
  9766. // "EXTERNAL_API_WARNING"
  9767. // "FIELD_VALUE_OVERRIDEN"
  9768. // "INJECTED_KERNELS_DEPRECATED"
  9769. // "MISSING_TYPE_DEPENDENCY"
  9770. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9771. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9772. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9773. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9774. // "NEXT_HOP_NOT_RUNNING"
  9775. // "NOT_CRITICAL_ERROR"
  9776. // "NO_RESULTS_ON_PAGE"
  9777. // "REQUIRED_TOS_AGREEMENT"
  9778. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9779. // "RESOURCE_NOT_DELETED"
  9780. // "SCHEMA_VALIDATION_IGNORED"
  9781. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9782. // "UNDECLARED_PROPERTIES"
  9783. // "UNREACHABLE"
  9784. Code string `json:"code,omitempty"`
  9785. // Data: [Output Only] Metadata about this warning in key: value format.
  9786. // For example:
  9787. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9788. Data []*InstanceListWarningData `json:"data,omitempty"`
  9789. // Message: [Output Only] A human-readable description of the warning
  9790. // code.
  9791. Message string `json:"message,omitempty"`
  9792. // ForceSendFields is a list of field names (e.g. "Code") to
  9793. // unconditionally include in API requests. By default, fields with
  9794. // empty values are omitted from API requests. However, any non-pointer,
  9795. // non-interface field appearing in ForceSendFields will be sent to the
  9796. // server regardless of whether the field is empty or not. This may be
  9797. // used to include empty fields in Patch requests.
  9798. ForceSendFields []string `json:"-"`
  9799. // NullFields is a list of field names (e.g. "Code") to include in API
  9800. // requests with the JSON null value. By default, fields with empty
  9801. // values are omitted from API requests. However, any field with an
  9802. // empty value appearing in NullFields will be sent to the server as
  9803. // null. It is an error if a field in this list has a non-empty value.
  9804. // This may be used to include null fields in Patch requests.
  9805. NullFields []string `json:"-"`
  9806. }
  9807. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  9808. type NoMethod InstanceListWarning
  9809. raw := NoMethod(*s)
  9810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9811. }
  9812. type InstanceListWarningData struct {
  9813. // Key: [Output Only] A key that provides more detail on the warning
  9814. // being returned. For example, for warnings where there are no results
  9815. // in a list request for a particular zone, this key might be scope and
  9816. // the key value might be the zone name. Other examples might be a key
  9817. // indicating a deprecated resource and a suggested replacement, or a
  9818. // warning about invalid network settings (for example, if an instance
  9819. // attempts to perform IP forwarding but is not enabled for IP
  9820. // forwarding).
  9821. Key string `json:"key,omitempty"`
  9822. // Value: [Output Only] A warning data value corresponding to the key.
  9823. Value string `json:"value,omitempty"`
  9824. // ForceSendFields is a list of field names (e.g. "Key") to
  9825. // unconditionally include in API requests. By default, fields with
  9826. // empty values are omitted from API requests. However, any non-pointer,
  9827. // non-interface field appearing in ForceSendFields will be sent to the
  9828. // server regardless of whether the field is empty or not. This may be
  9829. // used to include empty fields in Patch requests.
  9830. ForceSendFields []string `json:"-"`
  9831. // NullFields is a list of field names (e.g. "Key") to include in API
  9832. // requests with the JSON null value. By default, fields with empty
  9833. // values are omitted from API requests. However, any field with an
  9834. // empty value appearing in NullFields will be sent to the server as
  9835. // null. It is an error if a field in this list has a non-empty value.
  9836. // This may be used to include null fields in Patch requests.
  9837. NullFields []string `json:"-"`
  9838. }
  9839. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  9840. type NoMethod InstanceListWarningData
  9841. raw := NoMethod(*s)
  9842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9843. }
  9844. // InstanceListReferrers: Contains a list of instance referrers.
  9845. type InstanceListReferrers struct {
  9846. // Id: [Output Only] Unique identifier for the resource; defined by the
  9847. // server.
  9848. Id string `json:"id,omitempty"`
  9849. // Items: A list of Reference resources.
  9850. Items []*Reference `json:"items,omitempty"`
  9851. // Kind: [Output Only] Type of resource. Always
  9852. // compute#instanceListReferrers for lists of Instance referrers.
  9853. Kind string `json:"kind,omitempty"`
  9854. // NextPageToken: [Output Only] This token allows you to get the next
  9855. // page of results for list requests. If the number of results is larger
  9856. // than maxResults, use the nextPageToken as a value for the query
  9857. // parameter pageToken in the next list request. Subsequent list
  9858. // requests will have their own nextPageToken to continue paging through
  9859. // the results.
  9860. NextPageToken string `json:"nextPageToken,omitempty"`
  9861. // SelfLink: [Output Only] Server-defined URL for this resource.
  9862. SelfLink string `json:"selfLink,omitempty"`
  9863. // Warning: [Output Only] Informational warning message.
  9864. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  9865. // ServerResponse contains the HTTP response code and headers from the
  9866. // server.
  9867. googleapi.ServerResponse `json:"-"`
  9868. // ForceSendFields is a list of field names (e.g. "Id") to
  9869. // unconditionally include in API requests. By default, fields with
  9870. // empty values are omitted from API requests. However, any non-pointer,
  9871. // non-interface field appearing in ForceSendFields will be sent to the
  9872. // server regardless of whether the field is empty or not. This may be
  9873. // used to include empty fields in Patch requests.
  9874. ForceSendFields []string `json:"-"`
  9875. // NullFields is a list of field names (e.g. "Id") to include in API
  9876. // requests with the JSON null value. By default, fields with empty
  9877. // values are omitted from API requests. However, any field with an
  9878. // empty value appearing in NullFields will be sent to the server as
  9879. // null. It is an error if a field in this list has a non-empty value.
  9880. // This may be used to include null fields in Patch requests.
  9881. NullFields []string `json:"-"`
  9882. }
  9883. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  9884. type NoMethod InstanceListReferrers
  9885. raw := NoMethod(*s)
  9886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9887. }
  9888. // InstanceListReferrersWarning: [Output Only] Informational warning
  9889. // message.
  9890. type InstanceListReferrersWarning struct {
  9891. // Code: [Output Only] A warning code, if applicable. For example,
  9892. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9893. // the response.
  9894. //
  9895. // Possible values:
  9896. // "CLEANUP_FAILED"
  9897. // "DEPRECATED_RESOURCE_USED"
  9898. // "DEPRECATED_TYPE_USED"
  9899. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9900. // "EXPERIMENTAL_TYPE_USED"
  9901. // "EXTERNAL_API_WARNING"
  9902. // "FIELD_VALUE_OVERRIDEN"
  9903. // "INJECTED_KERNELS_DEPRECATED"
  9904. // "MISSING_TYPE_DEPENDENCY"
  9905. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9906. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9907. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9908. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9909. // "NEXT_HOP_NOT_RUNNING"
  9910. // "NOT_CRITICAL_ERROR"
  9911. // "NO_RESULTS_ON_PAGE"
  9912. // "REQUIRED_TOS_AGREEMENT"
  9913. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9914. // "RESOURCE_NOT_DELETED"
  9915. // "SCHEMA_VALIDATION_IGNORED"
  9916. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9917. // "UNDECLARED_PROPERTIES"
  9918. // "UNREACHABLE"
  9919. Code string `json:"code,omitempty"`
  9920. // Data: [Output Only] Metadata about this warning in key: value format.
  9921. // For example:
  9922. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9923. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  9924. // Message: [Output Only] A human-readable description of the warning
  9925. // code.
  9926. Message string `json:"message,omitempty"`
  9927. // ForceSendFields is a list of field names (e.g. "Code") to
  9928. // unconditionally include in API requests. By default, fields with
  9929. // empty values are omitted from API requests. However, any non-pointer,
  9930. // non-interface field appearing in ForceSendFields will be sent to the
  9931. // server regardless of whether the field is empty or not. This may be
  9932. // used to include empty fields in Patch requests.
  9933. ForceSendFields []string `json:"-"`
  9934. // NullFields is a list of field names (e.g. "Code") to include in API
  9935. // requests with the JSON null value. By default, fields with empty
  9936. // values are omitted from API requests. However, any field with an
  9937. // empty value appearing in NullFields will be sent to the server as
  9938. // null. It is an error if a field in this list has a non-empty value.
  9939. // This may be used to include null fields in Patch requests.
  9940. NullFields []string `json:"-"`
  9941. }
  9942. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  9943. type NoMethod InstanceListReferrersWarning
  9944. raw := NoMethod(*s)
  9945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9946. }
  9947. type InstanceListReferrersWarningData struct {
  9948. // Key: [Output Only] A key that provides more detail on the warning
  9949. // being returned. For example, for warnings where there are no results
  9950. // in a list request for a particular zone, this key might be scope and
  9951. // the key value might be the zone name. Other examples might be a key
  9952. // indicating a deprecated resource and a suggested replacement, or a
  9953. // warning about invalid network settings (for example, if an instance
  9954. // attempts to perform IP forwarding but is not enabled for IP
  9955. // forwarding).
  9956. Key string `json:"key,omitempty"`
  9957. // Value: [Output Only] A warning data value corresponding to the key.
  9958. Value string `json:"value,omitempty"`
  9959. // ForceSendFields is a list of field names (e.g. "Key") to
  9960. // unconditionally include in API requests. By default, fields with
  9961. // empty values are omitted from API requests. However, any non-pointer,
  9962. // non-interface field appearing in ForceSendFields will be sent to the
  9963. // server regardless of whether the field is empty or not. This may be
  9964. // used to include empty fields in Patch requests.
  9965. ForceSendFields []string `json:"-"`
  9966. // NullFields is a list of field names (e.g. "Key") to include in API
  9967. // requests with the JSON null value. By default, fields with empty
  9968. // values are omitted from API requests. However, any field with an
  9969. // empty value appearing in NullFields will be sent to the server as
  9970. // null. It is an error if a field in this list has a non-empty value.
  9971. // This may be used to include null fields in Patch requests.
  9972. NullFields []string `json:"-"`
  9973. }
  9974. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  9975. type NoMethod InstanceListReferrersWarningData
  9976. raw := NoMethod(*s)
  9977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9978. }
  9979. type InstanceMoveRequest struct {
  9980. // DestinationZone: The URL of the destination zone to move the
  9981. // instance. This can be a full or partial URL. For example, the
  9982. // following are all valid URLs to a zone:
  9983. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  9984. //
  9985. // - projects/project/zones/zone
  9986. // - zones/zone
  9987. DestinationZone string `json:"destinationZone,omitempty"`
  9988. // TargetInstance: The URL of the target instance to move. This can be a
  9989. // full or partial URL. For example, the following are all valid URLs to
  9990. // an instance:
  9991. // -
  9992. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  9993. // - projects/project/zones/zone/instances/instance
  9994. // - zones/zone/instances/instance
  9995. TargetInstance string `json:"targetInstance,omitempty"`
  9996. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  9997. // unconditionally include in API requests. By default, fields with
  9998. // empty values are omitted from API requests. However, any non-pointer,
  9999. // non-interface field appearing in ForceSendFields will be sent to the
  10000. // server regardless of whether the field is empty or not. This may be
  10001. // used to include empty fields in Patch requests.
  10002. ForceSendFields []string `json:"-"`
  10003. // NullFields is a list of field names (e.g. "DestinationZone") to
  10004. // include in API requests with the JSON null value. By default, fields
  10005. // with empty values are omitted from API requests. However, any field
  10006. // with an empty value appearing in NullFields will be sent to the
  10007. // server as null. It is an error if a field in this list has a
  10008. // non-empty value. This may be used to include null fields in Patch
  10009. // requests.
  10010. NullFields []string `json:"-"`
  10011. }
  10012. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  10013. type NoMethod InstanceMoveRequest
  10014. raw := NoMethod(*s)
  10015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10016. }
  10017. type InstanceProperties struct {
  10018. // CanIpForward: Enables instances created based on this template to
  10019. // send packets with source IP addresses other than their own and
  10020. // receive packets with destination IP addresses other than their own.
  10021. // If these instances will be used as an IP gateway or it will be set as
  10022. // the next-hop in a Route resource, specify true. If unsure, leave this
  10023. // set to false. See the Enable IP forwarding documentation for more
  10024. // information.
  10025. CanIpForward bool `json:"canIpForward,omitempty"`
  10026. // Description: An optional text description for the instances that are
  10027. // created from this instance template.
  10028. Description string `json:"description,omitempty"`
  10029. // Disks: An array of disks that are associated with the instances that
  10030. // are created from this template.
  10031. Disks []*AttachedDisk `json:"disks,omitempty"`
  10032. // GuestAccelerators: A list of guest accelerator cards' type and count
  10033. // to use for instances created from the instance template.
  10034. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10035. // Labels: Labels to apply to instances that are created from this
  10036. // template.
  10037. Labels map[string]string `json:"labels,omitempty"`
  10038. // MachineType: The machine type to use for instances that are created
  10039. // from this template.
  10040. MachineType string `json:"machineType,omitempty"`
  10041. // Metadata: The metadata key/value pairs to assign to instances that
  10042. // are created from this template. These pairs can consist of custom
  10043. // metadata or predefined keys. See Project and instance metadata for
  10044. // more information.
  10045. Metadata *Metadata `json:"metadata,omitempty"`
  10046. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  10047. // instance may be scheduled on the specified or newer cpu/platform.
  10048. // Applicable values are the friendly names of CPU platforms, such as
  10049. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  10050. // Bridge". For more information, read Specifying a Minimum CPU
  10051. // Platform.
  10052. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10053. // NetworkInterfaces: An array of network access configurations for this
  10054. // interface.
  10055. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  10056. // Scheduling: Specifies the scheduling options for the instances that
  10057. // are created from this template.
  10058. Scheduling *Scheduling `json:"scheduling,omitempty"`
  10059. // ServiceAccounts: A list of service accounts with specified scopes.
  10060. // Access tokens for these service accounts are available to the
  10061. // instances that are created from this template. Use metadata queries
  10062. // to obtain the access tokens for these instances.
  10063. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  10064. // Tags: A list of tags to apply to the instances that are created from
  10065. // this template. The tags identify valid sources or targets for network
  10066. // firewalls. The setTags method can modify this list of tags. Each tag
  10067. // within the list must comply with RFC1035.
  10068. Tags *Tags `json:"tags,omitempty"`
  10069. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  10070. // unconditionally include in API requests. By default, fields with
  10071. // empty values are omitted from API requests. However, any non-pointer,
  10072. // non-interface field appearing in ForceSendFields will be sent to the
  10073. // server regardless of whether the field is empty or not. This may be
  10074. // used to include empty fields in Patch requests.
  10075. ForceSendFields []string `json:"-"`
  10076. // NullFields is a list of field names (e.g. "CanIpForward") to include
  10077. // in API requests with the JSON null value. By default, fields with
  10078. // empty values are omitted from API requests. However, any field with
  10079. // an empty value appearing in NullFields will be sent to the server as
  10080. // null. It is an error if a field in this list has a non-empty value.
  10081. // This may be used to include null fields in Patch requests.
  10082. NullFields []string `json:"-"`
  10083. }
  10084. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  10085. type NoMethod InstanceProperties
  10086. raw := NoMethod(*s)
  10087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10088. }
  10089. type InstanceReference struct {
  10090. // Instance: The URL for a specific instance.
  10091. Instance string `json:"instance,omitempty"`
  10092. // ForceSendFields is a list of field names (e.g. "Instance") to
  10093. // unconditionally include in API requests. By default, fields with
  10094. // empty values are omitted from API requests. However, any non-pointer,
  10095. // non-interface field appearing in ForceSendFields will be sent to the
  10096. // server regardless of whether the field is empty or not. This may be
  10097. // used to include empty fields in Patch requests.
  10098. ForceSendFields []string `json:"-"`
  10099. // NullFields is a list of field names (e.g. "Instance") to include in
  10100. // API requests with the JSON null value. By default, fields with empty
  10101. // values are omitted from API requests. However, any field with an
  10102. // empty value appearing in NullFields will be sent to the server as
  10103. // null. It is an error if a field in this list has a non-empty value.
  10104. // This may be used to include null fields in Patch requests.
  10105. NullFields []string `json:"-"`
  10106. }
  10107. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  10108. type NoMethod InstanceReference
  10109. raw := NoMethod(*s)
  10110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10111. }
  10112. // InstanceTemplate: An Instance Template resource. (== resource_for
  10113. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  10114. type InstanceTemplate struct {
  10115. // CreationTimestamp: [Output Only] The creation timestamp for this
  10116. // instance template in RFC3339 text format.
  10117. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10118. // Description: An optional description of this resource. Provide this
  10119. // property when you create the resource.
  10120. Description string `json:"description,omitempty"`
  10121. // Id: [Output Only] A unique identifier for this instance template. The
  10122. // server defines this identifier.
  10123. Id uint64 `json:"id,omitempty,string"`
  10124. // Kind: [Output Only] The resource type, which is always
  10125. // compute#instanceTemplate for instance templates.
  10126. Kind string `json:"kind,omitempty"`
  10127. // Name: Name of the resource; provided by the client when the resource
  10128. // is created. The name must be 1-63 characters long, and comply with
  10129. // RFC1035. Specifically, the name must be 1-63 characters long and
  10130. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10131. // the first character must be a lowercase letter, and all following
  10132. // characters must be a dash, lowercase letter, or digit, except the
  10133. // last character, which cannot be a dash.
  10134. Name string `json:"name,omitempty"`
  10135. // Properties: The instance properties for this instance template.
  10136. Properties *InstanceProperties `json:"properties,omitempty"`
  10137. // SelfLink: [Output Only] The URL for this instance template. The
  10138. // server defines this URL.
  10139. SelfLink string `json:"selfLink,omitempty"`
  10140. // SourceInstance: The source instance used to create the template. You
  10141. // can provide this as a partial or full URL to the resource. For
  10142. // example, the following are valid values:
  10143. // -
  10144. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10145. // - projects/project/zones/zone/instances/instance
  10146. SourceInstance string `json:"sourceInstance,omitempty"`
  10147. // SourceInstanceParams: The source instance params to use to create
  10148. // this instance template.
  10149. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  10150. // ServerResponse contains the HTTP response code and headers from the
  10151. // server.
  10152. googleapi.ServerResponse `json:"-"`
  10153. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10154. // to unconditionally include in API requests. By default, fields with
  10155. // empty values are omitted from API requests. However, any non-pointer,
  10156. // non-interface field appearing in ForceSendFields will be sent to the
  10157. // server regardless of whether the field is empty or not. This may be
  10158. // used to include empty fields in Patch requests.
  10159. ForceSendFields []string `json:"-"`
  10160. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10161. // include in API requests with the JSON null value. By default, fields
  10162. // with empty values are omitted from API requests. However, any field
  10163. // with an empty value appearing in NullFields will be sent to the
  10164. // server as null. It is an error if a field in this list has a
  10165. // non-empty value. This may be used to include null fields in Patch
  10166. // requests.
  10167. NullFields []string `json:"-"`
  10168. }
  10169. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  10170. type NoMethod InstanceTemplate
  10171. raw := NoMethod(*s)
  10172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10173. }
  10174. // InstanceTemplateList: A list of instance templates.
  10175. type InstanceTemplateList struct {
  10176. // Id: [Output Only] Unique identifier for the resource; defined by the
  10177. // server.
  10178. Id string `json:"id,omitempty"`
  10179. // Items: A list of InstanceTemplate resources.
  10180. Items []*InstanceTemplate `json:"items,omitempty"`
  10181. // Kind: [Output Only] The resource type, which is always
  10182. // compute#instanceTemplatesListResponse for instance template lists.
  10183. Kind string `json:"kind,omitempty"`
  10184. // NextPageToken: [Output Only] This token allows you to get the next
  10185. // page of results for list requests. If the number of results is larger
  10186. // than maxResults, use the nextPageToken as a value for the query
  10187. // parameter pageToken in the next list request. Subsequent list
  10188. // requests will have their own nextPageToken to continue paging through
  10189. // the results.
  10190. NextPageToken string `json:"nextPageToken,omitempty"`
  10191. // SelfLink: [Output Only] Server-defined URL for this resource.
  10192. SelfLink string `json:"selfLink,omitempty"`
  10193. // Warning: [Output Only] Informational warning message.
  10194. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  10195. // ServerResponse contains the HTTP response code and headers from the
  10196. // server.
  10197. googleapi.ServerResponse `json:"-"`
  10198. // ForceSendFields is a list of field names (e.g. "Id") to
  10199. // unconditionally include in API requests. By default, fields with
  10200. // empty values are omitted from API requests. However, any non-pointer,
  10201. // non-interface field appearing in ForceSendFields will be sent to the
  10202. // server regardless of whether the field is empty or not. This may be
  10203. // used to include empty fields in Patch requests.
  10204. ForceSendFields []string `json:"-"`
  10205. // NullFields is a list of field names (e.g. "Id") to include in API
  10206. // requests with the JSON null value. By default, fields with empty
  10207. // values are omitted from API requests. However, any field with an
  10208. // empty value appearing in NullFields will be sent to the server as
  10209. // null. It is an error if a field in this list has a non-empty value.
  10210. // This may be used to include null fields in Patch requests.
  10211. NullFields []string `json:"-"`
  10212. }
  10213. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  10214. type NoMethod InstanceTemplateList
  10215. raw := NoMethod(*s)
  10216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10217. }
  10218. // InstanceTemplateListWarning: [Output Only] Informational warning
  10219. // message.
  10220. type InstanceTemplateListWarning struct {
  10221. // Code: [Output Only] A warning code, if applicable. For example,
  10222. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10223. // the response.
  10224. //
  10225. // Possible values:
  10226. // "CLEANUP_FAILED"
  10227. // "DEPRECATED_RESOURCE_USED"
  10228. // "DEPRECATED_TYPE_USED"
  10229. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10230. // "EXPERIMENTAL_TYPE_USED"
  10231. // "EXTERNAL_API_WARNING"
  10232. // "FIELD_VALUE_OVERRIDEN"
  10233. // "INJECTED_KERNELS_DEPRECATED"
  10234. // "MISSING_TYPE_DEPENDENCY"
  10235. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10236. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10237. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10238. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10239. // "NEXT_HOP_NOT_RUNNING"
  10240. // "NOT_CRITICAL_ERROR"
  10241. // "NO_RESULTS_ON_PAGE"
  10242. // "REQUIRED_TOS_AGREEMENT"
  10243. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10244. // "RESOURCE_NOT_DELETED"
  10245. // "SCHEMA_VALIDATION_IGNORED"
  10246. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10247. // "UNDECLARED_PROPERTIES"
  10248. // "UNREACHABLE"
  10249. Code string `json:"code,omitempty"`
  10250. // Data: [Output Only] Metadata about this warning in key: value format.
  10251. // For example:
  10252. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10253. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  10254. // Message: [Output Only] A human-readable description of the warning
  10255. // code.
  10256. Message string `json:"message,omitempty"`
  10257. // ForceSendFields is a list of field names (e.g. "Code") to
  10258. // unconditionally include in API requests. By default, fields with
  10259. // empty values are omitted from API requests. However, any non-pointer,
  10260. // non-interface field appearing in ForceSendFields will be sent to the
  10261. // server regardless of whether the field is empty or not. This may be
  10262. // used to include empty fields in Patch requests.
  10263. ForceSendFields []string `json:"-"`
  10264. // NullFields is a list of field names (e.g. "Code") to include in API
  10265. // requests with the JSON null value. By default, fields with empty
  10266. // values are omitted from API requests. However, any field with an
  10267. // empty value appearing in NullFields will be sent to the server as
  10268. // null. It is an error if a field in this list has a non-empty value.
  10269. // This may be used to include null fields in Patch requests.
  10270. NullFields []string `json:"-"`
  10271. }
  10272. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  10273. type NoMethod InstanceTemplateListWarning
  10274. raw := NoMethod(*s)
  10275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10276. }
  10277. type InstanceTemplateListWarningData struct {
  10278. // Key: [Output Only] A key that provides more detail on the warning
  10279. // being returned. For example, for warnings where there are no results
  10280. // in a list request for a particular zone, this key might be scope and
  10281. // the key value might be the zone name. Other examples might be a key
  10282. // indicating a deprecated resource and a suggested replacement, or a
  10283. // warning about invalid network settings (for example, if an instance
  10284. // attempts to perform IP forwarding but is not enabled for IP
  10285. // forwarding).
  10286. Key string `json:"key,omitempty"`
  10287. // Value: [Output Only] A warning data value corresponding to the key.
  10288. Value string `json:"value,omitempty"`
  10289. // ForceSendFields is a list of field names (e.g. "Key") to
  10290. // unconditionally include in API requests. By default, fields with
  10291. // empty values are omitted from API requests. However, any non-pointer,
  10292. // non-interface field appearing in ForceSendFields will be sent to the
  10293. // server regardless of whether the field is empty or not. This may be
  10294. // used to include empty fields in Patch requests.
  10295. ForceSendFields []string `json:"-"`
  10296. // NullFields is a list of field names (e.g. "Key") to include in API
  10297. // requests with the JSON null value. By default, fields with empty
  10298. // values are omitted from API requests. However, any field with an
  10299. // empty value appearing in NullFields will be sent to the server as
  10300. // null. It is an error if a field in this list has a non-empty value.
  10301. // This may be used to include null fields in Patch requests.
  10302. NullFields []string `json:"-"`
  10303. }
  10304. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  10305. type NoMethod InstanceTemplateListWarningData
  10306. raw := NoMethod(*s)
  10307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10308. }
  10309. type InstanceWithNamedPorts struct {
  10310. // Instance: [Output Only] The URL of the instance.
  10311. Instance string `json:"instance,omitempty"`
  10312. // NamedPorts: [Output Only] The named ports that belong to this
  10313. // instance group.
  10314. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10315. // Status: [Output Only] The status of the instance.
  10316. //
  10317. // Possible values:
  10318. // "PROVISIONING"
  10319. // "RUNNING"
  10320. // "STAGING"
  10321. // "STOPPED"
  10322. // "STOPPING"
  10323. // "SUSPENDED"
  10324. // "SUSPENDING"
  10325. // "TERMINATED"
  10326. Status string `json:"status,omitempty"`
  10327. // ForceSendFields is a list of field names (e.g. "Instance") to
  10328. // unconditionally include in API requests. By default, fields with
  10329. // empty values are omitted from API requests. However, any non-pointer,
  10330. // non-interface field appearing in ForceSendFields will be sent to the
  10331. // server regardless of whether the field is empty or not. This may be
  10332. // used to include empty fields in Patch requests.
  10333. ForceSendFields []string `json:"-"`
  10334. // NullFields is a list of field names (e.g. "Instance") to include in
  10335. // API requests with the JSON null value. By default, fields with empty
  10336. // values are omitted from API requests. However, any field with an
  10337. // empty value appearing in NullFields will be sent to the server as
  10338. // null. It is an error if a field in this list has a non-empty value.
  10339. // This may be used to include null fields in Patch requests.
  10340. NullFields []string `json:"-"`
  10341. }
  10342. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  10343. type NoMethod InstanceWithNamedPorts
  10344. raw := NoMethod(*s)
  10345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10346. }
  10347. type InstancesScopedList struct {
  10348. // Instances: [Output Only] A list of instances contained in this scope.
  10349. Instances []*Instance `json:"instances,omitempty"`
  10350. // Warning: [Output Only] Informational warning which replaces the list
  10351. // of instances when the list is empty.
  10352. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  10353. // ForceSendFields is a list of field names (e.g. "Instances") to
  10354. // unconditionally include in API requests. By default, fields with
  10355. // empty values are omitted from API requests. However, any non-pointer,
  10356. // non-interface field appearing in ForceSendFields will be sent to the
  10357. // server regardless of whether the field is empty or not. This may be
  10358. // used to include empty fields in Patch requests.
  10359. ForceSendFields []string `json:"-"`
  10360. // NullFields is a list of field names (e.g. "Instances") to include in
  10361. // API requests with the JSON null value. By default, fields with empty
  10362. // values are omitted from API requests. However, any field with an
  10363. // empty value appearing in NullFields will be sent to the server as
  10364. // null. It is an error if a field in this list has a non-empty value.
  10365. // This may be used to include null fields in Patch requests.
  10366. NullFields []string `json:"-"`
  10367. }
  10368. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  10369. type NoMethod InstancesScopedList
  10370. raw := NoMethod(*s)
  10371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10372. }
  10373. // InstancesScopedListWarning: [Output Only] Informational warning which
  10374. // replaces the list of instances when the list is empty.
  10375. type InstancesScopedListWarning struct {
  10376. // Code: [Output Only] A warning code, if applicable. For example,
  10377. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10378. // the response.
  10379. //
  10380. // Possible values:
  10381. // "CLEANUP_FAILED"
  10382. // "DEPRECATED_RESOURCE_USED"
  10383. // "DEPRECATED_TYPE_USED"
  10384. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10385. // "EXPERIMENTAL_TYPE_USED"
  10386. // "EXTERNAL_API_WARNING"
  10387. // "FIELD_VALUE_OVERRIDEN"
  10388. // "INJECTED_KERNELS_DEPRECATED"
  10389. // "MISSING_TYPE_DEPENDENCY"
  10390. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10391. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10392. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10393. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10394. // "NEXT_HOP_NOT_RUNNING"
  10395. // "NOT_CRITICAL_ERROR"
  10396. // "NO_RESULTS_ON_PAGE"
  10397. // "REQUIRED_TOS_AGREEMENT"
  10398. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10399. // "RESOURCE_NOT_DELETED"
  10400. // "SCHEMA_VALIDATION_IGNORED"
  10401. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10402. // "UNDECLARED_PROPERTIES"
  10403. // "UNREACHABLE"
  10404. Code string `json:"code,omitempty"`
  10405. // Data: [Output Only] Metadata about this warning in key: value format.
  10406. // For example:
  10407. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10408. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  10409. // Message: [Output Only] A human-readable description of the warning
  10410. // code.
  10411. Message string `json:"message,omitempty"`
  10412. // ForceSendFields is a list of field names (e.g. "Code") to
  10413. // unconditionally include in API requests. By default, fields with
  10414. // empty values are omitted from API requests. However, any non-pointer,
  10415. // non-interface field appearing in ForceSendFields will be sent to the
  10416. // server regardless of whether the field is empty or not. This may be
  10417. // used to include empty fields in Patch requests.
  10418. ForceSendFields []string `json:"-"`
  10419. // NullFields is a list of field names (e.g. "Code") to include in API
  10420. // requests with the JSON null value. By default, fields with empty
  10421. // values are omitted from API requests. However, any field with an
  10422. // empty value appearing in NullFields will be sent to the server as
  10423. // null. It is an error if a field in this list has a non-empty value.
  10424. // This may be used to include null fields in Patch requests.
  10425. NullFields []string `json:"-"`
  10426. }
  10427. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  10428. type NoMethod InstancesScopedListWarning
  10429. raw := NoMethod(*s)
  10430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10431. }
  10432. type InstancesScopedListWarningData struct {
  10433. // Key: [Output Only] A key that provides more detail on the warning
  10434. // being returned. For example, for warnings where there are no results
  10435. // in a list request for a particular zone, this key might be scope and
  10436. // the key value might be the zone name. Other examples might be a key
  10437. // indicating a deprecated resource and a suggested replacement, or a
  10438. // warning about invalid network settings (for example, if an instance
  10439. // attempts to perform IP forwarding but is not enabled for IP
  10440. // forwarding).
  10441. Key string `json:"key,omitempty"`
  10442. // Value: [Output Only] A warning data value corresponding to the key.
  10443. Value string `json:"value,omitempty"`
  10444. // ForceSendFields is a list of field names (e.g. "Key") to
  10445. // unconditionally include in API requests. By default, fields with
  10446. // empty values are omitted from API requests. However, any non-pointer,
  10447. // non-interface field appearing in ForceSendFields will be sent to the
  10448. // server regardless of whether the field is empty or not. This may be
  10449. // used to include empty fields in Patch requests.
  10450. ForceSendFields []string `json:"-"`
  10451. // NullFields is a list of field names (e.g. "Key") to include in API
  10452. // requests with the JSON null value. By default, fields with empty
  10453. // values are omitted from API requests. However, any field with an
  10454. // empty value appearing in NullFields will be sent to the server as
  10455. // null. It is an error if a field in this list has a non-empty value.
  10456. // This may be used to include null fields in Patch requests.
  10457. NullFields []string `json:"-"`
  10458. }
  10459. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  10460. type NoMethod InstancesScopedListWarningData
  10461. raw := NoMethod(*s)
  10462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10463. }
  10464. type InstancesSetLabelsRequest struct {
  10465. // LabelFingerprint: Fingerprint of the previous set of labels for this
  10466. // resource, used to prevent conflicts. Provide the latest fingerprint
  10467. // value when making a request to add or change labels.
  10468. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  10469. Labels map[string]string `json:"labels,omitempty"`
  10470. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  10471. // unconditionally include in API requests. By default, fields with
  10472. // empty values are omitted from API requests. However, any non-pointer,
  10473. // non-interface field appearing in ForceSendFields will be sent to the
  10474. // server regardless of whether the field is empty or not. This may be
  10475. // used to include empty fields in Patch requests.
  10476. ForceSendFields []string `json:"-"`
  10477. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  10478. // include in API requests with the JSON null value. By default, fields
  10479. // with empty values are omitted from API requests. However, any field
  10480. // with an empty value appearing in NullFields will be sent to the
  10481. // server as null. It is an error if a field in this list has a
  10482. // non-empty value. This may be used to include null fields in Patch
  10483. // requests.
  10484. NullFields []string `json:"-"`
  10485. }
  10486. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  10487. type NoMethod InstancesSetLabelsRequest
  10488. raw := NoMethod(*s)
  10489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10490. }
  10491. type InstancesSetMachineResourcesRequest struct {
  10492. // GuestAccelerators: A list of the type and count of accelerator cards
  10493. // attached to the instance.
  10494. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10495. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  10496. // to unconditionally include in API requests. By default, fields with
  10497. // empty values are omitted from API requests. However, any non-pointer,
  10498. // non-interface field appearing in ForceSendFields will be sent to the
  10499. // server regardless of whether the field is empty or not. This may be
  10500. // used to include empty fields in Patch requests.
  10501. ForceSendFields []string `json:"-"`
  10502. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  10503. // include in API requests with the JSON null value. By default, fields
  10504. // with empty values are omitted from API requests. However, any field
  10505. // with an empty value appearing in NullFields will be sent to the
  10506. // server as null. It is an error if a field in this list has a
  10507. // non-empty value. This may be used to include null fields in Patch
  10508. // requests.
  10509. NullFields []string `json:"-"`
  10510. }
  10511. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  10512. type NoMethod InstancesSetMachineResourcesRequest
  10513. raw := NoMethod(*s)
  10514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10515. }
  10516. type InstancesSetMachineTypeRequest struct {
  10517. // MachineType: Full or partial URL of the machine type resource. See
  10518. // Machine Types for a full list of machine types. For example:
  10519. // zones/us-central1-f/machineTypes/n1-standard-1
  10520. MachineType string `json:"machineType,omitempty"`
  10521. // ForceSendFields is a list of field names (e.g. "MachineType") to
  10522. // unconditionally include in API requests. By default, fields with
  10523. // empty values are omitted from API requests. However, any non-pointer,
  10524. // non-interface field appearing in ForceSendFields will be sent to the
  10525. // server regardless of whether the field is empty or not. This may be
  10526. // used to include empty fields in Patch requests.
  10527. ForceSendFields []string `json:"-"`
  10528. // NullFields is a list of field names (e.g. "MachineType") to include
  10529. // in API requests with the JSON null value. By default, fields with
  10530. // empty values are omitted from API requests. However, any field with
  10531. // an empty value appearing in NullFields will be sent to the server as
  10532. // null. It is an error if a field in this list has a non-empty value.
  10533. // This may be used to include null fields in Patch requests.
  10534. NullFields []string `json:"-"`
  10535. }
  10536. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  10537. type NoMethod InstancesSetMachineTypeRequest
  10538. raw := NoMethod(*s)
  10539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10540. }
  10541. type InstancesSetMinCpuPlatformRequest struct {
  10542. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  10543. // at.
  10544. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10545. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  10546. // unconditionally include in API requests. By default, fields with
  10547. // empty values are omitted from API requests. However, any non-pointer,
  10548. // non-interface field appearing in ForceSendFields will be sent to the
  10549. // server regardless of whether the field is empty or not. This may be
  10550. // used to include empty fields in Patch requests.
  10551. ForceSendFields []string `json:"-"`
  10552. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  10553. // include in API requests with the JSON null value. By default, fields
  10554. // with empty values are omitted from API requests. However, any field
  10555. // with an empty value appearing in NullFields will be sent to the
  10556. // server as null. It is an error if a field in this list has a
  10557. // non-empty value. This may be used to include null fields in Patch
  10558. // requests.
  10559. NullFields []string `json:"-"`
  10560. }
  10561. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  10562. type NoMethod InstancesSetMinCpuPlatformRequest
  10563. raw := NoMethod(*s)
  10564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10565. }
  10566. type InstancesSetServiceAccountRequest struct {
  10567. // Email: Email address of the service account.
  10568. Email string `json:"email,omitempty"`
  10569. // Scopes: The list of scopes to be made available for this service
  10570. // account.
  10571. Scopes []string `json:"scopes,omitempty"`
  10572. // ForceSendFields is a list of field names (e.g. "Email") to
  10573. // unconditionally include in API requests. By default, fields with
  10574. // empty values are omitted from API requests. However, any non-pointer,
  10575. // non-interface field appearing in ForceSendFields will be sent to the
  10576. // server regardless of whether the field is empty or not. This may be
  10577. // used to include empty fields in Patch requests.
  10578. ForceSendFields []string `json:"-"`
  10579. // NullFields is a list of field names (e.g. "Email") to include in API
  10580. // requests with the JSON null value. By default, fields with empty
  10581. // values are omitted from API requests. However, any field with an
  10582. // empty value appearing in NullFields will be sent to the server as
  10583. // null. It is an error if a field in this list has a non-empty value.
  10584. // This may be used to include null fields in Patch requests.
  10585. NullFields []string `json:"-"`
  10586. }
  10587. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  10588. type NoMethod InstancesSetServiceAccountRequest
  10589. raw := NoMethod(*s)
  10590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10591. }
  10592. type InstancesStartWithEncryptionKeyRequest struct {
  10593. // Disks: Array of disks associated with this instance that are
  10594. // protected with a customer-supplied encryption key.
  10595. //
  10596. // In order to start the instance, the disk url and its corresponding
  10597. // key must be provided.
  10598. //
  10599. // If the disk is not protected with a customer-supplied encryption key
  10600. // it should not be specified.
  10601. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  10602. // ForceSendFields is a list of field names (e.g. "Disks") to
  10603. // unconditionally include in API requests. By default, fields with
  10604. // empty values are omitted from API requests. However, any non-pointer,
  10605. // non-interface field appearing in ForceSendFields will be sent to the
  10606. // server regardless of whether the field is empty or not. This may be
  10607. // used to include empty fields in Patch requests.
  10608. ForceSendFields []string `json:"-"`
  10609. // NullFields is a list of field names (e.g. "Disks") to include in API
  10610. // requests with the JSON null value. By default, fields with empty
  10611. // values are omitted from API requests. However, any field with an
  10612. // empty value appearing in NullFields will be sent to the server as
  10613. // null. It is an error if a field in this list has a non-empty value.
  10614. // This may be used to include null fields in Patch requests.
  10615. NullFields []string `json:"-"`
  10616. }
  10617. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  10618. type NoMethod InstancesStartWithEncryptionKeyRequest
  10619. raw := NoMethod(*s)
  10620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10621. }
  10622. // Interconnect: Represents an Interconnects resource. The Interconnects
  10623. // resource is a dedicated connection between Google's network and your
  10624. // on-premises network. For more information, see the Dedicated
  10625. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  10626. // beta.interconnects ==)
  10627. type Interconnect struct {
  10628. // AdminEnabled: Administrative status of the interconnect. When this is
  10629. // set to true, the Interconnect is functional and can carry traffic.
  10630. // When set to false, no packets can be carried over the interconnect
  10631. // and no BGP routes are exchanged over it. By default, the status is
  10632. // set to true.
  10633. AdminEnabled bool `json:"adminEnabled,omitempty"`
  10634. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  10635. // describe the individual circuits in this LAG.
  10636. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  10637. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10638. // format.
  10639. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10640. // CustomerName: Customer name, to put in the Letter of Authorization as
  10641. // the party authorized to request a crossconnect.
  10642. CustomerName string `json:"customerName,omitempty"`
  10643. // Description: An optional description of this resource. Provide this
  10644. // property when you create the resource.
  10645. Description string `json:"description,omitempty"`
  10646. // ExpectedOutages: [Output Only] A list of outages expected for this
  10647. // Interconnect.
  10648. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  10649. // GoogleIpAddress: [Output Only] IP address configured on the Google
  10650. // side of the Interconnect link. This can be used only for ping tests.
  10651. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  10652. // GoogleReferenceId: [Output Only] Google reference ID; to be used when
  10653. // raising support tickets with Google or otherwise to debug backend
  10654. // connectivity issues.
  10655. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  10656. // Id: [Output Only] The unique identifier for the resource. This
  10657. // identifier is defined by the server.
  10658. Id uint64 `json:"id,omitempty,string"`
  10659. // InterconnectAttachments: [Output Only] A list of the URLs of all
  10660. // InterconnectAttachments configured to use this Interconnect.
  10661. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  10662. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  10663. // been deprecated in favor of "DEDICATED"
  10664. //
  10665. // Possible values:
  10666. // "DEDICATED"
  10667. // "IT_PRIVATE"
  10668. // "PARTNER"
  10669. InterconnectType string `json:"interconnectType,omitempty"`
  10670. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  10671. // for interconnects.
  10672. Kind string `json:"kind,omitempty"`
  10673. // LinkType: Type of link requested. This field indicates speed of each
  10674. // of the links in the bundle, not the entire bundle. Only 10G per link
  10675. // is allowed for a dedicated interconnect. Options: Ethernet_10G_LR
  10676. //
  10677. // Possible values:
  10678. // "LINK_TYPE_ETHERNET_10G_LR"
  10679. LinkType string `json:"linkType,omitempty"`
  10680. // Location: URL of the InterconnectLocation object that represents
  10681. // where this connection is to be provisioned.
  10682. Location string `json:"location,omitempty"`
  10683. // Name: Name of the resource. Provided by the client when the resource
  10684. // is created. The name must be 1-63 characters long, and comply with
  10685. // RFC1035. Specifically, the name must be 1-63 characters long and
  10686. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10687. // the first character must be a lowercase letter, and all following
  10688. // characters must be a dash, lowercase letter, or digit, except the
  10689. // last character, which cannot be a dash.
  10690. Name string `json:"name,omitempty"`
  10691. // NocContactEmail: Email address to contact the customer NOC for
  10692. // operations and maintenance notifications regarding this Interconnect.
  10693. // If specified, this will be used for notifications in addition to all
  10694. // other forms described, such as Stackdriver logs alerting and Cloud
  10695. // Notifications.
  10696. NocContactEmail string `json:"nocContactEmail,omitempty"`
  10697. // OperationalStatus: [Output Only] The current status of whether or not
  10698. // this Interconnect is functional.
  10699. //
  10700. // Possible values:
  10701. // "OS_ACTIVE"
  10702. // "OS_UNPROVISIONED"
  10703. OperationalStatus string `json:"operationalStatus,omitempty"`
  10704. // PeerIpAddress: [Output Only] IP address configured on the customer
  10705. // side of the Interconnect link. The customer should configure this IP
  10706. // address during turnup when prompted by Google NOC. This can be used
  10707. // only for ping tests.
  10708. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  10709. // ProvisionedLinkCount: [Output Only] Number of links actually
  10710. // provisioned in this interconnect.
  10711. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  10712. // RequestedLinkCount: Target number of physical links in the link
  10713. // bundle, as requested by the customer.
  10714. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  10715. // SelfLink: [Output Only] Server-defined URL for the resource.
  10716. SelfLink string `json:"selfLink,omitempty"`
  10717. // State: [Output Only] The current state of whether or not this
  10718. // Interconnect is functional.
  10719. //
  10720. // Possible values:
  10721. // "ACTIVE"
  10722. // "UNPROVISIONED"
  10723. State string `json:"state,omitempty"`
  10724. // ServerResponse contains the HTTP response code and headers from the
  10725. // server.
  10726. googleapi.ServerResponse `json:"-"`
  10727. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  10728. // unconditionally include in API requests. By default, fields with
  10729. // empty values are omitted from API requests. However, any non-pointer,
  10730. // non-interface field appearing in ForceSendFields will be sent to the
  10731. // server regardless of whether the field is empty or not. This may be
  10732. // used to include empty fields in Patch requests.
  10733. ForceSendFields []string `json:"-"`
  10734. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  10735. // in API requests with the JSON null value. By default, fields with
  10736. // empty values are omitted from API requests. However, any field with
  10737. // an empty value appearing in NullFields will be sent to the server as
  10738. // null. It is an error if a field in this list has a non-empty value.
  10739. // This may be used to include null fields in Patch requests.
  10740. NullFields []string `json:"-"`
  10741. }
  10742. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  10743. type NoMethod Interconnect
  10744. raw := NoMethod(*s)
  10745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10746. }
  10747. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  10748. // attachment) resource. For more information, see Creating VLAN
  10749. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  10750. // resource_for v1.interconnectAttachments ==)
  10751. type InterconnectAttachment struct {
  10752. // AdminEnabled: Determines whether this Attachment will carry packets.
  10753. // Not present for PARTNER_PROVIDER.
  10754. AdminEnabled bool `json:"adminEnabled,omitempty"`
  10755. // Bandwidth: Provisioned bandwidth capacity for the
  10756. // interconnectAttachment. Can be set by the partner to update the
  10757. // customer's provisioned bandwidth. Output only for PARTNER type,
  10758. // mutable for PARTNER_PROVIDER and DEDICATED.
  10759. //
  10760. // Possible values:
  10761. // "BPS_100M"
  10762. // "BPS_10G"
  10763. // "BPS_1G"
  10764. // "BPS_200M"
  10765. // "BPS_2G"
  10766. // "BPS_300M"
  10767. // "BPS_400M"
  10768. // "BPS_500M"
  10769. // "BPS_50M"
  10770. // "BPS_5G"
  10771. Bandwidth string `json:"bandwidth,omitempty"`
  10772. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  10773. // restrict the allocation of cloudRouterIpAddress and
  10774. // customerRouterIpAddress for this attachment. All prefixes must be
  10775. // within link-local address space (169.254.0.0/16) and must be /29 or
  10776. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  10777. // from the supplied candidate prefix(es). The request will fail if all
  10778. // possible /29s are in use on Google?s edge. If not supplied, Google
  10779. // will randomly select an unused /29 from all of link-local space.
  10780. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  10781. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  10782. // be configured on Cloud Router Interface for this interconnect
  10783. // attachment.
  10784. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  10785. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10786. // format.
  10787. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10788. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  10789. // to be configured on the customer router subinterface for this
  10790. // interconnect attachment.
  10791. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  10792. // Description: An optional description of this resource.
  10793. Description string `json:"description,omitempty"`
  10794. // EdgeAvailabilityDomain: Desired availability domain for the
  10795. // attachment. Only available for type PARTNER, at creation time. For
  10796. // improved reliability, customers should configure a pair of
  10797. // attachments with one per availability domain. The selected
  10798. // availability domain will be provided to the Partner via the pairing
  10799. // key so that the provisioned circuit will lie in the specified domain.
  10800. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  10801. //
  10802. // Possible values:
  10803. // "AVAILABILITY_DOMAIN_1"
  10804. // "AVAILABILITY_DOMAIN_2"
  10805. // "AVAILABILITY_DOMAIN_ANY"
  10806. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  10807. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  10808. // raising support tickets with Google or otherwise to debug backend
  10809. // connectivity issues.
  10810. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  10811. // Id: [Output Only] The unique identifier for the resource. This
  10812. // identifier is defined by the server.
  10813. Id uint64 `json:"id,omitempty,string"`
  10814. // Interconnect: URL of the underlying Interconnect object that this
  10815. // attachment's traffic will traverse through.
  10816. Interconnect string `json:"interconnect,omitempty"`
  10817. // Kind: [Output Only] Type of the resource. Always
  10818. // compute#interconnectAttachment for interconnect attachments.
  10819. Kind string `json:"kind,omitempty"`
  10820. // Name: Name of the resource. Provided by the client when the resource
  10821. // is created. The name must be 1-63 characters long, and comply with
  10822. // RFC1035. Specifically, the name must be 1-63 characters long and
  10823. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10824. // the first character must be a lowercase letter, and all following
  10825. // characters must be a dash, lowercase letter, or digit, except the
  10826. // last character, which cannot be a dash.
  10827. Name string `json:"name,omitempty"`
  10828. // OperationalStatus: [Output Only] The current status of whether or not
  10829. // this interconnect attachment is functional.
  10830. //
  10831. // Possible values:
  10832. // "OS_ACTIVE"
  10833. // "OS_UNPROVISIONED"
  10834. OperationalStatus string `json:"operationalStatus,omitempty"`
  10835. // PairingKey: [Output only for type PARTNER. Input only for
  10836. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  10837. // of an PARTNER attachment used to initiate provisioning with a
  10838. // selected partner. Of the form "XXXXX/region/domain"
  10839. PairingKey string `json:"pairingKey,omitempty"`
  10840. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  10841. // by a layer 3 Partner if they configured BGP on behalf of the
  10842. // customer. Output only for PARTNER type, input only for
  10843. // PARTNER_PROVIDER, not available for DEDICATED.
  10844. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  10845. // PartnerMetadata: Informational metadata about Partner attachments
  10846. // from Partners to display to customers. Output only for for PARTNER
  10847. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  10848. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  10849. // PrivateInterconnectInfo: [Output Only] Information specific to an
  10850. // InterconnectAttachment. This property is populated if the
  10851. // interconnect that this is attached to is of type DEDICATED.
  10852. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  10853. // Region: [Output Only] URL of the region where the regional
  10854. // interconnect attachment resides. You must specify this field as part
  10855. // of the HTTP request URL. It is not settable as a field in the request
  10856. // body.
  10857. Region string `json:"region,omitempty"`
  10858. // Router: URL of the Cloud Router to be used for dynamic routing. This
  10859. // router must be in the same region as this InterconnectAttachment. The
  10860. // InterconnectAttachment will automatically connect the Interconnect to
  10861. // the network & region within which the Cloud Router is configured.
  10862. Router string `json:"router,omitempty"`
  10863. // SelfLink: [Output Only] Server-defined URL for the resource.
  10864. SelfLink string `json:"selfLink,omitempty"`
  10865. // State: [Output Only] The current state of this attachment's
  10866. // functionality.
  10867. //
  10868. // Possible values:
  10869. // "ACTIVE"
  10870. // "DEFUNCT"
  10871. // "PARTNER_REQUEST_RECEIVED"
  10872. // "PENDING_CUSTOMER"
  10873. // "PENDING_PARTNER"
  10874. // "STATE_UNSPECIFIED"
  10875. // "UNPROVISIONED"
  10876. State string `json:"state,omitempty"`
  10877. // Possible values:
  10878. // "DEDICATED"
  10879. // "PARTNER"
  10880. // "PARTNER_PROVIDER"
  10881. Type string `json:"type,omitempty"`
  10882. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  10883. // range 2-4094. Only specified at creation time.
  10884. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  10885. // ServerResponse contains the HTTP response code and headers from the
  10886. // server.
  10887. googleapi.ServerResponse `json:"-"`
  10888. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  10889. // unconditionally include in API requests. By default, fields with
  10890. // empty values are omitted from API requests. However, any non-pointer,
  10891. // non-interface field appearing in ForceSendFields will be sent to the
  10892. // server regardless of whether the field is empty or not. This may be
  10893. // used to include empty fields in Patch requests.
  10894. ForceSendFields []string `json:"-"`
  10895. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  10896. // in API requests with the JSON null value. By default, fields with
  10897. // empty values are omitted from API requests. However, any field with
  10898. // an empty value appearing in NullFields will be sent to the server as
  10899. // null. It is an error if a field in this list has a non-empty value.
  10900. // This may be used to include null fields in Patch requests.
  10901. NullFields []string `json:"-"`
  10902. }
  10903. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  10904. type NoMethod InterconnectAttachment
  10905. raw := NoMethod(*s)
  10906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10907. }
  10908. type InterconnectAttachmentAggregatedList struct {
  10909. // Id: [Output Only] Unique identifier for the resource; defined by the
  10910. // server.
  10911. Id string `json:"id,omitempty"`
  10912. // Items: A list of InterconnectAttachmentsScopedList resources.
  10913. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  10914. // Kind: [Output Only] Type of resource. Always
  10915. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  10916. // interconnect attachments.
  10917. Kind string `json:"kind,omitempty"`
  10918. // NextPageToken: [Output Only] This token allows you to get the next
  10919. // page of results for list requests. If the number of results is larger
  10920. // than maxResults, use the nextPageToken as a value for the query
  10921. // parameter pageToken in the next list request. Subsequent list
  10922. // requests will have their own nextPageToken to continue paging through
  10923. // the results.
  10924. NextPageToken string `json:"nextPageToken,omitempty"`
  10925. // SelfLink: [Output Only] Server-defined URL for this resource.
  10926. SelfLink string `json:"selfLink,omitempty"`
  10927. // Warning: [Output Only] Informational warning message.
  10928. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  10929. // ServerResponse contains the HTTP response code and headers from the
  10930. // server.
  10931. googleapi.ServerResponse `json:"-"`
  10932. // ForceSendFields is a list of field names (e.g. "Id") to
  10933. // unconditionally include in API requests. By default, fields with
  10934. // empty values are omitted from API requests. However, any non-pointer,
  10935. // non-interface field appearing in ForceSendFields will be sent to the
  10936. // server regardless of whether the field is empty or not. This may be
  10937. // used to include empty fields in Patch requests.
  10938. ForceSendFields []string `json:"-"`
  10939. // NullFields is a list of field names (e.g. "Id") to include in API
  10940. // requests with the JSON null value. By default, fields with empty
  10941. // values are omitted from API requests. However, any field with an
  10942. // empty value appearing in NullFields will be sent to the server as
  10943. // null. It is an error if a field in this list has a non-empty value.
  10944. // This may be used to include null fields in Patch requests.
  10945. NullFields []string `json:"-"`
  10946. }
  10947. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  10948. type NoMethod InterconnectAttachmentAggregatedList
  10949. raw := NoMethod(*s)
  10950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10951. }
  10952. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  10953. // Informational warning message.
  10954. type InterconnectAttachmentAggregatedListWarning struct {
  10955. // Code: [Output Only] A warning code, if applicable. For example,
  10956. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10957. // the response.
  10958. //
  10959. // Possible values:
  10960. // "CLEANUP_FAILED"
  10961. // "DEPRECATED_RESOURCE_USED"
  10962. // "DEPRECATED_TYPE_USED"
  10963. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10964. // "EXPERIMENTAL_TYPE_USED"
  10965. // "EXTERNAL_API_WARNING"
  10966. // "FIELD_VALUE_OVERRIDEN"
  10967. // "INJECTED_KERNELS_DEPRECATED"
  10968. // "MISSING_TYPE_DEPENDENCY"
  10969. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10970. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10971. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10972. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10973. // "NEXT_HOP_NOT_RUNNING"
  10974. // "NOT_CRITICAL_ERROR"
  10975. // "NO_RESULTS_ON_PAGE"
  10976. // "REQUIRED_TOS_AGREEMENT"
  10977. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10978. // "RESOURCE_NOT_DELETED"
  10979. // "SCHEMA_VALIDATION_IGNORED"
  10980. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10981. // "UNDECLARED_PROPERTIES"
  10982. // "UNREACHABLE"
  10983. Code string `json:"code,omitempty"`
  10984. // Data: [Output Only] Metadata about this warning in key: value format.
  10985. // For example:
  10986. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10987. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  10988. // Message: [Output Only] A human-readable description of the warning
  10989. // code.
  10990. Message string `json:"message,omitempty"`
  10991. // ForceSendFields is a list of field names (e.g. "Code") to
  10992. // unconditionally include in API requests. By default, fields with
  10993. // empty values are omitted from API requests. However, any non-pointer,
  10994. // non-interface field appearing in ForceSendFields will be sent to the
  10995. // server regardless of whether the field is empty or not. This may be
  10996. // used to include empty fields in Patch requests.
  10997. ForceSendFields []string `json:"-"`
  10998. // NullFields is a list of field names (e.g. "Code") to include in API
  10999. // requests with the JSON null value. By default, fields with empty
  11000. // values are omitted from API requests. However, any field with an
  11001. // empty value appearing in NullFields will be sent to the server as
  11002. // null. It is an error if a field in this list has a non-empty value.
  11003. // This may be used to include null fields in Patch requests.
  11004. NullFields []string `json:"-"`
  11005. }
  11006. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11007. type NoMethod InterconnectAttachmentAggregatedListWarning
  11008. raw := NoMethod(*s)
  11009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11010. }
  11011. type InterconnectAttachmentAggregatedListWarningData struct {
  11012. // Key: [Output Only] A key that provides more detail on the warning
  11013. // being returned. For example, for warnings where there are no results
  11014. // in a list request for a particular zone, this key might be scope and
  11015. // the key value might be the zone name. Other examples might be a key
  11016. // indicating a deprecated resource and a suggested replacement, or a
  11017. // warning about invalid network settings (for example, if an instance
  11018. // attempts to perform IP forwarding but is not enabled for IP
  11019. // forwarding).
  11020. Key string `json:"key,omitempty"`
  11021. // Value: [Output Only] A warning data value corresponding to the key.
  11022. Value string `json:"value,omitempty"`
  11023. // ForceSendFields is a list of field names (e.g. "Key") to
  11024. // unconditionally include in API requests. By default, fields with
  11025. // empty values are omitted from API requests. However, any non-pointer,
  11026. // non-interface field appearing in ForceSendFields will be sent to the
  11027. // server regardless of whether the field is empty or not. This may be
  11028. // used to include empty fields in Patch requests.
  11029. ForceSendFields []string `json:"-"`
  11030. // NullFields is a list of field names (e.g. "Key") to include in API
  11031. // requests with the JSON null value. By default, fields with empty
  11032. // values are omitted from API requests. However, any field with an
  11033. // empty value appearing in NullFields will be sent to the server as
  11034. // null. It is an error if a field in this list has a non-empty value.
  11035. // This may be used to include null fields in Patch requests.
  11036. NullFields []string `json:"-"`
  11037. }
  11038. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11039. type NoMethod InterconnectAttachmentAggregatedListWarningData
  11040. raw := NoMethod(*s)
  11041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11042. }
  11043. // InterconnectAttachmentList: Response to the list request, and
  11044. // contains a list of interconnect attachments.
  11045. type InterconnectAttachmentList struct {
  11046. // Id: [Output Only] Unique identifier for the resource; defined by the
  11047. // server.
  11048. Id string `json:"id,omitempty"`
  11049. // Items: A list of InterconnectAttachment resources.
  11050. Items []*InterconnectAttachment `json:"items,omitempty"`
  11051. // Kind: [Output Only] Type of resource. Always
  11052. // compute#interconnectAttachmentList for lists of interconnect
  11053. // attachments.
  11054. Kind string `json:"kind,omitempty"`
  11055. // NextPageToken: [Output Only] This token allows you to get the next
  11056. // page of results for list requests. If the number of results is larger
  11057. // than maxResults, use the nextPageToken as a value for the query
  11058. // parameter pageToken in the next list request. Subsequent list
  11059. // requests will have their own nextPageToken to continue paging through
  11060. // the results.
  11061. NextPageToken string `json:"nextPageToken,omitempty"`
  11062. // SelfLink: [Output Only] Server-defined URL for this resource.
  11063. SelfLink string `json:"selfLink,omitempty"`
  11064. // Warning: [Output Only] Informational warning message.
  11065. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  11066. // ServerResponse contains the HTTP response code and headers from the
  11067. // server.
  11068. googleapi.ServerResponse `json:"-"`
  11069. // ForceSendFields is a list of field names (e.g. "Id") to
  11070. // unconditionally include in API requests. By default, fields with
  11071. // empty values are omitted from API requests. However, any non-pointer,
  11072. // non-interface field appearing in ForceSendFields will be sent to the
  11073. // server regardless of whether the field is empty or not. This may be
  11074. // used to include empty fields in Patch requests.
  11075. ForceSendFields []string `json:"-"`
  11076. // NullFields is a list of field names (e.g. "Id") to include in API
  11077. // requests with the JSON null value. By default, fields with empty
  11078. // values are omitted from API requests. However, any field with an
  11079. // empty value appearing in NullFields will be sent to the server as
  11080. // null. It is an error if a field in this list has a non-empty value.
  11081. // This may be used to include null fields in Patch requests.
  11082. NullFields []string `json:"-"`
  11083. }
  11084. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  11085. type NoMethod InterconnectAttachmentList
  11086. raw := NoMethod(*s)
  11087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11088. }
  11089. // InterconnectAttachmentListWarning: [Output Only] Informational
  11090. // warning message.
  11091. type InterconnectAttachmentListWarning struct {
  11092. // Code: [Output Only] A warning code, if applicable. For example,
  11093. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11094. // the response.
  11095. //
  11096. // Possible values:
  11097. // "CLEANUP_FAILED"
  11098. // "DEPRECATED_RESOURCE_USED"
  11099. // "DEPRECATED_TYPE_USED"
  11100. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11101. // "EXPERIMENTAL_TYPE_USED"
  11102. // "EXTERNAL_API_WARNING"
  11103. // "FIELD_VALUE_OVERRIDEN"
  11104. // "INJECTED_KERNELS_DEPRECATED"
  11105. // "MISSING_TYPE_DEPENDENCY"
  11106. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11107. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11108. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11109. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11110. // "NEXT_HOP_NOT_RUNNING"
  11111. // "NOT_CRITICAL_ERROR"
  11112. // "NO_RESULTS_ON_PAGE"
  11113. // "REQUIRED_TOS_AGREEMENT"
  11114. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11115. // "RESOURCE_NOT_DELETED"
  11116. // "SCHEMA_VALIDATION_IGNORED"
  11117. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11118. // "UNDECLARED_PROPERTIES"
  11119. // "UNREACHABLE"
  11120. Code string `json:"code,omitempty"`
  11121. // Data: [Output Only] Metadata about this warning in key: value format.
  11122. // For example:
  11123. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11124. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  11125. // Message: [Output Only] A human-readable description of the warning
  11126. // code.
  11127. Message string `json:"message,omitempty"`
  11128. // ForceSendFields is a list of field names (e.g. "Code") to
  11129. // unconditionally include in API requests. By default, fields with
  11130. // empty values are omitted from API requests. However, any non-pointer,
  11131. // non-interface field appearing in ForceSendFields will be sent to the
  11132. // server regardless of whether the field is empty or not. This may be
  11133. // used to include empty fields in Patch requests.
  11134. ForceSendFields []string `json:"-"`
  11135. // NullFields is a list of field names (e.g. "Code") to include in API
  11136. // requests with the JSON null value. By default, fields with empty
  11137. // values are omitted from API requests. However, any field with an
  11138. // empty value appearing in NullFields will be sent to the server as
  11139. // null. It is an error if a field in this list has a non-empty value.
  11140. // This may be used to include null fields in Patch requests.
  11141. NullFields []string `json:"-"`
  11142. }
  11143. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  11144. type NoMethod InterconnectAttachmentListWarning
  11145. raw := NoMethod(*s)
  11146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11147. }
  11148. type InterconnectAttachmentListWarningData struct {
  11149. // Key: [Output Only] A key that provides more detail on the warning
  11150. // being returned. For example, for warnings where there are no results
  11151. // in a list request for a particular zone, this key might be scope and
  11152. // the key value might be the zone name. Other examples might be a key
  11153. // indicating a deprecated resource and a suggested replacement, or a
  11154. // warning about invalid network settings (for example, if an instance
  11155. // attempts to perform IP forwarding but is not enabled for IP
  11156. // forwarding).
  11157. Key string `json:"key,omitempty"`
  11158. // Value: [Output Only] A warning data value corresponding to the key.
  11159. Value string `json:"value,omitempty"`
  11160. // ForceSendFields is a list of field names (e.g. "Key") to
  11161. // unconditionally include in API requests. By default, fields with
  11162. // empty values are omitted from API requests. However, any non-pointer,
  11163. // non-interface field appearing in ForceSendFields will be sent to the
  11164. // server regardless of whether the field is empty or not. This may be
  11165. // used to include empty fields in Patch requests.
  11166. ForceSendFields []string `json:"-"`
  11167. // NullFields is a list of field names (e.g. "Key") to include in API
  11168. // requests with the JSON null value. By default, fields with empty
  11169. // values are omitted from API requests. However, any field with an
  11170. // empty value appearing in NullFields will be sent to the server as
  11171. // null. It is an error if a field in this list has a non-empty value.
  11172. // This may be used to include null fields in Patch requests.
  11173. NullFields []string `json:"-"`
  11174. }
  11175. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  11176. type NoMethod InterconnectAttachmentListWarningData
  11177. raw := NoMethod(*s)
  11178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11179. }
  11180. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  11181. // Partner attachments from Partners to display to customers. These
  11182. // fields are propagated from PARTNER_PROVIDER attachments to their
  11183. // corresponding PARTNER attachments.
  11184. type InterconnectAttachmentPartnerMetadata struct {
  11185. // InterconnectName: Plain text name of the Interconnect this attachment
  11186. // is connected to, as displayed in the Partner?s portal. For instance
  11187. // "Chicago 1". This value may be validated to match approved Partner
  11188. // values.
  11189. InterconnectName string `json:"interconnectName,omitempty"`
  11190. // PartnerName: Plain text name of the Partner providing this
  11191. // attachment. This value may be validated to match approved Partner
  11192. // values.
  11193. PartnerName string `json:"partnerName,omitempty"`
  11194. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  11195. // may customise this to be a deep-link to the specific resource on the
  11196. // Partner portal. This value may be validated to match approved Partner
  11197. // values.
  11198. PortalUrl string `json:"portalUrl,omitempty"`
  11199. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  11200. // unconditionally include in API requests. By default, fields with
  11201. // empty values are omitted from API requests. However, any non-pointer,
  11202. // non-interface field appearing in ForceSendFields will be sent to the
  11203. // server regardless of whether the field is empty or not. This may be
  11204. // used to include empty fields in Patch requests.
  11205. ForceSendFields []string `json:"-"`
  11206. // NullFields is a list of field names (e.g. "InterconnectName") to
  11207. // include in API requests with the JSON null value. By default, fields
  11208. // with empty values are omitted from API requests. However, any field
  11209. // with an empty value appearing in NullFields will be sent to the
  11210. // server as null. It is an error if a field in this list has a
  11211. // non-empty value. This may be used to include null fields in Patch
  11212. // requests.
  11213. NullFields []string `json:"-"`
  11214. }
  11215. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  11216. type NoMethod InterconnectAttachmentPartnerMetadata
  11217. raw := NoMethod(*s)
  11218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11219. }
  11220. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  11221. // attachment when this belongs to an interconnect of type DEDICATED.
  11222. type InterconnectAttachmentPrivateInfo struct {
  11223. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  11224. // traffic between Google and the customer, going to and from this
  11225. // network and region.
  11226. Tag8021q int64 `json:"tag8021q,omitempty"`
  11227. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  11228. // unconditionally include in API requests. By default, fields with
  11229. // empty values are omitted from API requests. However, any non-pointer,
  11230. // non-interface field appearing in ForceSendFields will be sent to the
  11231. // server regardless of whether the field is empty or not. This may be
  11232. // used to include empty fields in Patch requests.
  11233. ForceSendFields []string `json:"-"`
  11234. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  11235. // API requests with the JSON null value. By default, fields with empty
  11236. // values are omitted from API requests. However, any field with an
  11237. // empty value appearing in NullFields will be sent to the server as
  11238. // null. It is an error if a field in this list has a non-empty value.
  11239. // This may be used to include null fields in Patch requests.
  11240. NullFields []string `json:"-"`
  11241. }
  11242. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  11243. type NoMethod InterconnectAttachmentPrivateInfo
  11244. raw := NoMethod(*s)
  11245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11246. }
  11247. type InterconnectAttachmentsScopedList struct {
  11248. // InterconnectAttachments: A list of interconnect attachments contained
  11249. // in this scope.
  11250. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  11251. // Warning: Informational warning which replaces the list of addresses
  11252. // when the list is empty.
  11253. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  11254. // ForceSendFields is a list of field names (e.g.
  11255. // "InterconnectAttachments") to unconditionally include in API
  11256. // requests. By default, fields with empty values are omitted from API
  11257. // requests. However, any non-pointer, non-interface field appearing in
  11258. // ForceSendFields will be sent to the server regardless of whether the
  11259. // field is empty or not. This may be used to include empty fields in
  11260. // Patch requests.
  11261. ForceSendFields []string `json:"-"`
  11262. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  11263. // to include in API requests with the JSON null value. By default,
  11264. // fields with empty values are omitted from API requests. However, any
  11265. // field with an empty value appearing in NullFields will be sent to the
  11266. // server as null. It is an error if a field in this list has a
  11267. // non-empty value. This may be used to include null fields in Patch
  11268. // requests.
  11269. NullFields []string `json:"-"`
  11270. }
  11271. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  11272. type NoMethod InterconnectAttachmentsScopedList
  11273. raw := NoMethod(*s)
  11274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11275. }
  11276. // InterconnectAttachmentsScopedListWarning: Informational warning which
  11277. // replaces the list of addresses when the list is empty.
  11278. type InterconnectAttachmentsScopedListWarning struct {
  11279. // Code: [Output Only] A warning code, if applicable. For example,
  11280. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11281. // the response.
  11282. //
  11283. // Possible values:
  11284. // "CLEANUP_FAILED"
  11285. // "DEPRECATED_RESOURCE_USED"
  11286. // "DEPRECATED_TYPE_USED"
  11287. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11288. // "EXPERIMENTAL_TYPE_USED"
  11289. // "EXTERNAL_API_WARNING"
  11290. // "FIELD_VALUE_OVERRIDEN"
  11291. // "INJECTED_KERNELS_DEPRECATED"
  11292. // "MISSING_TYPE_DEPENDENCY"
  11293. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11294. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11295. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11296. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11297. // "NEXT_HOP_NOT_RUNNING"
  11298. // "NOT_CRITICAL_ERROR"
  11299. // "NO_RESULTS_ON_PAGE"
  11300. // "REQUIRED_TOS_AGREEMENT"
  11301. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11302. // "RESOURCE_NOT_DELETED"
  11303. // "SCHEMA_VALIDATION_IGNORED"
  11304. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11305. // "UNDECLARED_PROPERTIES"
  11306. // "UNREACHABLE"
  11307. Code string `json:"code,omitempty"`
  11308. // Data: [Output Only] Metadata about this warning in key: value format.
  11309. // For example:
  11310. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11311. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  11312. // Message: [Output Only] A human-readable description of the warning
  11313. // code.
  11314. Message string `json:"message,omitempty"`
  11315. // ForceSendFields is a list of field names (e.g. "Code") to
  11316. // unconditionally include in API requests. By default, fields with
  11317. // empty values are omitted from API requests. However, any non-pointer,
  11318. // non-interface field appearing in ForceSendFields will be sent to the
  11319. // server regardless of whether the field is empty or not. This may be
  11320. // used to include empty fields in Patch requests.
  11321. ForceSendFields []string `json:"-"`
  11322. // NullFields is a list of field names (e.g. "Code") to include in API
  11323. // requests with the JSON null value. By default, fields with empty
  11324. // values are omitted from API requests. However, any field with an
  11325. // empty value appearing in NullFields will be sent to the server as
  11326. // null. It is an error if a field in this list has a non-empty value.
  11327. // This may be used to include null fields in Patch requests.
  11328. NullFields []string `json:"-"`
  11329. }
  11330. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  11331. type NoMethod InterconnectAttachmentsScopedListWarning
  11332. raw := NoMethod(*s)
  11333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11334. }
  11335. type InterconnectAttachmentsScopedListWarningData struct {
  11336. // Key: [Output Only] A key that provides more detail on the warning
  11337. // being returned. For example, for warnings where there are no results
  11338. // in a list request for a particular zone, this key might be scope and
  11339. // the key value might be the zone name. Other examples might be a key
  11340. // indicating a deprecated resource and a suggested replacement, or a
  11341. // warning about invalid network settings (for example, if an instance
  11342. // attempts to perform IP forwarding but is not enabled for IP
  11343. // forwarding).
  11344. Key string `json:"key,omitempty"`
  11345. // Value: [Output Only] A warning data value corresponding to the key.
  11346. Value string `json:"value,omitempty"`
  11347. // ForceSendFields is a list of field names (e.g. "Key") to
  11348. // unconditionally include in API requests. By default, fields with
  11349. // empty values are omitted from API requests. However, any non-pointer,
  11350. // non-interface field appearing in ForceSendFields will be sent to the
  11351. // server regardless of whether the field is empty or not. This may be
  11352. // used to include empty fields in Patch requests.
  11353. ForceSendFields []string `json:"-"`
  11354. // NullFields is a list of field names (e.g. "Key") to include in API
  11355. // requests with the JSON null value. By default, fields with empty
  11356. // values are omitted from API requests. However, any field with an
  11357. // empty value appearing in NullFields will be sent to the server as
  11358. // null. It is an error if a field in this list has a non-empty value.
  11359. // This may be used to include null fields in Patch requests.
  11360. NullFields []string `json:"-"`
  11361. }
  11362. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  11363. type NoMethod InterconnectAttachmentsScopedListWarningData
  11364. raw := NoMethod(*s)
  11365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11366. }
  11367. // InterconnectCircuitInfo: Describes a single physical circuit between
  11368. // the Customer and Google. CircuitInfo objects are created by Google,
  11369. // so all fields are output only. Next id: 4
  11370. type InterconnectCircuitInfo struct {
  11371. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  11372. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  11373. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  11374. // at circuit turn-up.
  11375. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  11376. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  11377. // circuit turn-up and provided by Google to the customer in the LOA.
  11378. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  11379. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  11380. // unconditionally include in API requests. By default, fields with
  11381. // empty values are omitted from API requests. However, any non-pointer,
  11382. // non-interface field appearing in ForceSendFields will be sent to the
  11383. // server regardless of whether the field is empty or not. This may be
  11384. // used to include empty fields in Patch requests.
  11385. ForceSendFields []string `json:"-"`
  11386. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  11387. // include in API requests with the JSON null value. By default, fields
  11388. // with empty values are omitted from API requests. However, any field
  11389. // with an empty value appearing in NullFields will be sent to the
  11390. // server as null. It is an error if a field in this list has a
  11391. // non-empty value. This may be used to include null fields in Patch
  11392. // requests.
  11393. NullFields []string `json:"-"`
  11394. }
  11395. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  11396. type NoMethod InterconnectCircuitInfo
  11397. raw := NoMethod(*s)
  11398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11399. }
  11400. // InterconnectDiagnostics: Diagnostics information about interconnect,
  11401. // contains detailed and current technical information about Google?s
  11402. // side of the connection.
  11403. type InterconnectDiagnostics struct {
  11404. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  11405. // describing individual neighbors currently seen by the Google router
  11406. // in the ARP cache for the Interconnect. This will be empty when the
  11407. // Interconnect is not bundled.
  11408. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  11409. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  11410. // describing the status for each link on the Interconnect.
  11411. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  11412. // MacAddress: The MAC address of the Interconnect's bundle interface.
  11413. MacAddress string `json:"macAddress,omitempty"`
  11414. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  11415. // unconditionally include in API requests. By default, fields with
  11416. // empty values are omitted from API requests. However, any non-pointer,
  11417. // non-interface field appearing in ForceSendFields will be sent to the
  11418. // server regardless of whether the field is empty or not. This may be
  11419. // used to include empty fields in Patch requests.
  11420. ForceSendFields []string `json:"-"`
  11421. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  11422. // API requests with the JSON null value. By default, fields with empty
  11423. // values are omitted from API requests. However, any field with an
  11424. // empty value appearing in NullFields will be sent to the server as
  11425. // null. It is an error if a field in this list has a non-empty value.
  11426. // This may be used to include null fields in Patch requests.
  11427. NullFields []string `json:"-"`
  11428. }
  11429. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  11430. type NoMethod InterconnectDiagnostics
  11431. raw := NoMethod(*s)
  11432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11433. }
  11434. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  11435. // seen on this link
  11436. type InterconnectDiagnosticsARPEntry struct {
  11437. // IpAddress: The IP address of this ARP neighbor.
  11438. IpAddress string `json:"ipAddress,omitempty"`
  11439. // MacAddress: The MAC address of this ARP neighbor.
  11440. MacAddress string `json:"macAddress,omitempty"`
  11441. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  11442. // unconditionally include in API requests. By default, fields with
  11443. // empty values are omitted from API requests. However, any non-pointer,
  11444. // non-interface field appearing in ForceSendFields will be sent to the
  11445. // server regardless of whether the field is empty or not. This may be
  11446. // used to include empty fields in Patch requests.
  11447. ForceSendFields []string `json:"-"`
  11448. // NullFields is a list of field names (e.g. "IpAddress") to include in
  11449. // API requests with the JSON null value. By default, fields with empty
  11450. // values are omitted from API requests. However, any field with an
  11451. // empty value appearing in NullFields will be sent to the server as
  11452. // null. It is an error if a field in this list has a non-empty value.
  11453. // This may be used to include null fields in Patch requests.
  11454. NullFields []string `json:"-"`
  11455. }
  11456. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  11457. type NoMethod InterconnectDiagnosticsARPEntry
  11458. raw := NoMethod(*s)
  11459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11460. }
  11461. type InterconnectDiagnosticsLinkLACPStatus struct {
  11462. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  11463. // exchange.
  11464. GoogleSystemId string `json:"googleSystemId,omitempty"`
  11465. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  11466. // LACP exchange.
  11467. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  11468. // Possible values:
  11469. // "ACTIVE"
  11470. // "DETACHED"
  11471. State string `json:"state,omitempty"`
  11472. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  11473. // unconditionally include in API requests. By default, fields with
  11474. // empty values are omitted from API requests. However, any non-pointer,
  11475. // non-interface field appearing in ForceSendFields will be sent to the
  11476. // server regardless of whether the field is empty or not. This may be
  11477. // used to include empty fields in Patch requests.
  11478. ForceSendFields []string `json:"-"`
  11479. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  11480. // include in API requests with the JSON null value. By default, fields
  11481. // with empty values are omitted from API requests. However, any field
  11482. // with an empty value appearing in NullFields will be sent to the
  11483. // server as null. It is an error if a field in this list has a
  11484. // non-empty value. This may be used to include null fields in Patch
  11485. // requests.
  11486. NullFields []string `json:"-"`
  11487. }
  11488. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  11489. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  11490. raw := NoMethod(*s)
  11491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11492. }
  11493. type InterconnectDiagnosticsLinkOpticalPower struct {
  11494. // Possible values:
  11495. // "HIGH_ALARM"
  11496. // "HIGH_WARNING"
  11497. // "LOW_ALARM"
  11498. // "LOW_WARNING"
  11499. // "OK"
  11500. State string `json:"state,omitempty"`
  11501. // Value: Value of the current optical power, read in dBm. Take a known
  11502. // good optical value, give it a 10% margin and trigger warnings
  11503. // relative to that value. In general, a -7dBm warning and a -11dBm
  11504. // alarm are good optical value estimates for most links.
  11505. Value float64 `json:"value,omitempty"`
  11506. // ForceSendFields is a list of field names (e.g. "State") to
  11507. // unconditionally include in API requests. By default, fields with
  11508. // empty values are omitted from API requests. However, any non-pointer,
  11509. // non-interface field appearing in ForceSendFields will be sent to the
  11510. // server regardless of whether the field is empty or not. This may be
  11511. // used to include empty fields in Patch requests.
  11512. ForceSendFields []string `json:"-"`
  11513. // NullFields is a list of field names (e.g. "State") to include in API
  11514. // requests with the JSON null value. By default, fields with empty
  11515. // values are omitted from API requests. However, any field with an
  11516. // empty value appearing in NullFields will be sent to the server as
  11517. // null. It is an error if a field in this list has a non-empty value.
  11518. // This may be used to include null fields in Patch requests.
  11519. NullFields []string `json:"-"`
  11520. }
  11521. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  11522. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  11523. raw := NoMethod(*s)
  11524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11525. }
  11526. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  11527. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  11528. var s1 struct {
  11529. Value gensupport.JSONFloat64 `json:"value"`
  11530. *NoMethod
  11531. }
  11532. s1.NoMethod = (*NoMethod)(s)
  11533. if err := json.Unmarshal(data, &s1); err != nil {
  11534. return err
  11535. }
  11536. s.Value = float64(s1.Value)
  11537. return nil
  11538. }
  11539. type InterconnectDiagnosticsLinkStatus struct {
  11540. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  11541. // describing the ARP neighbor entries seen on this link. This will be
  11542. // empty if the link is bundled
  11543. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  11544. // CircuitId: The unique ID for this link assigned during turn up by
  11545. // Google.
  11546. CircuitId string `json:"circuitId,omitempty"`
  11547. // GoogleDemarc: The Demarc address assigned by Google and provided in
  11548. // the LoA.
  11549. GoogleDemarc string `json:"googleDemarc,omitempty"`
  11550. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  11551. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  11552. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  11553. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  11554. // unconditionally include in API requests. By default, fields with
  11555. // empty values are omitted from API requests. However, any non-pointer,
  11556. // non-interface field appearing in ForceSendFields will be sent to the
  11557. // server regardless of whether the field is empty or not. This may be
  11558. // used to include empty fields in Patch requests.
  11559. ForceSendFields []string `json:"-"`
  11560. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  11561. // API requests with the JSON null value. By default, fields with empty
  11562. // values are omitted from API requests. However, any field with an
  11563. // empty value appearing in NullFields will be sent to the server as
  11564. // null. It is an error if a field in this list has a non-empty value.
  11565. // This may be used to include null fields in Patch requests.
  11566. NullFields []string `json:"-"`
  11567. }
  11568. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  11569. type NoMethod InterconnectDiagnosticsLinkStatus
  11570. raw := NoMethod(*s)
  11571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11572. }
  11573. // InterconnectList: Response to the list request, and contains a list
  11574. // of interconnects.
  11575. type InterconnectList struct {
  11576. // Id: [Output Only] Unique identifier for the resource; defined by the
  11577. // server.
  11578. Id string `json:"id,omitempty"`
  11579. // Items: A list of Interconnect resources.
  11580. Items []*Interconnect `json:"items,omitempty"`
  11581. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  11582. // for lists of interconnects.
  11583. Kind string `json:"kind,omitempty"`
  11584. // NextPageToken: [Output Only] This token allows you to get the next
  11585. // page of results for list requests. If the number of results is larger
  11586. // than maxResults, use the nextPageToken as a value for the query
  11587. // parameter pageToken in the next list request. Subsequent list
  11588. // requests will have their own nextPageToken to continue paging through
  11589. // the results.
  11590. NextPageToken string `json:"nextPageToken,omitempty"`
  11591. // SelfLink: [Output Only] Server-defined URL for this resource.
  11592. SelfLink string `json:"selfLink,omitempty"`
  11593. // Warning: [Output Only] Informational warning message.
  11594. Warning *InterconnectListWarning `json:"warning,omitempty"`
  11595. // ServerResponse contains the HTTP response code and headers from the
  11596. // server.
  11597. googleapi.ServerResponse `json:"-"`
  11598. // ForceSendFields is a list of field names (e.g. "Id") to
  11599. // unconditionally include in API requests. By default, fields with
  11600. // empty values are omitted from API requests. However, any non-pointer,
  11601. // non-interface field appearing in ForceSendFields will be sent to the
  11602. // server regardless of whether the field is empty or not. This may be
  11603. // used to include empty fields in Patch requests.
  11604. ForceSendFields []string `json:"-"`
  11605. // NullFields is a list of field names (e.g. "Id") to include in API
  11606. // requests with the JSON null value. By default, fields with empty
  11607. // values are omitted from API requests. However, any field with an
  11608. // empty value appearing in NullFields will be sent to the server as
  11609. // null. It is an error if a field in this list has a non-empty value.
  11610. // This may be used to include null fields in Patch requests.
  11611. NullFields []string `json:"-"`
  11612. }
  11613. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  11614. type NoMethod InterconnectList
  11615. raw := NoMethod(*s)
  11616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11617. }
  11618. // InterconnectListWarning: [Output Only] Informational warning message.
  11619. type InterconnectListWarning struct {
  11620. // Code: [Output Only] A warning code, if applicable. For example,
  11621. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11622. // the response.
  11623. //
  11624. // Possible values:
  11625. // "CLEANUP_FAILED"
  11626. // "DEPRECATED_RESOURCE_USED"
  11627. // "DEPRECATED_TYPE_USED"
  11628. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11629. // "EXPERIMENTAL_TYPE_USED"
  11630. // "EXTERNAL_API_WARNING"
  11631. // "FIELD_VALUE_OVERRIDEN"
  11632. // "INJECTED_KERNELS_DEPRECATED"
  11633. // "MISSING_TYPE_DEPENDENCY"
  11634. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11635. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11636. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11637. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11638. // "NEXT_HOP_NOT_RUNNING"
  11639. // "NOT_CRITICAL_ERROR"
  11640. // "NO_RESULTS_ON_PAGE"
  11641. // "REQUIRED_TOS_AGREEMENT"
  11642. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11643. // "RESOURCE_NOT_DELETED"
  11644. // "SCHEMA_VALIDATION_IGNORED"
  11645. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11646. // "UNDECLARED_PROPERTIES"
  11647. // "UNREACHABLE"
  11648. Code string `json:"code,omitempty"`
  11649. // Data: [Output Only] Metadata about this warning in key: value format.
  11650. // For example:
  11651. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11652. Data []*InterconnectListWarningData `json:"data,omitempty"`
  11653. // Message: [Output Only] A human-readable description of the warning
  11654. // code.
  11655. Message string `json:"message,omitempty"`
  11656. // ForceSendFields is a list of field names (e.g. "Code") to
  11657. // unconditionally include in API requests. By default, fields with
  11658. // empty values are omitted from API requests. However, any non-pointer,
  11659. // non-interface field appearing in ForceSendFields will be sent to the
  11660. // server regardless of whether the field is empty or not. This may be
  11661. // used to include empty fields in Patch requests.
  11662. ForceSendFields []string `json:"-"`
  11663. // NullFields is a list of field names (e.g. "Code") to include in API
  11664. // requests with the JSON null value. By default, fields with empty
  11665. // values are omitted from API requests. However, any field with an
  11666. // empty value appearing in NullFields will be sent to the server as
  11667. // null. It is an error if a field in this list has a non-empty value.
  11668. // This may be used to include null fields in Patch requests.
  11669. NullFields []string `json:"-"`
  11670. }
  11671. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  11672. type NoMethod InterconnectListWarning
  11673. raw := NoMethod(*s)
  11674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11675. }
  11676. type InterconnectListWarningData struct {
  11677. // Key: [Output Only] A key that provides more detail on the warning
  11678. // being returned. For example, for warnings where there are no results
  11679. // in a list request for a particular zone, this key might be scope and
  11680. // the key value might be the zone name. Other examples might be a key
  11681. // indicating a deprecated resource and a suggested replacement, or a
  11682. // warning about invalid network settings (for example, if an instance
  11683. // attempts to perform IP forwarding but is not enabled for IP
  11684. // forwarding).
  11685. Key string `json:"key,omitempty"`
  11686. // Value: [Output Only] A warning data value corresponding to the key.
  11687. Value string `json:"value,omitempty"`
  11688. // ForceSendFields is a list of field names (e.g. "Key") to
  11689. // unconditionally include in API requests. By default, fields with
  11690. // empty values are omitted from API requests. However, any non-pointer,
  11691. // non-interface field appearing in ForceSendFields will be sent to the
  11692. // server regardless of whether the field is empty or not. This may be
  11693. // used to include empty fields in Patch requests.
  11694. ForceSendFields []string `json:"-"`
  11695. // NullFields is a list of field names (e.g. "Key") to include in API
  11696. // requests with the JSON null value. By default, fields with empty
  11697. // values are omitted from API requests. However, any field with an
  11698. // empty value appearing in NullFields will be sent to the server as
  11699. // null. It is an error if a field in this list has a non-empty value.
  11700. // This may be used to include null fields in Patch requests.
  11701. NullFields []string `json:"-"`
  11702. }
  11703. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  11704. type NoMethod InterconnectListWarningData
  11705. raw := NoMethod(*s)
  11706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11707. }
  11708. // InterconnectLocation: Represents an InterconnectLocations resource.
  11709. // The InterconnectLocations resource describes the locations where you
  11710. // can connect to Google's networks. For more information, see
  11711. // Colocation Facilities.
  11712. type InterconnectLocation struct {
  11713. // Address: [Output Only] The postal address of the Point of Presence,
  11714. // each line in the address is separated by a newline character.
  11715. Address string `json:"address,omitempty"`
  11716. // AvailabilityZone: [Output Only] Availability zone for this
  11717. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  11718. // will not be simultaneously scheduled in more than one availability
  11719. // zone. Example: "zone1" or "zone2".
  11720. AvailabilityZone string `json:"availabilityZone,omitempty"`
  11721. // City: [Output Only] Metropolitan area designator that indicates which
  11722. // city an interconnect is located. For example: "Chicago, IL",
  11723. // "Amsterdam, Netherlands".
  11724. City string `json:"city,omitempty"`
  11725. // Continent: [Output Only] Continent for this location.
  11726. //
  11727. // Possible values:
  11728. // "AFRICA"
  11729. // "ASIA_PAC"
  11730. // "C_AFRICA"
  11731. // "C_ASIA_PAC"
  11732. // "C_EUROPE"
  11733. // "C_NORTH_AMERICA"
  11734. // "C_SOUTH_AMERICA"
  11735. // "EUROPE"
  11736. // "NORTH_AMERICA"
  11737. // "SOUTH_AMERICA"
  11738. Continent string `json:"continent,omitempty"`
  11739. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11740. // format.
  11741. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11742. // Description: [Output Only] An optional description of the resource.
  11743. Description string `json:"description,omitempty"`
  11744. // FacilityProvider: [Output Only] The name of the provider for this
  11745. // facility (e.g., EQUINIX).
  11746. FacilityProvider string `json:"facilityProvider,omitempty"`
  11747. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  11748. // Identifier for this facility (e.g., Ashburn-DC1).
  11749. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  11750. // Id: [Output Only] The unique identifier for the resource. This
  11751. // identifier is defined by the server.
  11752. Id uint64 `json:"id,omitempty,string"`
  11753. // Kind: [Output Only] Type of the resource. Always
  11754. // compute#interconnectLocation for interconnect locations.
  11755. Kind string `json:"kind,omitempty"`
  11756. // Name: [Output Only] Name of the resource.
  11757. Name string `json:"name,omitempty"`
  11758. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  11759. // facility (corresponding with a netfac type in peeringdb).
  11760. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  11761. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  11762. // objects, that describe parameters pertaining to the relation between
  11763. // this InterconnectLocation and various Google Cloud regions.
  11764. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  11765. // SelfLink: [Output Only] Server-defined URL for the resource.
  11766. SelfLink string `json:"selfLink,omitempty"`
  11767. // ServerResponse contains the HTTP response code and headers from the
  11768. // server.
  11769. googleapi.ServerResponse `json:"-"`
  11770. // ForceSendFields is a list of field names (e.g. "Address") to
  11771. // unconditionally include in API requests. By default, fields with
  11772. // empty values are omitted from API requests. However, any non-pointer,
  11773. // non-interface field appearing in ForceSendFields will be sent to the
  11774. // server regardless of whether the field is empty or not. This may be
  11775. // used to include empty fields in Patch requests.
  11776. ForceSendFields []string `json:"-"`
  11777. // NullFields is a list of field names (e.g. "Address") to include in
  11778. // API requests with the JSON null value. By default, fields with empty
  11779. // values are omitted from API requests. However, any field with an
  11780. // empty value appearing in NullFields will be sent to the server as
  11781. // null. It is an error if a field in this list has a non-empty value.
  11782. // This may be used to include null fields in Patch requests.
  11783. NullFields []string `json:"-"`
  11784. }
  11785. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  11786. type NoMethod InterconnectLocation
  11787. raw := NoMethod(*s)
  11788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11789. }
  11790. // InterconnectLocationList: Response to the list request, and contains
  11791. // a list of interconnect locations.
  11792. type InterconnectLocationList struct {
  11793. // Id: [Output Only] Unique identifier for the resource; defined by the
  11794. // server.
  11795. Id string `json:"id,omitempty"`
  11796. // Items: A list of InterconnectLocation resources.
  11797. Items []*InterconnectLocation `json:"items,omitempty"`
  11798. // Kind: [Output Only] Type of resource. Always
  11799. // compute#interconnectLocationList for lists of interconnect locations.
  11800. Kind string `json:"kind,omitempty"`
  11801. // NextPageToken: [Output Only] This token allows you to get the next
  11802. // page of results for list requests. If the number of results is larger
  11803. // than maxResults, use the nextPageToken as a value for the query
  11804. // parameter pageToken in the next list request. Subsequent list
  11805. // requests will have their own nextPageToken to continue paging through
  11806. // the results.
  11807. NextPageToken string `json:"nextPageToken,omitempty"`
  11808. // SelfLink: [Output Only] Server-defined URL for this resource.
  11809. SelfLink string `json:"selfLink,omitempty"`
  11810. // Warning: [Output Only] Informational warning message.
  11811. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  11812. // ServerResponse contains the HTTP response code and headers from the
  11813. // server.
  11814. googleapi.ServerResponse `json:"-"`
  11815. // ForceSendFields is a list of field names (e.g. "Id") to
  11816. // unconditionally include in API requests. By default, fields with
  11817. // empty values are omitted from API requests. However, any non-pointer,
  11818. // non-interface field appearing in ForceSendFields will be sent to the
  11819. // server regardless of whether the field is empty or not. This may be
  11820. // used to include empty fields in Patch requests.
  11821. ForceSendFields []string `json:"-"`
  11822. // NullFields is a list of field names (e.g. "Id") to include in API
  11823. // requests with the JSON null value. By default, fields with empty
  11824. // values are omitted from API requests. However, any field with an
  11825. // empty value appearing in NullFields will be sent to the server as
  11826. // null. It is an error if a field in this list has a non-empty value.
  11827. // This may be used to include null fields in Patch requests.
  11828. NullFields []string `json:"-"`
  11829. }
  11830. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  11831. type NoMethod InterconnectLocationList
  11832. raw := NoMethod(*s)
  11833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11834. }
  11835. // InterconnectLocationListWarning: [Output Only] Informational warning
  11836. // message.
  11837. type InterconnectLocationListWarning struct {
  11838. // Code: [Output Only] A warning code, if applicable. For example,
  11839. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11840. // the response.
  11841. //
  11842. // Possible values:
  11843. // "CLEANUP_FAILED"
  11844. // "DEPRECATED_RESOURCE_USED"
  11845. // "DEPRECATED_TYPE_USED"
  11846. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11847. // "EXPERIMENTAL_TYPE_USED"
  11848. // "EXTERNAL_API_WARNING"
  11849. // "FIELD_VALUE_OVERRIDEN"
  11850. // "INJECTED_KERNELS_DEPRECATED"
  11851. // "MISSING_TYPE_DEPENDENCY"
  11852. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11853. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11854. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11855. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11856. // "NEXT_HOP_NOT_RUNNING"
  11857. // "NOT_CRITICAL_ERROR"
  11858. // "NO_RESULTS_ON_PAGE"
  11859. // "REQUIRED_TOS_AGREEMENT"
  11860. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11861. // "RESOURCE_NOT_DELETED"
  11862. // "SCHEMA_VALIDATION_IGNORED"
  11863. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11864. // "UNDECLARED_PROPERTIES"
  11865. // "UNREACHABLE"
  11866. Code string `json:"code,omitempty"`
  11867. // Data: [Output Only] Metadata about this warning in key: value format.
  11868. // For example:
  11869. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11870. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  11871. // Message: [Output Only] A human-readable description of the warning
  11872. // code.
  11873. Message string `json:"message,omitempty"`
  11874. // ForceSendFields is a list of field names (e.g. "Code") to
  11875. // unconditionally include in API requests. By default, fields with
  11876. // empty values are omitted from API requests. However, any non-pointer,
  11877. // non-interface field appearing in ForceSendFields will be sent to the
  11878. // server regardless of whether the field is empty or not. This may be
  11879. // used to include empty fields in Patch requests.
  11880. ForceSendFields []string `json:"-"`
  11881. // NullFields is a list of field names (e.g. "Code") to include in API
  11882. // requests with the JSON null value. By default, fields with empty
  11883. // values are omitted from API requests. However, any field with an
  11884. // empty value appearing in NullFields will be sent to the server as
  11885. // null. It is an error if a field in this list has a non-empty value.
  11886. // This may be used to include null fields in Patch requests.
  11887. NullFields []string `json:"-"`
  11888. }
  11889. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  11890. type NoMethod InterconnectLocationListWarning
  11891. raw := NoMethod(*s)
  11892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11893. }
  11894. type InterconnectLocationListWarningData struct {
  11895. // Key: [Output Only] A key that provides more detail on the warning
  11896. // being returned. For example, for warnings where there are no results
  11897. // in a list request for a particular zone, this key might be scope and
  11898. // the key value might be the zone name. Other examples might be a key
  11899. // indicating a deprecated resource and a suggested replacement, or a
  11900. // warning about invalid network settings (for example, if an instance
  11901. // attempts to perform IP forwarding but is not enabled for IP
  11902. // forwarding).
  11903. Key string `json:"key,omitempty"`
  11904. // Value: [Output Only] A warning data value corresponding to the key.
  11905. Value string `json:"value,omitempty"`
  11906. // ForceSendFields is a list of field names (e.g. "Key") to
  11907. // unconditionally include in API requests. By default, fields with
  11908. // empty values are omitted from API requests. However, any non-pointer,
  11909. // non-interface field appearing in ForceSendFields will be sent to the
  11910. // server regardless of whether the field is empty or not. This may be
  11911. // used to include empty fields in Patch requests.
  11912. ForceSendFields []string `json:"-"`
  11913. // NullFields is a list of field names (e.g. "Key") to include in API
  11914. // requests with the JSON null value. By default, fields with empty
  11915. // values are omitted from API requests. However, any field with an
  11916. // empty value appearing in NullFields will be sent to the server as
  11917. // null. It is an error if a field in this list has a non-empty value.
  11918. // This may be used to include null fields in Patch requests.
  11919. NullFields []string `json:"-"`
  11920. }
  11921. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  11922. type NoMethod InterconnectLocationListWarningData
  11923. raw := NoMethod(*s)
  11924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11925. }
  11926. // InterconnectLocationRegionInfo: Information about any potential
  11927. // InterconnectAttachments between an Interconnect at a specific
  11928. // InterconnectLocation, and a specific Cloud Region.
  11929. type InterconnectLocationRegionInfo struct {
  11930. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  11931. // InterconnectLocation to a VM in this region.
  11932. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  11933. // LocationPresence: Identifies the network presence of this location.
  11934. //
  11935. // Possible values:
  11936. // "GLOBAL"
  11937. // "LOCAL_REGION"
  11938. // "LP_GLOBAL"
  11939. // "LP_LOCAL_REGION"
  11940. LocationPresence string `json:"locationPresence,omitempty"`
  11941. // Region: URL for the region of this location.
  11942. Region string `json:"region,omitempty"`
  11943. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  11944. // unconditionally include in API requests. By default, fields with
  11945. // empty values are omitted from API requests. However, any non-pointer,
  11946. // non-interface field appearing in ForceSendFields will be sent to the
  11947. // server regardless of whether the field is empty or not. This may be
  11948. // used to include empty fields in Patch requests.
  11949. ForceSendFields []string `json:"-"`
  11950. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  11951. // in API requests with the JSON null value. By default, fields with
  11952. // empty values are omitted from API requests. However, any field with
  11953. // an empty value appearing in NullFields will be sent to the server as
  11954. // null. It is an error if a field in this list has a non-empty value.
  11955. // This may be used to include null fields in Patch requests.
  11956. NullFields []string `json:"-"`
  11957. }
  11958. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  11959. type NoMethod InterconnectLocationRegionInfo
  11960. raw := NoMethod(*s)
  11961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11962. }
  11963. // InterconnectOutageNotification: Description of a planned outage on
  11964. // this Interconnect. Next id: 9
  11965. type InterconnectOutageNotification struct {
  11966. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  11967. // Google-side circuit IDs that will be affected.
  11968. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  11969. // Description: A description about the purpose of the outage.
  11970. Description string `json:"description,omitempty"`
  11971. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  11972. // epoch).
  11973. EndTime int64 `json:"endTime,omitempty,string"`
  11974. // IssueType: Form this outage is expected to take. Note that the "IT_"
  11975. // versions of this enum have been deprecated in favor of the unprefixed
  11976. // values.
  11977. //
  11978. // Possible values:
  11979. // "IT_OUTAGE"
  11980. // "IT_PARTIAL_OUTAGE"
  11981. // "OUTAGE"
  11982. // "PARTIAL_OUTAGE"
  11983. IssueType string `json:"issueType,omitempty"`
  11984. // Name: Unique identifier for this outage notification.
  11985. Name string `json:"name,omitempty"`
  11986. // Source: The party that generated this notification. Note that
  11987. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  11988. //
  11989. // Possible values:
  11990. // "GOOGLE"
  11991. // "NSRC_GOOGLE"
  11992. Source string `json:"source,omitempty"`
  11993. // StartTime: Scheduled start time for the outage (milliseconds since
  11994. // Unix epoch).
  11995. StartTime int64 `json:"startTime,omitempty,string"`
  11996. // State: State of this notification. Note that the "NS_" versions of
  11997. // this enum have been deprecated in favor of the unprefixed values.
  11998. //
  11999. // Possible values:
  12000. // "ACTIVE"
  12001. // "CANCELLED"
  12002. // "NS_ACTIVE"
  12003. // "NS_CANCELED"
  12004. State string `json:"state,omitempty"`
  12005. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  12006. // unconditionally include in API requests. By default, fields with
  12007. // empty values are omitted from API requests. However, any non-pointer,
  12008. // non-interface field appearing in ForceSendFields will be sent to the
  12009. // server regardless of whether the field is empty or not. This may be
  12010. // used to include empty fields in Patch requests.
  12011. ForceSendFields []string `json:"-"`
  12012. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  12013. // include in API requests with the JSON null value. By default, fields
  12014. // with empty values are omitted from API requests. However, any field
  12015. // with an empty value appearing in NullFields will be sent to the
  12016. // server as null. It is an error if a field in this list has a
  12017. // non-empty value. This may be used to include null fields in Patch
  12018. // requests.
  12019. NullFields []string `json:"-"`
  12020. }
  12021. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  12022. type NoMethod InterconnectOutageNotification
  12023. raw := NoMethod(*s)
  12024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12025. }
  12026. // InterconnectsGetDiagnosticsResponse: Response for the
  12027. // InterconnectsGetDiagnosticsRequest.
  12028. type InterconnectsGetDiagnosticsResponse struct {
  12029. Result *InterconnectDiagnostics `json:"result,omitempty"`
  12030. // ServerResponse contains the HTTP response code and headers from the
  12031. // server.
  12032. googleapi.ServerResponse `json:"-"`
  12033. // ForceSendFields is a list of field names (e.g. "Result") to
  12034. // unconditionally include in API requests. By default, fields with
  12035. // empty values are omitted from API requests. However, any non-pointer,
  12036. // non-interface field appearing in ForceSendFields will be sent to the
  12037. // server regardless of whether the field is empty or not. This may be
  12038. // used to include empty fields in Patch requests.
  12039. ForceSendFields []string `json:"-"`
  12040. // NullFields is a list of field names (e.g. "Result") to include in API
  12041. // requests with the JSON null value. By default, fields with empty
  12042. // values are omitted from API requests. However, any field with an
  12043. // empty value appearing in NullFields will be sent to the server as
  12044. // null. It is an error if a field in this list has a non-empty value.
  12045. // This may be used to include null fields in Patch requests.
  12046. NullFields []string `json:"-"`
  12047. }
  12048. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  12049. type NoMethod InterconnectsGetDiagnosticsResponse
  12050. raw := NoMethod(*s)
  12051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12052. }
  12053. // License: A license resource.
  12054. type License struct {
  12055. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  12056. // reflects whether a license charges a usage fee.
  12057. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  12058. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12059. // format.
  12060. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12061. // Description: An optional textual description of the resource;
  12062. // provided by the client when the resource is created.
  12063. Description string `json:"description,omitempty"`
  12064. // Id: [Output Only] The unique identifier for the resource. This
  12065. // identifier is defined by the server.
  12066. Id uint64 `json:"id,omitempty,string"`
  12067. // Kind: [Output Only] Type of resource. Always compute#license for
  12068. // licenses.
  12069. Kind string `json:"kind,omitempty"`
  12070. // LicenseCode: [Output Only] The unique code used to attach this
  12071. // license to images, snapshots, and disks.
  12072. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  12073. // Name: Name of the resource. The name must be 1-63 characters long and
  12074. // comply with RFC1035.
  12075. Name string `json:"name,omitempty"`
  12076. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  12077. // SelfLink: [Output Only] Server-defined URL for the resource.
  12078. SelfLink string `json:"selfLink,omitempty"`
  12079. // Transferable: If false, licenses will not be copied from the source
  12080. // resource when creating an image from a disk, disk from snapshot, or
  12081. // snapshot from disk.
  12082. Transferable bool `json:"transferable,omitempty"`
  12083. // ServerResponse contains the HTTP response code and headers from the
  12084. // server.
  12085. googleapi.ServerResponse `json:"-"`
  12086. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  12087. // unconditionally include in API requests. By default, fields with
  12088. // empty values are omitted from API requests. However, any non-pointer,
  12089. // non-interface field appearing in ForceSendFields will be sent to the
  12090. // server regardless of whether the field is empty or not. This may be
  12091. // used to include empty fields in Patch requests.
  12092. ForceSendFields []string `json:"-"`
  12093. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  12094. // in API requests with the JSON null value. By default, fields with
  12095. // empty values are omitted from API requests. However, any field with
  12096. // an empty value appearing in NullFields will be sent to the server as
  12097. // null. It is an error if a field in this list has a non-empty value.
  12098. // This may be used to include null fields in Patch requests.
  12099. NullFields []string `json:"-"`
  12100. }
  12101. func (s *License) MarshalJSON() ([]byte, error) {
  12102. type NoMethod License
  12103. raw := NoMethod(*s)
  12104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12105. }
  12106. type LicenseCode struct {
  12107. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12108. // format.
  12109. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12110. // Description: [Output Only] Description of this License Code.
  12111. Description string `json:"description,omitempty"`
  12112. // Id: [Output Only] The unique identifier for the resource. This
  12113. // identifier is defined by the server.
  12114. Id uint64 `json:"id,omitempty,string"`
  12115. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  12116. // licenses.
  12117. Kind string `json:"kind,omitempty"`
  12118. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  12119. // with the same License Code.
  12120. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  12121. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  12122. // long and must be a valid 64 bit integer.
  12123. Name string `json:"name,omitempty"`
  12124. // SelfLink: [Output Only] Server-defined URL for the resource.
  12125. SelfLink string `json:"selfLink,omitempty"`
  12126. // State: [Output Only] Current state of this License Code.
  12127. //
  12128. // Possible values:
  12129. // "DISABLED"
  12130. // "ENABLED"
  12131. // "RESTRICTED"
  12132. // "STATE_UNSPECIFIED"
  12133. // "TERMINATED"
  12134. State string `json:"state,omitempty"`
  12135. // Transferable: [Output Only] If true, the license will remain attached
  12136. // when creating images or snapshots from disks. Otherwise, the license
  12137. // is not transferred.
  12138. Transferable bool `json:"transferable,omitempty"`
  12139. // ServerResponse contains the HTTP response code and headers from the
  12140. // server.
  12141. googleapi.ServerResponse `json:"-"`
  12142. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12143. // to unconditionally include in API requests. By default, fields with
  12144. // empty values are omitted from API requests. However, any non-pointer,
  12145. // non-interface field appearing in ForceSendFields will be sent to the
  12146. // server regardless of whether the field is empty or not. This may be
  12147. // used to include empty fields in Patch requests.
  12148. ForceSendFields []string `json:"-"`
  12149. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12150. // include in API requests with the JSON null value. By default, fields
  12151. // with empty values are omitted from API requests. However, any field
  12152. // with an empty value appearing in NullFields will be sent to the
  12153. // server as null. It is an error if a field in this list has a
  12154. // non-empty value. This may be used to include null fields in Patch
  12155. // requests.
  12156. NullFields []string `json:"-"`
  12157. }
  12158. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  12159. type NoMethod LicenseCode
  12160. raw := NoMethod(*s)
  12161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12162. }
  12163. type LicenseCodeLicenseAlias struct {
  12164. // Description: [Output Only] Description of this License Code.
  12165. Description string `json:"description,omitempty"`
  12166. // SelfLink: [Output Only] URL of license corresponding to this License
  12167. // Code.
  12168. SelfLink string `json:"selfLink,omitempty"`
  12169. // ForceSendFields is a list of field names (e.g. "Description") to
  12170. // unconditionally include in API requests. By default, fields with
  12171. // empty values are omitted from API requests. However, any non-pointer,
  12172. // non-interface field appearing in ForceSendFields will be sent to the
  12173. // server regardless of whether the field is empty or not. This may be
  12174. // used to include empty fields in Patch requests.
  12175. ForceSendFields []string `json:"-"`
  12176. // NullFields is a list of field names (e.g. "Description") to include
  12177. // in API requests with the JSON null value. By default, fields with
  12178. // empty values are omitted from API requests. However, any field with
  12179. // an empty value appearing in NullFields will be sent to the server as
  12180. // null. It is an error if a field in this list has a non-empty value.
  12181. // This may be used to include null fields in Patch requests.
  12182. NullFields []string `json:"-"`
  12183. }
  12184. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  12185. type NoMethod LicenseCodeLicenseAlias
  12186. raw := NoMethod(*s)
  12187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12188. }
  12189. type LicenseResourceRequirements struct {
  12190. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  12191. // Instance. Enforced at Instance creation and Instance start.
  12192. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  12193. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  12194. // Instance creation and Instance start.
  12195. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  12196. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  12197. // unconditionally include in API requests. By default, fields with
  12198. // empty values are omitted from API requests. However, any non-pointer,
  12199. // non-interface field appearing in ForceSendFields will be sent to the
  12200. // server regardless of whether the field is empty or not. This may be
  12201. // used to include empty fields in Patch requests.
  12202. ForceSendFields []string `json:"-"`
  12203. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  12204. // include in API requests with the JSON null value. By default, fields
  12205. // with empty values are omitted from API requests. However, any field
  12206. // with an empty value appearing in NullFields will be sent to the
  12207. // server as null. It is an error if a field in this list has a
  12208. // non-empty value. This may be used to include null fields in Patch
  12209. // requests.
  12210. NullFields []string `json:"-"`
  12211. }
  12212. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  12213. type NoMethod LicenseResourceRequirements
  12214. raw := NoMethod(*s)
  12215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12216. }
  12217. type LicensesListResponse struct {
  12218. // Id: [Output Only] Unique identifier for the resource; defined by the
  12219. // server.
  12220. Id string `json:"id,omitempty"`
  12221. // Items: A list of License resources.
  12222. Items []*License `json:"items,omitempty"`
  12223. // NextPageToken: [Output Only] This token allows you to get the next
  12224. // page of results for list requests. If the number of results is larger
  12225. // than maxResults, use the nextPageToken as a value for the query
  12226. // parameter pageToken in the next list request. Subsequent list
  12227. // requests will have their own nextPageToken to continue paging through
  12228. // the results.
  12229. NextPageToken string `json:"nextPageToken,omitempty"`
  12230. // SelfLink: [Output Only] Server-defined URL for this resource.
  12231. SelfLink string `json:"selfLink,omitempty"`
  12232. // Warning: [Output Only] Informational warning message.
  12233. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  12234. // ServerResponse contains the HTTP response code and headers from the
  12235. // server.
  12236. googleapi.ServerResponse `json:"-"`
  12237. // ForceSendFields is a list of field names (e.g. "Id") to
  12238. // unconditionally include in API requests. By default, fields with
  12239. // empty values are omitted from API requests. However, any non-pointer,
  12240. // non-interface field appearing in ForceSendFields will be sent to the
  12241. // server regardless of whether the field is empty or not. This may be
  12242. // used to include empty fields in Patch requests.
  12243. ForceSendFields []string `json:"-"`
  12244. // NullFields is a list of field names (e.g. "Id") to include in API
  12245. // requests with the JSON null value. By default, fields with empty
  12246. // values are omitted from API requests. However, any field with an
  12247. // empty value appearing in NullFields will be sent to the server as
  12248. // null. It is an error if a field in this list has a non-empty value.
  12249. // This may be used to include null fields in Patch requests.
  12250. NullFields []string `json:"-"`
  12251. }
  12252. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  12253. type NoMethod LicensesListResponse
  12254. raw := NoMethod(*s)
  12255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12256. }
  12257. // LicensesListResponseWarning: [Output Only] Informational warning
  12258. // message.
  12259. type LicensesListResponseWarning struct {
  12260. // Code: [Output Only] A warning code, if applicable. For example,
  12261. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12262. // the response.
  12263. //
  12264. // Possible values:
  12265. // "CLEANUP_FAILED"
  12266. // "DEPRECATED_RESOURCE_USED"
  12267. // "DEPRECATED_TYPE_USED"
  12268. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12269. // "EXPERIMENTAL_TYPE_USED"
  12270. // "EXTERNAL_API_WARNING"
  12271. // "FIELD_VALUE_OVERRIDEN"
  12272. // "INJECTED_KERNELS_DEPRECATED"
  12273. // "MISSING_TYPE_DEPENDENCY"
  12274. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12275. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12276. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12277. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12278. // "NEXT_HOP_NOT_RUNNING"
  12279. // "NOT_CRITICAL_ERROR"
  12280. // "NO_RESULTS_ON_PAGE"
  12281. // "REQUIRED_TOS_AGREEMENT"
  12282. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12283. // "RESOURCE_NOT_DELETED"
  12284. // "SCHEMA_VALIDATION_IGNORED"
  12285. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12286. // "UNDECLARED_PROPERTIES"
  12287. // "UNREACHABLE"
  12288. Code string `json:"code,omitempty"`
  12289. // Data: [Output Only] Metadata about this warning in key: value format.
  12290. // For example:
  12291. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12292. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  12293. // Message: [Output Only] A human-readable description of the warning
  12294. // code.
  12295. Message string `json:"message,omitempty"`
  12296. // ForceSendFields is a list of field names (e.g. "Code") to
  12297. // unconditionally include in API requests. By default, fields with
  12298. // empty values are omitted from API requests. However, any non-pointer,
  12299. // non-interface field appearing in ForceSendFields will be sent to the
  12300. // server regardless of whether the field is empty or not. This may be
  12301. // used to include empty fields in Patch requests.
  12302. ForceSendFields []string `json:"-"`
  12303. // NullFields is a list of field names (e.g. "Code") to include in API
  12304. // requests with the JSON null value. By default, fields with empty
  12305. // values are omitted from API requests. However, any field with an
  12306. // empty value appearing in NullFields will be sent to the server as
  12307. // null. It is an error if a field in this list has a non-empty value.
  12308. // This may be used to include null fields in Patch requests.
  12309. NullFields []string `json:"-"`
  12310. }
  12311. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  12312. type NoMethod LicensesListResponseWarning
  12313. raw := NoMethod(*s)
  12314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12315. }
  12316. type LicensesListResponseWarningData struct {
  12317. // Key: [Output Only] A key that provides more detail on the warning
  12318. // being returned. For example, for warnings where there are no results
  12319. // in a list request for a particular zone, this key might be scope and
  12320. // the key value might be the zone name. Other examples might be a key
  12321. // indicating a deprecated resource and a suggested replacement, or a
  12322. // warning about invalid network settings (for example, if an instance
  12323. // attempts to perform IP forwarding but is not enabled for IP
  12324. // forwarding).
  12325. Key string `json:"key,omitempty"`
  12326. // Value: [Output Only] A warning data value corresponding to the key.
  12327. Value string `json:"value,omitempty"`
  12328. // ForceSendFields is a list of field names (e.g. "Key") to
  12329. // unconditionally include in API requests. By default, fields with
  12330. // empty values are omitted from API requests. However, any non-pointer,
  12331. // non-interface field appearing in ForceSendFields will be sent to the
  12332. // server regardless of whether the field is empty or not. This may be
  12333. // used to include empty fields in Patch requests.
  12334. ForceSendFields []string `json:"-"`
  12335. // NullFields is a list of field names (e.g. "Key") to include in API
  12336. // requests with the JSON null value. By default, fields with empty
  12337. // values are omitted from API requests. However, any field with an
  12338. // empty value appearing in NullFields will be sent to the server as
  12339. // null. It is an error if a field in this list has a non-empty value.
  12340. // This may be used to include null fields in Patch requests.
  12341. NullFields []string `json:"-"`
  12342. }
  12343. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  12344. type NoMethod LicensesListResponseWarningData
  12345. raw := NoMethod(*s)
  12346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12347. }
  12348. // LogConfig: Specifies what kind of log the caller must write
  12349. type LogConfig struct {
  12350. // CloudAudit: Cloud audit options.
  12351. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  12352. // Counter: Counter options.
  12353. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  12354. // DataAccess: Data access options.
  12355. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  12356. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  12357. // unconditionally include in API requests. By default, fields with
  12358. // empty values are omitted from API requests. However, any non-pointer,
  12359. // non-interface field appearing in ForceSendFields will be sent to the
  12360. // server regardless of whether the field is empty or not. This may be
  12361. // used to include empty fields in Patch requests.
  12362. ForceSendFields []string `json:"-"`
  12363. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  12364. // API requests with the JSON null value. By default, fields with empty
  12365. // values are omitted from API requests. However, any field with an
  12366. // empty value appearing in NullFields will be sent to the server as
  12367. // null. It is an error if a field in this list has a non-empty value.
  12368. // This may be used to include null fields in Patch requests.
  12369. NullFields []string `json:"-"`
  12370. }
  12371. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  12372. type NoMethod LogConfig
  12373. raw := NoMethod(*s)
  12374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12375. }
  12376. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  12377. type LogConfigCloudAuditOptions struct {
  12378. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  12379. // Logging pipeline.
  12380. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  12381. // LogName: The log_name to populate in the Cloud Audit Record.
  12382. //
  12383. // Possible values:
  12384. // "ADMIN_ACTIVITY"
  12385. // "DATA_ACCESS"
  12386. // "UNSPECIFIED_LOG_NAME"
  12387. LogName string `json:"logName,omitempty"`
  12388. // ForceSendFields is a list of field names (e.g.
  12389. // "AuthorizationLoggingOptions") to unconditionally include in API
  12390. // requests. By default, fields with empty values are omitted from API
  12391. // requests. However, any non-pointer, non-interface field appearing in
  12392. // ForceSendFields will be sent to the server regardless of whether the
  12393. // field is empty or not. This may be used to include empty fields in
  12394. // Patch requests.
  12395. ForceSendFields []string `json:"-"`
  12396. // NullFields is a list of field names (e.g.
  12397. // "AuthorizationLoggingOptions") to include in API requests with the
  12398. // JSON null value. By default, fields with empty values are omitted
  12399. // from API requests. However, any field with an empty value appearing
  12400. // in NullFields will be sent to the server as null. It is an error if a
  12401. // field in this list has a non-empty value. This may be used to include
  12402. // null fields in Patch requests.
  12403. NullFields []string `json:"-"`
  12404. }
  12405. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  12406. type NoMethod LogConfigCloudAuditOptions
  12407. raw := NoMethod(*s)
  12408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12409. }
  12410. // LogConfigCounterOptions: Increment a streamz counter with the
  12411. // specified metric and field names.
  12412. //
  12413. // Metric names should start with a '/', generally be lowercase-only,
  12414. // and end in "_count". Field names should not contain an initial slash.
  12415. // The actual exported metric names will have "/iam/policy"
  12416. // prepended.
  12417. //
  12418. // Field names correspond to IAM request parameters and field values are
  12419. // their respective values.
  12420. //
  12421. // Supported field names: - "authority", which is "[token]" if
  12422. // IAMContext.token is present, otherwise the value of
  12423. // IAMContext.authority_selector if present, and otherwise a
  12424. // representation of IAMContext.principal; or - "iam_principal", a
  12425. // representation of IAMContext.principal even if a token or authority
  12426. // selector is present; or - "" (empty string), resulting in a counter
  12427. // with no fields.
  12428. //
  12429. // Examples: counter { metric: "/debug_access_count" field:
  12430. // "iam_principal" } ==> increment counter
  12431. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  12432. // IAMContext.principal]}
  12433. //
  12434. // At this time we do not support multiple field names (though this may
  12435. // be supported in the future).
  12436. type LogConfigCounterOptions struct {
  12437. // Field: The field value to attribute.
  12438. Field string `json:"field,omitempty"`
  12439. // Metric: The metric to update.
  12440. Metric string `json:"metric,omitempty"`
  12441. // ForceSendFields is a list of field names (e.g. "Field") to
  12442. // unconditionally include in API requests. By default, fields with
  12443. // empty values are omitted from API requests. However, any non-pointer,
  12444. // non-interface field appearing in ForceSendFields will be sent to the
  12445. // server regardless of whether the field is empty or not. This may be
  12446. // used to include empty fields in Patch requests.
  12447. ForceSendFields []string `json:"-"`
  12448. // NullFields is a list of field names (e.g. "Field") to include in API
  12449. // requests with the JSON null value. By default, fields with empty
  12450. // values are omitted from API requests. However, any field with an
  12451. // empty value appearing in NullFields will be sent to the server as
  12452. // null. It is an error if a field in this list has a non-empty value.
  12453. // This may be used to include null fields in Patch requests.
  12454. NullFields []string `json:"-"`
  12455. }
  12456. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  12457. type NoMethod LogConfigCounterOptions
  12458. raw := NoMethod(*s)
  12459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12460. }
  12461. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  12462. type LogConfigDataAccessOptions struct {
  12463. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  12464. // the caller. This is relevant only in the LocalIAM implementation, for
  12465. // now.
  12466. //
  12467. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  12468. // while work is being done to satisfy the requirements of go/345.
  12469. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  12470. // still exists because there is active work being done to support it
  12471. // (b/115874152).
  12472. //
  12473. // Possible values:
  12474. // "LOG_FAIL_CLOSED"
  12475. // "LOG_MODE_UNSPECIFIED"
  12476. LogMode string `json:"logMode,omitempty"`
  12477. // ForceSendFields is a list of field names (e.g. "LogMode") to
  12478. // unconditionally include in API requests. By default, fields with
  12479. // empty values are omitted from API requests. However, any non-pointer,
  12480. // non-interface field appearing in ForceSendFields will be sent to the
  12481. // server regardless of whether the field is empty or not. This may be
  12482. // used to include empty fields in Patch requests.
  12483. ForceSendFields []string `json:"-"`
  12484. // NullFields is a list of field names (e.g. "LogMode") to include in
  12485. // API requests with the JSON null value. By default, fields with empty
  12486. // values are omitted from API requests. However, any field with an
  12487. // empty value appearing in NullFields will be sent to the server as
  12488. // null. It is an error if a field in this list has a non-empty value.
  12489. // This may be used to include null fields in Patch requests.
  12490. NullFields []string `json:"-"`
  12491. }
  12492. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  12493. type NoMethod LogConfigDataAccessOptions
  12494. raw := NoMethod(*s)
  12495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12496. }
  12497. // MachineType: A Machine Type resource. (== resource_for
  12498. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  12499. type MachineType struct {
  12500. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12501. // format.
  12502. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12503. // Deprecated: [Output Only] The deprecation status associated with this
  12504. // machine type.
  12505. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  12506. // Description: [Output Only] An optional textual description of the
  12507. // resource.
  12508. Description string `json:"description,omitempty"`
  12509. // GuestCpus: [Output Only] The number of virtual CPUs that are
  12510. // available to the instance.
  12511. GuestCpus int64 `json:"guestCpus,omitempty"`
  12512. // Id: [Output Only] The unique identifier for the resource. This
  12513. // identifier is defined by the server.
  12514. Id uint64 `json:"id,omitempty,string"`
  12515. // ImageSpaceGb: [Deprecated] This property is deprecated and will never
  12516. // be populated with any relevant values.
  12517. ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
  12518. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  12519. // CPU. See Shared-core machine types for more information.
  12520. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  12521. // Kind: [Output Only] The type of the resource. Always
  12522. // compute#machineType for machine types.
  12523. Kind string `json:"kind,omitempty"`
  12524. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  12525. // allowed.
  12526. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  12527. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  12528. // disks size (GB) allowed.
  12529. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  12530. // MemoryMb: [Output Only] The amount of physical memory available to
  12531. // the instance, defined in MB.
  12532. MemoryMb int64 `json:"memoryMb,omitempty"`
  12533. // Name: [Output Only] Name of the resource.
  12534. Name string `json:"name,omitempty"`
  12535. // ScratchDisks: [Output Only] A list of extended scratch disks assigned
  12536. // to the instance.
  12537. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
  12538. // SelfLink: [Output Only] Server-defined URL for the resource.
  12539. SelfLink string `json:"selfLink,omitempty"`
  12540. // Zone: [Output Only] The name of the zone where the machine type
  12541. // resides, such as us-central1-a.
  12542. Zone string `json:"zone,omitempty"`
  12543. // ServerResponse contains the HTTP response code and headers from the
  12544. // server.
  12545. googleapi.ServerResponse `json:"-"`
  12546. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12547. // to unconditionally include in API requests. By default, fields with
  12548. // empty values are omitted from API requests. However, any non-pointer,
  12549. // non-interface field appearing in ForceSendFields will be sent to the
  12550. // server regardless of whether the field is empty or not. This may be
  12551. // used to include empty fields in Patch requests.
  12552. ForceSendFields []string `json:"-"`
  12553. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12554. // include in API requests with the JSON null value. By default, fields
  12555. // with empty values are omitted from API requests. However, any field
  12556. // with an empty value appearing in NullFields will be sent to the
  12557. // server as null. It is an error if a field in this list has a
  12558. // non-empty value. This may be used to include null fields in Patch
  12559. // requests.
  12560. NullFields []string `json:"-"`
  12561. }
  12562. func (s *MachineType) MarshalJSON() ([]byte, error) {
  12563. type NoMethod MachineType
  12564. raw := NoMethod(*s)
  12565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12566. }
  12567. type MachineTypeScratchDisks struct {
  12568. // DiskGb: Size of the scratch disk, defined in GB.
  12569. DiskGb int64 `json:"diskGb,omitempty"`
  12570. // ForceSendFields is a list of field names (e.g. "DiskGb") to
  12571. // unconditionally include in API requests. By default, fields with
  12572. // empty values are omitted from API requests. However, any non-pointer,
  12573. // non-interface field appearing in ForceSendFields will be sent to the
  12574. // server regardless of whether the field is empty or not. This may be
  12575. // used to include empty fields in Patch requests.
  12576. ForceSendFields []string `json:"-"`
  12577. // NullFields is a list of field names (e.g. "DiskGb") to include in API
  12578. // requests with the JSON null value. By default, fields with empty
  12579. // values are omitted from API requests. However, any field with an
  12580. // empty value appearing in NullFields will be sent to the server as
  12581. // null. It is an error if a field in this list has a non-empty value.
  12582. // This may be used to include null fields in Patch requests.
  12583. NullFields []string `json:"-"`
  12584. }
  12585. func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
  12586. type NoMethod MachineTypeScratchDisks
  12587. raw := NoMethod(*s)
  12588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12589. }
  12590. type MachineTypeAggregatedList struct {
  12591. // Id: [Output Only] Unique identifier for the resource; defined by the
  12592. // server.
  12593. Id string `json:"id,omitempty"`
  12594. // Items: A list of MachineTypesScopedList resources.
  12595. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  12596. // Kind: [Output Only] Type of resource. Always
  12597. // compute#machineTypeAggregatedList for aggregated lists of machine
  12598. // types.
  12599. Kind string `json:"kind,omitempty"`
  12600. // NextPageToken: [Output Only] This token allows you to get the next
  12601. // page of results for list requests. If the number of results is larger
  12602. // than maxResults, use the nextPageToken as a value for the query
  12603. // parameter pageToken in the next list request. Subsequent list
  12604. // requests will have their own nextPageToken to continue paging through
  12605. // the results.
  12606. NextPageToken string `json:"nextPageToken,omitempty"`
  12607. // SelfLink: [Output Only] Server-defined URL for this resource.
  12608. SelfLink string `json:"selfLink,omitempty"`
  12609. // Warning: [Output Only] Informational warning message.
  12610. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  12611. // ServerResponse contains the HTTP response code and headers from the
  12612. // server.
  12613. googleapi.ServerResponse `json:"-"`
  12614. // ForceSendFields is a list of field names (e.g. "Id") to
  12615. // unconditionally include in API requests. By default, fields with
  12616. // empty values are omitted from API requests. However, any non-pointer,
  12617. // non-interface field appearing in ForceSendFields will be sent to the
  12618. // server regardless of whether the field is empty or not. This may be
  12619. // used to include empty fields in Patch requests.
  12620. ForceSendFields []string `json:"-"`
  12621. // NullFields is a list of field names (e.g. "Id") to include in API
  12622. // requests with the JSON null value. By default, fields with empty
  12623. // values are omitted from API requests. However, any field with an
  12624. // empty value appearing in NullFields will be sent to the server as
  12625. // null. It is an error if a field in this list has a non-empty value.
  12626. // This may be used to include null fields in Patch requests.
  12627. NullFields []string `json:"-"`
  12628. }
  12629. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  12630. type NoMethod MachineTypeAggregatedList
  12631. raw := NoMethod(*s)
  12632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12633. }
  12634. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  12635. // message.
  12636. type MachineTypeAggregatedListWarning struct {
  12637. // Code: [Output Only] A warning code, if applicable. For example,
  12638. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12639. // the response.
  12640. //
  12641. // Possible values:
  12642. // "CLEANUP_FAILED"
  12643. // "DEPRECATED_RESOURCE_USED"
  12644. // "DEPRECATED_TYPE_USED"
  12645. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12646. // "EXPERIMENTAL_TYPE_USED"
  12647. // "EXTERNAL_API_WARNING"
  12648. // "FIELD_VALUE_OVERRIDEN"
  12649. // "INJECTED_KERNELS_DEPRECATED"
  12650. // "MISSING_TYPE_DEPENDENCY"
  12651. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12652. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12653. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12654. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12655. // "NEXT_HOP_NOT_RUNNING"
  12656. // "NOT_CRITICAL_ERROR"
  12657. // "NO_RESULTS_ON_PAGE"
  12658. // "REQUIRED_TOS_AGREEMENT"
  12659. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12660. // "RESOURCE_NOT_DELETED"
  12661. // "SCHEMA_VALIDATION_IGNORED"
  12662. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12663. // "UNDECLARED_PROPERTIES"
  12664. // "UNREACHABLE"
  12665. Code string `json:"code,omitempty"`
  12666. // Data: [Output Only] Metadata about this warning in key: value format.
  12667. // For example:
  12668. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12669. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  12670. // Message: [Output Only] A human-readable description of the warning
  12671. // code.
  12672. Message string `json:"message,omitempty"`
  12673. // ForceSendFields is a list of field names (e.g. "Code") to
  12674. // unconditionally include in API requests. By default, fields with
  12675. // empty values are omitted from API requests. However, any non-pointer,
  12676. // non-interface field appearing in ForceSendFields will be sent to the
  12677. // server regardless of whether the field is empty or not. This may be
  12678. // used to include empty fields in Patch requests.
  12679. ForceSendFields []string `json:"-"`
  12680. // NullFields is a list of field names (e.g. "Code") to include in API
  12681. // requests with the JSON null value. By default, fields with empty
  12682. // values are omitted from API requests. However, any field with an
  12683. // empty value appearing in NullFields will be sent to the server as
  12684. // null. It is an error if a field in this list has a non-empty value.
  12685. // This may be used to include null fields in Patch requests.
  12686. NullFields []string `json:"-"`
  12687. }
  12688. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12689. type NoMethod MachineTypeAggregatedListWarning
  12690. raw := NoMethod(*s)
  12691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12692. }
  12693. type MachineTypeAggregatedListWarningData struct {
  12694. // Key: [Output Only] A key that provides more detail on the warning
  12695. // being returned. For example, for warnings where there are no results
  12696. // in a list request for a particular zone, this key might be scope and
  12697. // the key value might be the zone name. Other examples might be a key
  12698. // indicating a deprecated resource and a suggested replacement, or a
  12699. // warning about invalid network settings (for example, if an instance
  12700. // attempts to perform IP forwarding but is not enabled for IP
  12701. // forwarding).
  12702. Key string `json:"key,omitempty"`
  12703. // Value: [Output Only] A warning data value corresponding to the key.
  12704. Value string `json:"value,omitempty"`
  12705. // ForceSendFields is a list of field names (e.g. "Key") to
  12706. // unconditionally include in API requests. By default, fields with
  12707. // empty values are omitted from API requests. However, any non-pointer,
  12708. // non-interface field appearing in ForceSendFields will be sent to the
  12709. // server regardless of whether the field is empty or not. This may be
  12710. // used to include empty fields in Patch requests.
  12711. ForceSendFields []string `json:"-"`
  12712. // NullFields is a list of field names (e.g. "Key") to include in API
  12713. // requests with the JSON null value. By default, fields with empty
  12714. // values are omitted from API requests. However, any field with an
  12715. // empty value appearing in NullFields will be sent to the server as
  12716. // null. It is an error if a field in this list has a non-empty value.
  12717. // This may be used to include null fields in Patch requests.
  12718. NullFields []string `json:"-"`
  12719. }
  12720. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12721. type NoMethod MachineTypeAggregatedListWarningData
  12722. raw := NoMethod(*s)
  12723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12724. }
  12725. // MachineTypeList: Contains a list of machine types.
  12726. type MachineTypeList struct {
  12727. // Id: [Output Only] Unique identifier for the resource; defined by the
  12728. // server.
  12729. Id string `json:"id,omitempty"`
  12730. // Items: A list of MachineType resources.
  12731. Items []*MachineType `json:"items,omitempty"`
  12732. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  12733. // for lists of machine types.
  12734. Kind string `json:"kind,omitempty"`
  12735. // NextPageToken: [Output Only] This token allows you to get the next
  12736. // page of results for list requests. If the number of results is larger
  12737. // than maxResults, use the nextPageToken as a value for the query
  12738. // parameter pageToken in the next list request. Subsequent list
  12739. // requests will have their own nextPageToken to continue paging through
  12740. // the results.
  12741. NextPageToken string `json:"nextPageToken,omitempty"`
  12742. // SelfLink: [Output Only] Server-defined URL for this resource.
  12743. SelfLink string `json:"selfLink,omitempty"`
  12744. // Warning: [Output Only] Informational warning message.
  12745. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  12746. // ServerResponse contains the HTTP response code and headers from the
  12747. // server.
  12748. googleapi.ServerResponse `json:"-"`
  12749. // ForceSendFields is a list of field names (e.g. "Id") to
  12750. // unconditionally include in API requests. By default, fields with
  12751. // empty values are omitted from API requests. However, any non-pointer,
  12752. // non-interface field appearing in ForceSendFields will be sent to the
  12753. // server regardless of whether the field is empty or not. This may be
  12754. // used to include empty fields in Patch requests.
  12755. ForceSendFields []string `json:"-"`
  12756. // NullFields is a list of field names (e.g. "Id") to include in API
  12757. // requests with the JSON null value. By default, fields with empty
  12758. // values are omitted from API requests. However, any field with an
  12759. // empty value appearing in NullFields will be sent to the server as
  12760. // null. It is an error if a field in this list has a non-empty value.
  12761. // This may be used to include null fields in Patch requests.
  12762. NullFields []string `json:"-"`
  12763. }
  12764. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  12765. type NoMethod MachineTypeList
  12766. raw := NoMethod(*s)
  12767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12768. }
  12769. // MachineTypeListWarning: [Output Only] Informational warning message.
  12770. type MachineTypeListWarning struct {
  12771. // Code: [Output Only] A warning code, if applicable. For example,
  12772. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12773. // the response.
  12774. //
  12775. // Possible values:
  12776. // "CLEANUP_FAILED"
  12777. // "DEPRECATED_RESOURCE_USED"
  12778. // "DEPRECATED_TYPE_USED"
  12779. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12780. // "EXPERIMENTAL_TYPE_USED"
  12781. // "EXTERNAL_API_WARNING"
  12782. // "FIELD_VALUE_OVERRIDEN"
  12783. // "INJECTED_KERNELS_DEPRECATED"
  12784. // "MISSING_TYPE_DEPENDENCY"
  12785. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12786. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12787. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12788. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12789. // "NEXT_HOP_NOT_RUNNING"
  12790. // "NOT_CRITICAL_ERROR"
  12791. // "NO_RESULTS_ON_PAGE"
  12792. // "REQUIRED_TOS_AGREEMENT"
  12793. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12794. // "RESOURCE_NOT_DELETED"
  12795. // "SCHEMA_VALIDATION_IGNORED"
  12796. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12797. // "UNDECLARED_PROPERTIES"
  12798. // "UNREACHABLE"
  12799. Code string `json:"code,omitempty"`
  12800. // Data: [Output Only] Metadata about this warning in key: value format.
  12801. // For example:
  12802. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12803. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  12804. // Message: [Output Only] A human-readable description of the warning
  12805. // code.
  12806. Message string `json:"message,omitempty"`
  12807. // ForceSendFields is a list of field names (e.g. "Code") to
  12808. // unconditionally include in API requests. By default, fields with
  12809. // empty values are omitted from API requests. However, any non-pointer,
  12810. // non-interface field appearing in ForceSendFields will be sent to the
  12811. // server regardless of whether the field is empty or not. This may be
  12812. // used to include empty fields in Patch requests.
  12813. ForceSendFields []string `json:"-"`
  12814. // NullFields is a list of field names (e.g. "Code") to include in API
  12815. // requests with the JSON null value. By default, fields with empty
  12816. // values are omitted from API requests. However, any field with an
  12817. // empty value appearing in NullFields will be sent to the server as
  12818. // null. It is an error if a field in this list has a non-empty value.
  12819. // This may be used to include null fields in Patch requests.
  12820. NullFields []string `json:"-"`
  12821. }
  12822. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  12823. type NoMethod MachineTypeListWarning
  12824. raw := NoMethod(*s)
  12825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12826. }
  12827. type MachineTypeListWarningData struct {
  12828. // Key: [Output Only] A key that provides more detail on the warning
  12829. // being returned. For example, for warnings where there are no results
  12830. // in a list request for a particular zone, this key might be scope and
  12831. // the key value might be the zone name. Other examples might be a key
  12832. // indicating a deprecated resource and a suggested replacement, or a
  12833. // warning about invalid network settings (for example, if an instance
  12834. // attempts to perform IP forwarding but is not enabled for IP
  12835. // forwarding).
  12836. Key string `json:"key,omitempty"`
  12837. // Value: [Output Only] A warning data value corresponding to the key.
  12838. Value string `json:"value,omitempty"`
  12839. // ForceSendFields is a list of field names (e.g. "Key") to
  12840. // unconditionally include in API requests. By default, fields with
  12841. // empty values are omitted from API requests. However, any non-pointer,
  12842. // non-interface field appearing in ForceSendFields will be sent to the
  12843. // server regardless of whether the field is empty or not. This may be
  12844. // used to include empty fields in Patch requests.
  12845. ForceSendFields []string `json:"-"`
  12846. // NullFields is a list of field names (e.g. "Key") to include in API
  12847. // requests with the JSON null value. By default, fields with empty
  12848. // values are omitted from API requests. However, any field with an
  12849. // empty value appearing in NullFields will be sent to the server as
  12850. // null. It is an error if a field in this list has a non-empty value.
  12851. // This may be used to include null fields in Patch requests.
  12852. NullFields []string `json:"-"`
  12853. }
  12854. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  12855. type NoMethod MachineTypeListWarningData
  12856. raw := NoMethod(*s)
  12857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12858. }
  12859. type MachineTypesScopedList struct {
  12860. // MachineTypes: [Output Only] A list of machine types contained in this
  12861. // scope.
  12862. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  12863. // Warning: [Output Only] An informational warning that appears when the
  12864. // machine types list is empty.
  12865. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  12866. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  12867. // unconditionally include in API requests. By default, fields with
  12868. // empty values are omitted from API requests. However, any non-pointer,
  12869. // non-interface field appearing in ForceSendFields will be sent to the
  12870. // server regardless of whether the field is empty or not. This may be
  12871. // used to include empty fields in Patch requests.
  12872. ForceSendFields []string `json:"-"`
  12873. // NullFields is a list of field names (e.g. "MachineTypes") to include
  12874. // in API requests with the JSON null value. By default, fields with
  12875. // empty values are omitted from API requests. However, any field with
  12876. // an empty value appearing in NullFields will be sent to the server as
  12877. // null. It is an error if a field in this list has a non-empty value.
  12878. // This may be used to include null fields in Patch requests.
  12879. NullFields []string `json:"-"`
  12880. }
  12881. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  12882. type NoMethod MachineTypesScopedList
  12883. raw := NoMethod(*s)
  12884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12885. }
  12886. // MachineTypesScopedListWarning: [Output Only] An informational warning
  12887. // that appears when the machine types list is empty.
  12888. type MachineTypesScopedListWarning struct {
  12889. // Code: [Output Only] A warning code, if applicable. For example,
  12890. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12891. // the response.
  12892. //
  12893. // Possible values:
  12894. // "CLEANUP_FAILED"
  12895. // "DEPRECATED_RESOURCE_USED"
  12896. // "DEPRECATED_TYPE_USED"
  12897. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12898. // "EXPERIMENTAL_TYPE_USED"
  12899. // "EXTERNAL_API_WARNING"
  12900. // "FIELD_VALUE_OVERRIDEN"
  12901. // "INJECTED_KERNELS_DEPRECATED"
  12902. // "MISSING_TYPE_DEPENDENCY"
  12903. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12904. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12905. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12906. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12907. // "NEXT_HOP_NOT_RUNNING"
  12908. // "NOT_CRITICAL_ERROR"
  12909. // "NO_RESULTS_ON_PAGE"
  12910. // "REQUIRED_TOS_AGREEMENT"
  12911. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12912. // "RESOURCE_NOT_DELETED"
  12913. // "SCHEMA_VALIDATION_IGNORED"
  12914. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12915. // "UNDECLARED_PROPERTIES"
  12916. // "UNREACHABLE"
  12917. Code string `json:"code,omitempty"`
  12918. // Data: [Output Only] Metadata about this warning in key: value format.
  12919. // For example:
  12920. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12921. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  12922. // Message: [Output Only] A human-readable description of the warning
  12923. // code.
  12924. Message string `json:"message,omitempty"`
  12925. // ForceSendFields is a list of field names (e.g. "Code") to
  12926. // unconditionally include in API requests. By default, fields with
  12927. // empty values are omitted from API requests. However, any non-pointer,
  12928. // non-interface field appearing in ForceSendFields will be sent to the
  12929. // server regardless of whether the field is empty or not. This may be
  12930. // used to include empty fields in Patch requests.
  12931. ForceSendFields []string `json:"-"`
  12932. // NullFields is a list of field names (e.g. "Code") to include in API
  12933. // requests with the JSON null value. By default, fields with empty
  12934. // values are omitted from API requests. However, any field with an
  12935. // empty value appearing in NullFields will be sent to the server as
  12936. // null. It is an error if a field in this list has a non-empty value.
  12937. // This may be used to include null fields in Patch requests.
  12938. NullFields []string `json:"-"`
  12939. }
  12940. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  12941. type NoMethod MachineTypesScopedListWarning
  12942. raw := NoMethod(*s)
  12943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12944. }
  12945. type MachineTypesScopedListWarningData struct {
  12946. // Key: [Output Only] A key that provides more detail on the warning
  12947. // being returned. For example, for warnings where there are no results
  12948. // in a list request for a particular zone, this key might be scope and
  12949. // the key value might be the zone name. Other examples might be a key
  12950. // indicating a deprecated resource and a suggested replacement, or a
  12951. // warning about invalid network settings (for example, if an instance
  12952. // attempts to perform IP forwarding but is not enabled for IP
  12953. // forwarding).
  12954. Key string `json:"key,omitempty"`
  12955. // Value: [Output Only] A warning data value corresponding to the key.
  12956. Value string `json:"value,omitempty"`
  12957. // ForceSendFields is a list of field names (e.g. "Key") to
  12958. // unconditionally include in API requests. By default, fields with
  12959. // empty values are omitted from API requests. However, any non-pointer,
  12960. // non-interface field appearing in ForceSendFields will be sent to the
  12961. // server regardless of whether the field is empty or not. This may be
  12962. // used to include empty fields in Patch requests.
  12963. ForceSendFields []string `json:"-"`
  12964. // NullFields is a list of field names (e.g. "Key") to include in API
  12965. // requests with the JSON null value. By default, fields with empty
  12966. // values are omitted from API requests. However, any field with an
  12967. // empty value appearing in NullFields will be sent to the server as
  12968. // null. It is an error if a field in this list has a non-empty value.
  12969. // This may be used to include null fields in Patch requests.
  12970. NullFields []string `json:"-"`
  12971. }
  12972. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  12973. type NoMethod MachineTypesScopedListWarningData
  12974. raw := NoMethod(*s)
  12975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12976. }
  12977. // ManagedInstance: A Managed Instance resource.
  12978. type ManagedInstance struct {
  12979. // CurrentAction: [Output Only] The current action that the managed
  12980. // instance group has scheduled for the instance. Possible values:
  12981. // - NONE The instance is running, and the managed instance group does
  12982. // not have any scheduled actions for this instance.
  12983. // - CREATING The managed instance group is creating this instance. If
  12984. // the group fails to create this instance, it will try again until it
  12985. // is successful.
  12986. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  12987. // to create this instance only once. If the group fails to create this
  12988. // instance, it does not try again and the group's targetSize value is
  12989. // decreased instead.
  12990. // - RECREATING The managed instance group is recreating this instance.
  12991. //
  12992. // - DELETING The managed instance group is permanently deleting this
  12993. // instance.
  12994. // - ABANDONING The managed instance group is abandoning this instance.
  12995. // The instance will be removed from the instance group and from any
  12996. // target pools that are associated with this group.
  12997. // - RESTARTING The managed instance group is restarting the instance.
  12998. //
  12999. // - REFRESHING The managed instance group is applying configuration
  13000. // changes to the instance without stopping it. For example, the group
  13001. // can update the target pool list for an instance without stopping that
  13002. // instance.
  13003. // - VERIFYING The managed instance group has created the instance and
  13004. // it is in the process of being verified.
  13005. //
  13006. // Possible values:
  13007. // "ABANDONING"
  13008. // "CREATING"
  13009. // "CREATING_WITHOUT_RETRIES"
  13010. // "DELETING"
  13011. // "NONE"
  13012. // "RECREATING"
  13013. // "REFRESHING"
  13014. // "RESTARTING"
  13015. // "VERIFYING"
  13016. CurrentAction string `json:"currentAction,omitempty"`
  13017. // Id: [Output only] The unique identifier for this resource. This field
  13018. // is empty when instance does not exist.
  13019. Id uint64 `json:"id,omitempty,string"`
  13020. // Instance: [Output Only] The URL of the instance. The URL can exist
  13021. // even if the instance has not yet been created.
  13022. Instance string `json:"instance,omitempty"`
  13023. // InstanceStatus: [Output Only] The status of the instance. This field
  13024. // is empty when the instance does not exist.
  13025. //
  13026. // Possible values:
  13027. // "PROVISIONING"
  13028. // "RUNNING"
  13029. // "STAGING"
  13030. // "STOPPED"
  13031. // "STOPPING"
  13032. // "SUSPENDED"
  13033. // "SUSPENDING"
  13034. // "TERMINATED"
  13035. InstanceStatus string `json:"instanceStatus,omitempty"`
  13036. // LastAttempt: [Output Only] Information about the last attempt to
  13037. // create or delete the instance.
  13038. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  13039. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  13040. // unconditionally include in API requests. By default, fields with
  13041. // empty values are omitted from API requests. However, any non-pointer,
  13042. // non-interface field appearing in ForceSendFields will be sent to the
  13043. // server regardless of whether the field is empty or not. This may be
  13044. // used to include empty fields in Patch requests.
  13045. ForceSendFields []string `json:"-"`
  13046. // NullFields is a list of field names (e.g. "CurrentAction") to include
  13047. // in API requests with the JSON null value. By default, fields with
  13048. // empty values are omitted from API requests. However, any field with
  13049. // an empty value appearing in NullFields will be sent to the server as
  13050. // null. It is an error if a field in this list has a non-empty value.
  13051. // This may be used to include null fields in Patch requests.
  13052. NullFields []string `json:"-"`
  13053. }
  13054. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  13055. type NoMethod ManagedInstance
  13056. raw := NoMethod(*s)
  13057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13058. }
  13059. type ManagedInstanceLastAttempt struct {
  13060. // Errors: [Output Only] Encountered errors during the last attempt to
  13061. // create or delete the instance.
  13062. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  13063. // ForceSendFields is a list of field names (e.g. "Errors") to
  13064. // unconditionally include in API requests. By default, fields with
  13065. // empty values are omitted from API requests. However, any non-pointer,
  13066. // non-interface field appearing in ForceSendFields will be sent to the
  13067. // server regardless of whether the field is empty or not. This may be
  13068. // used to include empty fields in Patch requests.
  13069. ForceSendFields []string `json:"-"`
  13070. // NullFields is a list of field names (e.g. "Errors") to include in API
  13071. // requests with the JSON null value. By default, fields with empty
  13072. // values are omitted from API requests. However, any field with an
  13073. // empty value appearing in NullFields will be sent to the server as
  13074. // null. It is an error if a field in this list has a non-empty value.
  13075. // This may be used to include null fields in Patch requests.
  13076. NullFields []string `json:"-"`
  13077. }
  13078. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  13079. type NoMethod ManagedInstanceLastAttempt
  13080. raw := NoMethod(*s)
  13081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13082. }
  13083. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  13084. // during the last attempt to create or delete the instance.
  13085. type ManagedInstanceLastAttemptErrors struct {
  13086. // Errors: [Output Only] The array of errors encountered while
  13087. // processing this operation.
  13088. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  13089. // ForceSendFields is a list of field names (e.g. "Errors") to
  13090. // unconditionally include in API requests. By default, fields with
  13091. // empty values are omitted from API requests. However, any non-pointer,
  13092. // non-interface field appearing in ForceSendFields will be sent to the
  13093. // server regardless of whether the field is empty or not. This may be
  13094. // used to include empty fields in Patch requests.
  13095. ForceSendFields []string `json:"-"`
  13096. // NullFields is a list of field names (e.g. "Errors") to include in API
  13097. // requests with the JSON null value. By default, fields with empty
  13098. // values are omitted from API requests. However, any field with an
  13099. // empty value appearing in NullFields will be sent to the server as
  13100. // null. It is an error if a field in this list has a non-empty value.
  13101. // This may be used to include null fields in Patch requests.
  13102. NullFields []string `json:"-"`
  13103. }
  13104. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  13105. type NoMethod ManagedInstanceLastAttemptErrors
  13106. raw := NoMethod(*s)
  13107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13108. }
  13109. type ManagedInstanceLastAttemptErrorsErrors struct {
  13110. // Code: [Output Only] The error type identifier for this error.
  13111. Code string `json:"code,omitempty"`
  13112. // Location: [Output Only] Indicates the field in the request that
  13113. // caused the error. This property is optional.
  13114. Location string `json:"location,omitempty"`
  13115. // Message: [Output Only] An optional, human-readable error message.
  13116. Message string `json:"message,omitempty"`
  13117. // ForceSendFields is a list of field names (e.g. "Code") to
  13118. // unconditionally include in API requests. By default, fields with
  13119. // empty values are omitted from API requests. However, any non-pointer,
  13120. // non-interface field appearing in ForceSendFields will be sent to the
  13121. // server regardless of whether the field is empty or not. This may be
  13122. // used to include empty fields in Patch requests.
  13123. ForceSendFields []string `json:"-"`
  13124. // NullFields is a list of field names (e.g. "Code") to include in API
  13125. // requests with the JSON null value. By default, fields with empty
  13126. // values are omitted from API requests. However, any field with an
  13127. // empty value appearing in NullFields will be sent to the server as
  13128. // null. It is an error if a field in this list has a non-empty value.
  13129. // This may be used to include null fields in Patch requests.
  13130. NullFields []string `json:"-"`
  13131. }
  13132. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  13133. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  13134. raw := NoMethod(*s)
  13135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13136. }
  13137. // Metadata: A metadata key/value entry.
  13138. type Metadata struct {
  13139. // Fingerprint: Specifies a fingerprint for this request, which is
  13140. // essentially a hash of the metadata's contents and used for optimistic
  13141. // locking. The fingerprint is initially generated by Compute Engine and
  13142. // changes after every request to modify or update metadata. You must
  13143. // always provide an up-to-date fingerprint hash in order to update or
  13144. // change metadata, otherwise the request will fail with error 412
  13145. // conditionNotMet.
  13146. //
  13147. // To see the latest fingerprint, make a get() request to retrieve the
  13148. // resource.
  13149. Fingerprint string `json:"fingerprint,omitempty"`
  13150. // Items: Array of key/value pairs. The total size of all keys and
  13151. // values must be less than 512 KB.
  13152. Items []*MetadataItems `json:"items,omitempty"`
  13153. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  13154. // metadata.
  13155. Kind string `json:"kind,omitempty"`
  13156. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13157. // unconditionally include in API requests. By default, fields with
  13158. // empty values are omitted from API requests. However, any non-pointer,
  13159. // non-interface field appearing in ForceSendFields will be sent to the
  13160. // server regardless of whether the field is empty or not. This may be
  13161. // used to include empty fields in Patch requests.
  13162. ForceSendFields []string `json:"-"`
  13163. // NullFields is a list of field names (e.g. "Fingerprint") to include
  13164. // in API requests with the JSON null value. By default, fields with
  13165. // empty values are omitted from API requests. However, any field with
  13166. // an empty value appearing in NullFields will be sent to the server as
  13167. // null. It is an error if a field in this list has a non-empty value.
  13168. // This may be used to include null fields in Patch requests.
  13169. NullFields []string `json:"-"`
  13170. }
  13171. func (s *Metadata) MarshalJSON() ([]byte, error) {
  13172. type NoMethod Metadata
  13173. raw := NoMethod(*s)
  13174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13175. }
  13176. type MetadataItems struct {
  13177. // Key: Key for the metadata entry. Keys must conform to the following
  13178. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  13179. // reflected as part of a URL in the metadata server. Additionally, to
  13180. // avoid ambiguity, keys must not conflict with any other metadata keys
  13181. // for the project.
  13182. Key string `json:"key,omitempty"`
  13183. // Value: Value for the metadata entry. These are free-form strings, and
  13184. // only have meaning as interpreted by the image running in the
  13185. // instance. The only restriction placed on values is that their size
  13186. // must be less than or equal to 262144 bytes (256 KiB).
  13187. Value *string `json:"value,omitempty"`
  13188. // ForceSendFields is a list of field names (e.g. "Key") to
  13189. // unconditionally include in API requests. By default, fields with
  13190. // empty values are omitted from API requests. However, any non-pointer,
  13191. // non-interface field appearing in ForceSendFields will be sent to the
  13192. // server regardless of whether the field is empty or not. This may be
  13193. // used to include empty fields in Patch requests.
  13194. ForceSendFields []string `json:"-"`
  13195. // NullFields is a list of field names (e.g. "Key") to include in API
  13196. // requests with the JSON null value. By default, fields with empty
  13197. // values are omitted from API requests. However, any field with an
  13198. // empty value appearing in NullFields will be sent to the server as
  13199. // null. It is an error if a field in this list has a non-empty value.
  13200. // This may be used to include null fields in Patch requests.
  13201. NullFields []string `json:"-"`
  13202. }
  13203. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  13204. type NoMethod MetadataItems
  13205. raw := NoMethod(*s)
  13206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13207. }
  13208. // NamedPort: The named port. For example: .
  13209. type NamedPort struct {
  13210. // Name: The name for this named port. The name must be 1-63 characters
  13211. // long, and comply with RFC1035.
  13212. Name string `json:"name,omitempty"`
  13213. // Port: The port number, which can be a value between 1 and 65535.
  13214. Port int64 `json:"port,omitempty"`
  13215. // ForceSendFields is a list of field names (e.g. "Name") to
  13216. // unconditionally include in API requests. By default, fields with
  13217. // empty values are omitted from API requests. However, any non-pointer,
  13218. // non-interface field appearing in ForceSendFields will be sent to the
  13219. // server regardless of whether the field is empty or not. This may be
  13220. // used to include empty fields in Patch requests.
  13221. ForceSendFields []string `json:"-"`
  13222. // NullFields is a list of field names (e.g. "Name") to include in API
  13223. // requests with the JSON null value. By default, fields with empty
  13224. // values are omitted from API requests. However, any field with an
  13225. // empty value appearing in NullFields will be sent to the server as
  13226. // null. It is an error if a field in this list has a non-empty value.
  13227. // This may be used to include null fields in Patch requests.
  13228. NullFields []string `json:"-"`
  13229. }
  13230. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  13231. type NoMethod NamedPort
  13232. raw := NoMethod(*s)
  13233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13234. }
  13235. // Network: Represents a Network resource. Read Virtual Private Cloud
  13236. // (VPC) Network Overview for more information. (== resource_for
  13237. // v1.networks ==) (== resource_for beta.networks ==)
  13238. type Network struct {
  13239. // IPv4Range: The range of internal addresses that are legal on this
  13240. // network. This range is a CIDR specification, for example:
  13241. // 192.168.0.0/16. Provided by the client when the network is created.
  13242. IPv4Range string `json:"IPv4Range,omitempty"`
  13243. // AutoCreateSubnetworks: When set to true, the VPC network is created
  13244. // in "auto" mode. When set to false, the VPC network is created in
  13245. // "custom" mode.
  13246. //
  13247. // An auto mode VPC network starts with one subnet per region. Each
  13248. // subnet has a predetermined range as described in Auto mode VPC
  13249. // network IP ranges.
  13250. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  13251. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13252. // format.
  13253. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13254. // Description: An optional description of this resource. Provide this
  13255. // property when you create the resource.
  13256. Description string `json:"description,omitempty"`
  13257. // GatewayIPv4: [Output Only] The gateway address for default routing
  13258. // out of the network. This value is read only and is selected by GCP.
  13259. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  13260. // Id: [Output Only] The unique identifier for the resource. This
  13261. // identifier is defined by the server.
  13262. Id uint64 `json:"id,omitempty,string"`
  13263. // Kind: [Output Only] Type of the resource. Always compute#network for
  13264. // networks.
  13265. Kind string `json:"kind,omitempty"`
  13266. // Name: Name of the resource. Provided by the client when the resource
  13267. // is created. The name must be 1-63 characters long, and comply with
  13268. // RFC1035. Specifically, the name must be 1-63 characters long and
  13269. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13270. // the first character must be a lowercase letter, and all following
  13271. // characters must be a dash, lowercase letter, or digit, except the
  13272. // last character, which cannot be a dash.
  13273. Name string `json:"name,omitempty"`
  13274. // Peerings: [Output Only] A list of network peerings for the resource.
  13275. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  13276. // RoutingConfig: The network-level routing configuration for this
  13277. // network. Used by Cloud Router to determine what type of network-wide
  13278. // routing behavior to enforce.
  13279. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  13280. // SelfLink: [Output Only] Server-defined URL for the resource.
  13281. SelfLink string `json:"selfLink,omitempty"`
  13282. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  13283. // all subnetworks in this VPC network.
  13284. Subnetworks []string `json:"subnetworks,omitempty"`
  13285. // ServerResponse contains the HTTP response code and headers from the
  13286. // server.
  13287. googleapi.ServerResponse `json:"-"`
  13288. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  13289. // unconditionally include in API requests. By default, fields with
  13290. // empty values are omitted from API requests. However, any non-pointer,
  13291. // non-interface field appearing in ForceSendFields will be sent to the
  13292. // server regardless of whether the field is empty or not. This may be
  13293. // used to include empty fields in Patch requests.
  13294. ForceSendFields []string `json:"-"`
  13295. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  13296. // API requests with the JSON null value. By default, fields with empty
  13297. // values are omitted from API requests. However, any field with an
  13298. // empty value appearing in NullFields will be sent to the server as
  13299. // null. It is an error if a field in this list has a non-empty value.
  13300. // This may be used to include null fields in Patch requests.
  13301. NullFields []string `json:"-"`
  13302. }
  13303. func (s *Network) MarshalJSON() ([]byte, error) {
  13304. type NoMethod Network
  13305. raw := NoMethod(*s)
  13306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13307. }
  13308. // NetworkInterface: A network interface resource attached to an
  13309. // instance.
  13310. type NetworkInterface struct {
  13311. // AccessConfigs: An array of configurations for this interface.
  13312. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  13313. // there are no accessConfigs specified, then this instance will have no
  13314. // external internet access.
  13315. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  13316. // AliasIpRanges: An array of alias IP ranges for this network
  13317. // interface. Can only be specified for network interfaces on
  13318. // subnet-mode networks.
  13319. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  13320. // Fingerprint: Fingerprint hash of contents stored in this network
  13321. // interface. This field will be ignored when inserting an Instance or
  13322. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  13323. // in order to update the NetworkInterface, otherwise the request will
  13324. // fail with error 412 conditionNotMet.
  13325. Fingerprint string `json:"fingerprint,omitempty"`
  13326. // Kind: [Output Only] Type of the resource. Always
  13327. // compute#networkInterface for network interfaces.
  13328. Kind string `json:"kind,omitempty"`
  13329. // Name: [Output Only] The name of the network interface, generated by
  13330. // the server. For network devices, these are eth0, eth1, etc.
  13331. Name string `json:"name,omitempty"`
  13332. // Network: URL of the network resource for this instance. When creating
  13333. // an instance, if neither the network nor the subnetwork is specified,
  13334. // the default network global/networks/default is used; if the network
  13335. // is not specified but the subnetwork is specified, the network is
  13336. // inferred.
  13337. //
  13338. // This field is optional when creating a firewall rule. If not
  13339. // specified when creating a firewall rule, the default network
  13340. // global/networks/default is used.
  13341. //
  13342. // If you specify this property, you can specify the network as a full
  13343. // or partial URL. For example, the following are all valid URLs:
  13344. // -
  13345. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  13346. // - projects/project/global/networks/network
  13347. // - global/networks/default
  13348. Network string `json:"network,omitempty"`
  13349. // NetworkIP: An IPv4 internal network address to assign to the instance
  13350. // for this network interface. If not specified by the user, an unused
  13351. // internal IP is assigned by the system.
  13352. NetworkIP string `json:"networkIP,omitempty"`
  13353. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  13354. // the network resource is in legacy mode, do not provide this property.
  13355. // If the network is in auto subnet mode, providing the subnetwork is
  13356. // optional. If the network is in custom subnet mode, then this field
  13357. // should be specified. If you specify this property, you can specify
  13358. // the subnetwork as a full or partial URL. For example, the following
  13359. // are all valid URLs:
  13360. // -
  13361. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  13362. // - regions/region/subnetworks/subnetwork
  13363. Subnetwork string `json:"subnetwork,omitempty"`
  13364. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  13365. // unconditionally include in API requests. By default, fields with
  13366. // empty values are omitted from API requests. However, any non-pointer,
  13367. // non-interface field appearing in ForceSendFields will be sent to the
  13368. // server regardless of whether the field is empty or not. This may be
  13369. // used to include empty fields in Patch requests.
  13370. ForceSendFields []string `json:"-"`
  13371. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  13372. // in API requests with the JSON null value. By default, fields with
  13373. // empty values are omitted from API requests. However, any field with
  13374. // an empty value appearing in NullFields will be sent to the server as
  13375. // null. It is an error if a field in this list has a non-empty value.
  13376. // This may be used to include null fields in Patch requests.
  13377. NullFields []string `json:"-"`
  13378. }
  13379. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  13380. type NoMethod NetworkInterface
  13381. raw := NoMethod(*s)
  13382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13383. }
  13384. // NetworkList: Contains a list of networks.
  13385. type NetworkList struct {
  13386. // Id: [Output Only] Unique identifier for the resource; defined by the
  13387. // server.
  13388. Id string `json:"id,omitempty"`
  13389. // Items: A list of Network resources.
  13390. Items []*Network `json:"items,omitempty"`
  13391. // Kind: [Output Only] Type of resource. Always compute#networkList for
  13392. // lists of networks.
  13393. Kind string `json:"kind,omitempty"`
  13394. // NextPageToken: [Output Only] This token allows you to get the next
  13395. // page of results for list requests. If the number of results is larger
  13396. // than maxResults, use the nextPageToken as a value for the query
  13397. // parameter pageToken in the next list request. Subsequent list
  13398. // requests will have their own nextPageToken to continue paging through
  13399. // the results.
  13400. NextPageToken string `json:"nextPageToken,omitempty"`
  13401. // SelfLink: [Output Only] Server-defined URL for this resource.
  13402. SelfLink string `json:"selfLink,omitempty"`
  13403. // Warning: [Output Only] Informational warning message.
  13404. Warning *NetworkListWarning `json:"warning,omitempty"`
  13405. // ServerResponse contains the HTTP response code and headers from the
  13406. // server.
  13407. googleapi.ServerResponse `json:"-"`
  13408. // ForceSendFields is a list of field names (e.g. "Id") to
  13409. // unconditionally include in API requests. By default, fields with
  13410. // empty values are omitted from API requests. However, any non-pointer,
  13411. // non-interface field appearing in ForceSendFields will be sent to the
  13412. // server regardless of whether the field is empty or not. This may be
  13413. // used to include empty fields in Patch requests.
  13414. ForceSendFields []string `json:"-"`
  13415. // NullFields is a list of field names (e.g. "Id") to include in API
  13416. // requests with the JSON null value. By default, fields with empty
  13417. // values are omitted from API requests. However, any field with an
  13418. // empty value appearing in NullFields will be sent to the server as
  13419. // null. It is an error if a field in this list has a non-empty value.
  13420. // This may be used to include null fields in Patch requests.
  13421. NullFields []string `json:"-"`
  13422. }
  13423. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  13424. type NoMethod NetworkList
  13425. raw := NoMethod(*s)
  13426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13427. }
  13428. // NetworkListWarning: [Output Only] Informational warning message.
  13429. type NetworkListWarning struct {
  13430. // Code: [Output Only] A warning code, if applicable. For example,
  13431. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13432. // the response.
  13433. //
  13434. // Possible values:
  13435. // "CLEANUP_FAILED"
  13436. // "DEPRECATED_RESOURCE_USED"
  13437. // "DEPRECATED_TYPE_USED"
  13438. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13439. // "EXPERIMENTAL_TYPE_USED"
  13440. // "EXTERNAL_API_WARNING"
  13441. // "FIELD_VALUE_OVERRIDEN"
  13442. // "INJECTED_KERNELS_DEPRECATED"
  13443. // "MISSING_TYPE_DEPENDENCY"
  13444. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13445. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13446. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13447. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13448. // "NEXT_HOP_NOT_RUNNING"
  13449. // "NOT_CRITICAL_ERROR"
  13450. // "NO_RESULTS_ON_PAGE"
  13451. // "REQUIRED_TOS_AGREEMENT"
  13452. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13453. // "RESOURCE_NOT_DELETED"
  13454. // "SCHEMA_VALIDATION_IGNORED"
  13455. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13456. // "UNDECLARED_PROPERTIES"
  13457. // "UNREACHABLE"
  13458. Code string `json:"code,omitempty"`
  13459. // Data: [Output Only] Metadata about this warning in key: value format.
  13460. // For example:
  13461. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13462. Data []*NetworkListWarningData `json:"data,omitempty"`
  13463. // Message: [Output Only] A human-readable description of the warning
  13464. // code.
  13465. Message string `json:"message,omitempty"`
  13466. // ForceSendFields is a list of field names (e.g. "Code") to
  13467. // unconditionally include in API requests. By default, fields with
  13468. // empty values are omitted from API requests. However, any non-pointer,
  13469. // non-interface field appearing in ForceSendFields will be sent to the
  13470. // server regardless of whether the field is empty or not. This may be
  13471. // used to include empty fields in Patch requests.
  13472. ForceSendFields []string `json:"-"`
  13473. // NullFields is a list of field names (e.g. "Code") to include in API
  13474. // requests with the JSON null value. By default, fields with empty
  13475. // values are omitted from API requests. However, any field with an
  13476. // empty value appearing in NullFields will be sent to the server as
  13477. // null. It is an error if a field in this list has a non-empty value.
  13478. // This may be used to include null fields in Patch requests.
  13479. NullFields []string `json:"-"`
  13480. }
  13481. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  13482. type NoMethod NetworkListWarning
  13483. raw := NoMethod(*s)
  13484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13485. }
  13486. type NetworkListWarningData struct {
  13487. // Key: [Output Only] A key that provides more detail on the warning
  13488. // being returned. For example, for warnings where there are no results
  13489. // in a list request for a particular zone, this key might be scope and
  13490. // the key value might be the zone name. Other examples might be a key
  13491. // indicating a deprecated resource and a suggested replacement, or a
  13492. // warning about invalid network settings (for example, if an instance
  13493. // attempts to perform IP forwarding but is not enabled for IP
  13494. // forwarding).
  13495. Key string `json:"key,omitempty"`
  13496. // Value: [Output Only] A warning data value corresponding to the key.
  13497. Value string `json:"value,omitempty"`
  13498. // ForceSendFields is a list of field names (e.g. "Key") to
  13499. // unconditionally include in API requests. By default, fields with
  13500. // empty values are omitted from API requests. However, any non-pointer,
  13501. // non-interface field appearing in ForceSendFields will be sent to the
  13502. // server regardless of whether the field is empty or not. This may be
  13503. // used to include empty fields in Patch requests.
  13504. ForceSendFields []string `json:"-"`
  13505. // NullFields is a list of field names (e.g. "Key") to include in API
  13506. // requests with the JSON null value. By default, fields with empty
  13507. // values are omitted from API requests. However, any field with an
  13508. // empty value appearing in NullFields will be sent to the server as
  13509. // null. It is an error if a field in this list has a non-empty value.
  13510. // This may be used to include null fields in Patch requests.
  13511. NullFields []string `json:"-"`
  13512. }
  13513. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  13514. type NoMethod NetworkListWarningData
  13515. raw := NoMethod(*s)
  13516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13517. }
  13518. // NetworkPeering: A network peering attached to a network resource. The
  13519. // message includes the peering name, peer network, peering state, and a
  13520. // flag indicating whether Google Compute Engine should automatically
  13521. // create routes for the peering.
  13522. type NetworkPeering struct {
  13523. // AutoCreateRoutes: Indicates whether full mesh connectivity is created
  13524. // and managed automatically. When it is set to true, Google Compute
  13525. // Engine will automatically create and manage the routes between two
  13526. // networks when the state is ACTIVE. Otherwise, user needs to create
  13527. // routes manually to route packets to peer network.
  13528. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  13529. // Name: Name of this peering. Provided by the client when the peering
  13530. // is created. The name must comply with RFC1035. Specifically, the name
  13531. // must be 1-63 characters long and match regular expression
  13532. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  13533. // a lowercase letter, and all the following characters must be a dash,
  13534. // lowercase letter, or digit, except the last character, which cannot
  13535. // be a dash.
  13536. Name string `json:"name,omitempty"`
  13537. // Network: The URL of the peer network. It can be either full URL or
  13538. // partial URL. The peer network may belong to a different project. If
  13539. // the partial URL does not contain project, it is assumed that the peer
  13540. // network is in the same project as the current network.
  13541. Network string `json:"network,omitempty"`
  13542. // State: [Output Only] State for the peering.
  13543. //
  13544. // Possible values:
  13545. // "ACTIVE"
  13546. // "INACTIVE"
  13547. State string `json:"state,omitempty"`
  13548. // StateDetails: [Output Only] Details about the current state of the
  13549. // peering.
  13550. StateDetails string `json:"stateDetails,omitempty"`
  13551. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  13552. // unconditionally include in API requests. By default, fields with
  13553. // empty values are omitted from API requests. However, any non-pointer,
  13554. // non-interface field appearing in ForceSendFields will be sent to the
  13555. // server regardless of whether the field is empty or not. This may be
  13556. // used to include empty fields in Patch requests.
  13557. ForceSendFields []string `json:"-"`
  13558. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  13559. // include in API requests with the JSON null value. By default, fields
  13560. // with empty values are omitted from API requests. However, any field
  13561. // with an empty value appearing in NullFields will be sent to the
  13562. // server as null. It is an error if a field in this list has a
  13563. // non-empty value. This may be used to include null fields in Patch
  13564. // requests.
  13565. NullFields []string `json:"-"`
  13566. }
  13567. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  13568. type NoMethod NetworkPeering
  13569. raw := NoMethod(*s)
  13570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13571. }
  13572. // NetworkRoutingConfig: A routing configuration attached to a network
  13573. // resource. The message includes the list of routers associated with
  13574. // the network, and a flag indicating the type of routing behavior to
  13575. // enforce network-wide.
  13576. type NetworkRoutingConfig struct {
  13577. // RoutingMode: The network-wide routing mode to use. If set to
  13578. // REGIONAL, this network's cloud routers will only advertise routes
  13579. // with subnets of this network in the same region as the router. If set
  13580. // to GLOBAL, this network's cloud routers will advertise routes with
  13581. // all subnets of this network, across regions.
  13582. //
  13583. // Possible values:
  13584. // "GLOBAL"
  13585. // "REGIONAL"
  13586. RoutingMode string `json:"routingMode,omitempty"`
  13587. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  13588. // unconditionally include in API requests. By default, fields with
  13589. // empty values are omitted from API requests. However, any non-pointer,
  13590. // non-interface field appearing in ForceSendFields will be sent to the
  13591. // server regardless of whether the field is empty or not. This may be
  13592. // used to include empty fields in Patch requests.
  13593. ForceSendFields []string `json:"-"`
  13594. // NullFields is a list of field names (e.g. "RoutingMode") to include
  13595. // in API requests with the JSON null value. By default, fields with
  13596. // empty values are omitted from API requests. However, any field with
  13597. // an empty value appearing in NullFields will be sent to the server as
  13598. // null. It is an error if a field in this list has a non-empty value.
  13599. // This may be used to include null fields in Patch requests.
  13600. NullFields []string `json:"-"`
  13601. }
  13602. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  13603. type NoMethod NetworkRoutingConfig
  13604. raw := NoMethod(*s)
  13605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13606. }
  13607. type NetworksAddPeeringRequest struct {
  13608. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  13609. // automatically.
  13610. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  13611. // Name: Name of the peering, which should conform to RFC1035.
  13612. Name string `json:"name,omitempty"`
  13613. // PeerNetwork: URL of the peer network. It can be either full URL or
  13614. // partial URL. The peer network may belong to a different project. If
  13615. // the partial URL does not contain project, it is assumed that the peer
  13616. // network is in the same project as the current network.
  13617. PeerNetwork string `json:"peerNetwork,omitempty"`
  13618. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  13619. // unconditionally include in API requests. By default, fields with
  13620. // empty values are omitted from API requests. However, any non-pointer,
  13621. // non-interface field appearing in ForceSendFields will be sent to the
  13622. // server regardless of whether the field is empty or not. This may be
  13623. // used to include empty fields in Patch requests.
  13624. ForceSendFields []string `json:"-"`
  13625. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  13626. // include in API requests with the JSON null value. By default, fields
  13627. // with empty values are omitted from API requests. However, any field
  13628. // with an empty value appearing in NullFields will be sent to the
  13629. // server as null. It is an error if a field in this list has a
  13630. // non-empty value. This may be used to include null fields in Patch
  13631. // requests.
  13632. NullFields []string `json:"-"`
  13633. }
  13634. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  13635. type NoMethod NetworksAddPeeringRequest
  13636. raw := NoMethod(*s)
  13637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13638. }
  13639. type NetworksRemovePeeringRequest struct {
  13640. // Name: Name of the peering, which should conform to RFC1035.
  13641. Name string `json:"name,omitempty"`
  13642. // ForceSendFields is a list of field names (e.g. "Name") to
  13643. // unconditionally include in API requests. By default, fields with
  13644. // empty values are omitted from API requests. However, any non-pointer,
  13645. // non-interface field appearing in ForceSendFields will be sent to the
  13646. // server regardless of whether the field is empty or not. This may be
  13647. // used to include empty fields in Patch requests.
  13648. ForceSendFields []string `json:"-"`
  13649. // NullFields is a list of field names (e.g. "Name") to include in API
  13650. // requests with the JSON null value. By default, fields with empty
  13651. // values are omitted from API requests. However, any field with an
  13652. // empty value appearing in NullFields will be sent to the server as
  13653. // null. It is an error if a field in this list has a non-empty value.
  13654. // This may be used to include null fields in Patch requests.
  13655. NullFields []string `json:"-"`
  13656. }
  13657. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  13658. type NoMethod NetworksRemovePeeringRequest
  13659. raw := NoMethod(*s)
  13660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13661. }
  13662. // NodeGroup: A NodeGroup resource.
  13663. type NodeGroup struct {
  13664. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13665. // format.
  13666. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13667. // Description: An optional description of this resource. Provide this
  13668. // property when you create the resource.
  13669. Description string `json:"description,omitempty"`
  13670. // Id: [Output Only] The unique identifier for the resource. This
  13671. // identifier is defined by the server.
  13672. Id uint64 `json:"id,omitempty,string"`
  13673. // Kind: [Output Only] The type of the resource. Always
  13674. // compute#nodeGroup for node group.
  13675. Kind string `json:"kind,omitempty"`
  13676. // Name: The name of the resource, provided by the client when initially
  13677. // creating the resource. The resource name must be 1-63 characters
  13678. // long, and comply with RFC1035. Specifically, the name must be 1-63
  13679. // characters long and match the regular expression
  13680. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  13681. // a lowercase letter, and all following characters must be a dash,
  13682. // lowercase letter, or digit, except the last character, which cannot
  13683. // be a dash.
  13684. Name string `json:"name,omitempty"`
  13685. // NodeTemplate: The URL of the node template to which this node group
  13686. // belongs.
  13687. NodeTemplate string `json:"nodeTemplate,omitempty"`
  13688. // SelfLink: [Output Only] Server-defined URL for the resource.
  13689. SelfLink string `json:"selfLink,omitempty"`
  13690. // Size: [Output Only] The total number of nodes in the node group.
  13691. Size int64 `json:"size,omitempty"`
  13692. // Possible values:
  13693. // "CREATING"
  13694. // "DELETING"
  13695. // "INVALID"
  13696. // "READY"
  13697. Status string `json:"status,omitempty"`
  13698. // Zone: [Output Only] The name of the zone where the node group
  13699. // resides, such as us-central1-a.
  13700. Zone string `json:"zone,omitempty"`
  13701. // ServerResponse contains the HTTP response code and headers from the
  13702. // server.
  13703. googleapi.ServerResponse `json:"-"`
  13704. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  13705. // to unconditionally include in API requests. By default, fields with
  13706. // empty values are omitted from API requests. However, any non-pointer,
  13707. // non-interface field appearing in ForceSendFields will be sent to the
  13708. // server regardless of whether the field is empty or not. This may be
  13709. // used to include empty fields in Patch requests.
  13710. ForceSendFields []string `json:"-"`
  13711. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  13712. // include in API requests with the JSON null value. By default, fields
  13713. // with empty values are omitted from API requests. However, any field
  13714. // with an empty value appearing in NullFields will be sent to the
  13715. // server as null. It is an error if a field in this list has a
  13716. // non-empty value. This may be used to include null fields in Patch
  13717. // requests.
  13718. NullFields []string `json:"-"`
  13719. }
  13720. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  13721. type NoMethod NodeGroup
  13722. raw := NoMethod(*s)
  13723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13724. }
  13725. type NodeGroupAggregatedList struct {
  13726. // Id: [Output Only] Unique identifier for the resource; defined by the
  13727. // server.
  13728. Id string `json:"id,omitempty"`
  13729. // Items: A list of NodeGroupsScopedList resources.
  13730. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  13731. // Kind: [Output Only] Type of resource.Always
  13732. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  13733. Kind string `json:"kind,omitempty"`
  13734. // NextPageToken: [Output Only] This token allows you to get the next
  13735. // page of results for list requests. If the number of results is larger
  13736. // than maxResults, use the nextPageToken as a value for the query
  13737. // parameter pageToken in the next list request. Subsequent list
  13738. // requests will have their own nextPageToken to continue paging through
  13739. // the results.
  13740. NextPageToken string `json:"nextPageToken,omitempty"`
  13741. // SelfLink: [Output Only] Server-defined URL for this resource.
  13742. SelfLink string `json:"selfLink,omitempty"`
  13743. // Warning: [Output Only] Informational warning message.
  13744. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  13745. // ServerResponse contains the HTTP response code and headers from the
  13746. // server.
  13747. googleapi.ServerResponse `json:"-"`
  13748. // ForceSendFields is a list of field names (e.g. "Id") to
  13749. // unconditionally include in API requests. By default, fields with
  13750. // empty values are omitted from API requests. However, any non-pointer,
  13751. // non-interface field appearing in ForceSendFields will be sent to the
  13752. // server regardless of whether the field is empty or not. This may be
  13753. // used to include empty fields in Patch requests.
  13754. ForceSendFields []string `json:"-"`
  13755. // NullFields is a list of field names (e.g. "Id") to include in API
  13756. // requests with the JSON null value. By default, fields with empty
  13757. // values are omitted from API requests. However, any field with an
  13758. // empty value appearing in NullFields will be sent to the server as
  13759. // null. It is an error if a field in this list has a non-empty value.
  13760. // This may be used to include null fields in Patch requests.
  13761. NullFields []string `json:"-"`
  13762. }
  13763. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  13764. type NoMethod NodeGroupAggregatedList
  13765. raw := NoMethod(*s)
  13766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13767. }
  13768. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  13769. // message.
  13770. type NodeGroupAggregatedListWarning struct {
  13771. // Code: [Output Only] A warning code, if applicable. For example,
  13772. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13773. // the response.
  13774. //
  13775. // Possible values:
  13776. // "CLEANUP_FAILED"
  13777. // "DEPRECATED_RESOURCE_USED"
  13778. // "DEPRECATED_TYPE_USED"
  13779. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13780. // "EXPERIMENTAL_TYPE_USED"
  13781. // "EXTERNAL_API_WARNING"
  13782. // "FIELD_VALUE_OVERRIDEN"
  13783. // "INJECTED_KERNELS_DEPRECATED"
  13784. // "MISSING_TYPE_DEPENDENCY"
  13785. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13786. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13787. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13788. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13789. // "NEXT_HOP_NOT_RUNNING"
  13790. // "NOT_CRITICAL_ERROR"
  13791. // "NO_RESULTS_ON_PAGE"
  13792. // "REQUIRED_TOS_AGREEMENT"
  13793. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13794. // "RESOURCE_NOT_DELETED"
  13795. // "SCHEMA_VALIDATION_IGNORED"
  13796. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13797. // "UNDECLARED_PROPERTIES"
  13798. // "UNREACHABLE"
  13799. Code string `json:"code,omitempty"`
  13800. // Data: [Output Only] Metadata about this warning in key: value format.
  13801. // For example:
  13802. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13803. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  13804. // Message: [Output Only] A human-readable description of the warning
  13805. // code.
  13806. Message string `json:"message,omitempty"`
  13807. // ForceSendFields is a list of field names (e.g. "Code") to
  13808. // unconditionally include in API requests. By default, fields with
  13809. // empty values are omitted from API requests. However, any non-pointer,
  13810. // non-interface field appearing in ForceSendFields will be sent to the
  13811. // server regardless of whether the field is empty or not. This may be
  13812. // used to include empty fields in Patch requests.
  13813. ForceSendFields []string `json:"-"`
  13814. // NullFields is a list of field names (e.g. "Code") to include in API
  13815. // requests with the JSON null value. By default, fields with empty
  13816. // values are omitted from API requests. However, any field with an
  13817. // empty value appearing in NullFields will be sent to the server as
  13818. // null. It is an error if a field in this list has a non-empty value.
  13819. // This may be used to include null fields in Patch requests.
  13820. NullFields []string `json:"-"`
  13821. }
  13822. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13823. type NoMethod NodeGroupAggregatedListWarning
  13824. raw := NoMethod(*s)
  13825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13826. }
  13827. type NodeGroupAggregatedListWarningData struct {
  13828. // Key: [Output Only] A key that provides more detail on the warning
  13829. // being returned. For example, for warnings where there are no results
  13830. // in a list request for a particular zone, this key might be scope and
  13831. // the key value might be the zone name. Other examples might be a key
  13832. // indicating a deprecated resource and a suggested replacement, or a
  13833. // warning about invalid network settings (for example, if an instance
  13834. // attempts to perform IP forwarding but is not enabled for IP
  13835. // forwarding).
  13836. Key string `json:"key,omitempty"`
  13837. // Value: [Output Only] A warning data value corresponding to the key.
  13838. Value string `json:"value,omitempty"`
  13839. // ForceSendFields is a list of field names (e.g. "Key") to
  13840. // unconditionally include in API requests. By default, fields with
  13841. // empty values are omitted from API requests. However, any non-pointer,
  13842. // non-interface field appearing in ForceSendFields will be sent to the
  13843. // server regardless of whether the field is empty or not. This may be
  13844. // used to include empty fields in Patch requests.
  13845. ForceSendFields []string `json:"-"`
  13846. // NullFields is a list of field names (e.g. "Key") to include in API
  13847. // requests with the JSON null value. By default, fields with empty
  13848. // values are omitted from API requests. However, any field with an
  13849. // empty value appearing in NullFields will be sent to the server as
  13850. // null. It is an error if a field in this list has a non-empty value.
  13851. // This may be used to include null fields in Patch requests.
  13852. NullFields []string `json:"-"`
  13853. }
  13854. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13855. type NoMethod NodeGroupAggregatedListWarningData
  13856. raw := NoMethod(*s)
  13857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13858. }
  13859. // NodeGroupList: Contains a list of nodeGroups.
  13860. type NodeGroupList struct {
  13861. // Id: [Output Only] Unique identifier for the resource; defined by the
  13862. // server.
  13863. Id string `json:"id,omitempty"`
  13864. // Items: A list of NodeGroup resources.
  13865. Items []*NodeGroup `json:"items,omitempty"`
  13866. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  13867. // lists of node groups.
  13868. Kind string `json:"kind,omitempty"`
  13869. // NextPageToken: [Output Only] This token allows you to get the next
  13870. // page of results for list requests. If the number of results is larger
  13871. // than maxResults, use the nextPageToken as a value for the query
  13872. // parameter pageToken in the next list request. Subsequent list
  13873. // requests will have their own nextPageToken to continue paging through
  13874. // the results.
  13875. NextPageToken string `json:"nextPageToken,omitempty"`
  13876. // SelfLink: [Output Only] Server-defined URL for this resource.
  13877. SelfLink string `json:"selfLink,omitempty"`
  13878. // Warning: [Output Only] Informational warning message.
  13879. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  13880. // ServerResponse contains the HTTP response code and headers from the
  13881. // server.
  13882. googleapi.ServerResponse `json:"-"`
  13883. // ForceSendFields is a list of field names (e.g. "Id") to
  13884. // unconditionally include in API requests. By default, fields with
  13885. // empty values are omitted from API requests. However, any non-pointer,
  13886. // non-interface field appearing in ForceSendFields will be sent to the
  13887. // server regardless of whether the field is empty or not. This may be
  13888. // used to include empty fields in Patch requests.
  13889. ForceSendFields []string `json:"-"`
  13890. // NullFields is a list of field names (e.g. "Id") to include in API
  13891. // requests with the JSON null value. By default, fields with empty
  13892. // values are omitted from API requests. However, any field with an
  13893. // empty value appearing in NullFields will be sent to the server as
  13894. // null. It is an error if a field in this list has a non-empty value.
  13895. // This may be used to include null fields in Patch requests.
  13896. NullFields []string `json:"-"`
  13897. }
  13898. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  13899. type NoMethod NodeGroupList
  13900. raw := NoMethod(*s)
  13901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13902. }
  13903. // NodeGroupListWarning: [Output Only] Informational warning message.
  13904. type NodeGroupListWarning struct {
  13905. // Code: [Output Only] A warning code, if applicable. For example,
  13906. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13907. // the response.
  13908. //
  13909. // Possible values:
  13910. // "CLEANUP_FAILED"
  13911. // "DEPRECATED_RESOURCE_USED"
  13912. // "DEPRECATED_TYPE_USED"
  13913. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13914. // "EXPERIMENTAL_TYPE_USED"
  13915. // "EXTERNAL_API_WARNING"
  13916. // "FIELD_VALUE_OVERRIDEN"
  13917. // "INJECTED_KERNELS_DEPRECATED"
  13918. // "MISSING_TYPE_DEPENDENCY"
  13919. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13920. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13921. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13922. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13923. // "NEXT_HOP_NOT_RUNNING"
  13924. // "NOT_CRITICAL_ERROR"
  13925. // "NO_RESULTS_ON_PAGE"
  13926. // "REQUIRED_TOS_AGREEMENT"
  13927. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13928. // "RESOURCE_NOT_DELETED"
  13929. // "SCHEMA_VALIDATION_IGNORED"
  13930. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13931. // "UNDECLARED_PROPERTIES"
  13932. // "UNREACHABLE"
  13933. Code string `json:"code,omitempty"`
  13934. // Data: [Output Only] Metadata about this warning in key: value format.
  13935. // For example:
  13936. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13937. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  13938. // Message: [Output Only] A human-readable description of the warning
  13939. // code.
  13940. Message string `json:"message,omitempty"`
  13941. // ForceSendFields is a list of field names (e.g. "Code") to
  13942. // unconditionally include in API requests. By default, fields with
  13943. // empty values are omitted from API requests. However, any non-pointer,
  13944. // non-interface field appearing in ForceSendFields will be sent to the
  13945. // server regardless of whether the field is empty or not. This may be
  13946. // used to include empty fields in Patch requests.
  13947. ForceSendFields []string `json:"-"`
  13948. // NullFields is a list of field names (e.g. "Code") to include in API
  13949. // requests with the JSON null value. By default, fields with empty
  13950. // values are omitted from API requests. However, any field with an
  13951. // empty value appearing in NullFields will be sent to the server as
  13952. // null. It is an error if a field in this list has a non-empty value.
  13953. // This may be used to include null fields in Patch requests.
  13954. NullFields []string `json:"-"`
  13955. }
  13956. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  13957. type NoMethod NodeGroupListWarning
  13958. raw := NoMethod(*s)
  13959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13960. }
  13961. type NodeGroupListWarningData struct {
  13962. // Key: [Output Only] A key that provides more detail on the warning
  13963. // being returned. For example, for warnings where there are no results
  13964. // in a list request for a particular zone, this key might be scope and
  13965. // the key value might be the zone name. Other examples might be a key
  13966. // indicating a deprecated resource and a suggested replacement, or a
  13967. // warning about invalid network settings (for example, if an instance
  13968. // attempts to perform IP forwarding but is not enabled for IP
  13969. // forwarding).
  13970. Key string `json:"key,omitempty"`
  13971. // Value: [Output Only] A warning data value corresponding to the key.
  13972. Value string `json:"value,omitempty"`
  13973. // ForceSendFields is a list of field names (e.g. "Key") to
  13974. // unconditionally include in API requests. By default, fields with
  13975. // empty values are omitted from API requests. However, any non-pointer,
  13976. // non-interface field appearing in ForceSendFields will be sent to the
  13977. // server regardless of whether the field is empty or not. This may be
  13978. // used to include empty fields in Patch requests.
  13979. ForceSendFields []string `json:"-"`
  13980. // NullFields is a list of field names (e.g. "Key") to include in API
  13981. // requests with the JSON null value. By default, fields with empty
  13982. // values are omitted from API requests. However, any field with an
  13983. // empty value appearing in NullFields will be sent to the server as
  13984. // null. It is an error if a field in this list has a non-empty value.
  13985. // This may be used to include null fields in Patch requests.
  13986. NullFields []string `json:"-"`
  13987. }
  13988. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  13989. type NoMethod NodeGroupListWarningData
  13990. raw := NoMethod(*s)
  13991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13992. }
  13993. type NodeGroupNode struct {
  13994. // Instances: Instances scheduled on this node.
  13995. Instances []string `json:"instances,omitempty"`
  13996. // Name: The name of the node.
  13997. Name string `json:"name,omitempty"`
  13998. // NodeType: The type of this node.
  13999. NodeType string `json:"nodeType,omitempty"`
  14000. // Possible values:
  14001. // "CREATING"
  14002. // "DELETING"
  14003. // "INVALID"
  14004. // "READY"
  14005. // "REPAIRING"
  14006. Status string `json:"status,omitempty"`
  14007. // ForceSendFields is a list of field names (e.g. "Instances") to
  14008. // unconditionally include in API requests. By default, fields with
  14009. // empty values are omitted from API requests. However, any non-pointer,
  14010. // non-interface field appearing in ForceSendFields will be sent to the
  14011. // server regardless of whether the field is empty or not. This may be
  14012. // used to include empty fields in Patch requests.
  14013. ForceSendFields []string `json:"-"`
  14014. // NullFields is a list of field names (e.g. "Instances") to include in
  14015. // API requests with the JSON null value. By default, fields with empty
  14016. // values are omitted from API requests. However, any field with an
  14017. // empty value appearing in NullFields will be sent to the server as
  14018. // null. It is an error if a field in this list has a non-empty value.
  14019. // This may be used to include null fields in Patch requests.
  14020. NullFields []string `json:"-"`
  14021. }
  14022. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  14023. type NoMethod NodeGroupNode
  14024. raw := NoMethod(*s)
  14025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14026. }
  14027. type NodeGroupsAddNodesRequest struct {
  14028. // AdditionalNodeCount: Count of additional nodes to be added to the
  14029. // node group.
  14030. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  14031. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  14032. // to unconditionally include in API requests. By default, fields with
  14033. // empty values are omitted from API requests. However, any non-pointer,
  14034. // non-interface field appearing in ForceSendFields will be sent to the
  14035. // server regardless of whether the field is empty or not. This may be
  14036. // used to include empty fields in Patch requests.
  14037. ForceSendFields []string `json:"-"`
  14038. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  14039. // include in API requests with the JSON null value. By default, fields
  14040. // with empty values are omitted from API requests. However, any field
  14041. // with an empty value appearing in NullFields will be sent to the
  14042. // server as null. It is an error if a field in this list has a
  14043. // non-empty value. This may be used to include null fields in Patch
  14044. // requests.
  14045. NullFields []string `json:"-"`
  14046. }
  14047. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  14048. type NoMethod NodeGroupsAddNodesRequest
  14049. raw := NoMethod(*s)
  14050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14051. }
  14052. type NodeGroupsDeleteNodesRequest struct {
  14053. Nodes []string `json:"nodes,omitempty"`
  14054. // ForceSendFields is a list of field names (e.g. "Nodes") to
  14055. // unconditionally include in API requests. By default, fields with
  14056. // empty values are omitted from API requests. However, any non-pointer,
  14057. // non-interface field appearing in ForceSendFields will be sent to the
  14058. // server regardless of whether the field is empty or not. This may be
  14059. // used to include empty fields in Patch requests.
  14060. ForceSendFields []string `json:"-"`
  14061. // NullFields is a list of field names (e.g. "Nodes") to include in API
  14062. // requests with the JSON null value. By default, fields with empty
  14063. // values are omitted from API requests. However, any field with an
  14064. // empty value appearing in NullFields will be sent to the server as
  14065. // null. It is an error if a field in this list has a non-empty value.
  14066. // This may be used to include null fields in Patch requests.
  14067. NullFields []string `json:"-"`
  14068. }
  14069. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  14070. type NoMethod NodeGroupsDeleteNodesRequest
  14071. raw := NoMethod(*s)
  14072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14073. }
  14074. type NodeGroupsListNodes struct {
  14075. // Id: [Output Only] Unique identifier for the resource; defined by the
  14076. // server.
  14077. Id string `json:"id,omitempty"`
  14078. // Items: A list of Node resources.
  14079. Items []*NodeGroupNode `json:"items,omitempty"`
  14080. // Kind: [Output Only] The resource type, which is always
  14081. // compute.nodeGroupsListNodes for the list of nodes in the specified
  14082. // node group.
  14083. Kind string `json:"kind,omitempty"`
  14084. // NextPageToken: [Output Only] This token allows you to get the next
  14085. // page of results for list requests. If the number of results is larger
  14086. // than maxResults, use the nextPageToken as a value for the query
  14087. // parameter pageToken in the next list request. Subsequent list
  14088. // requests will have their own nextPageToken to continue paging through
  14089. // the results.
  14090. NextPageToken string `json:"nextPageToken,omitempty"`
  14091. // SelfLink: [Output Only] Server-defined URL for this resource.
  14092. SelfLink string `json:"selfLink,omitempty"`
  14093. // Warning: [Output Only] Informational warning message.
  14094. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  14095. // ServerResponse contains the HTTP response code and headers from the
  14096. // server.
  14097. googleapi.ServerResponse `json:"-"`
  14098. // ForceSendFields is a list of field names (e.g. "Id") to
  14099. // unconditionally include in API requests. By default, fields with
  14100. // empty values are omitted from API requests. However, any non-pointer,
  14101. // non-interface field appearing in ForceSendFields will be sent to the
  14102. // server regardless of whether the field is empty or not. This may be
  14103. // used to include empty fields in Patch requests.
  14104. ForceSendFields []string `json:"-"`
  14105. // NullFields is a list of field names (e.g. "Id") to include in API
  14106. // requests with the JSON null value. By default, fields with empty
  14107. // values are omitted from API requests. However, any field with an
  14108. // empty value appearing in NullFields will be sent to the server as
  14109. // null. It is an error if a field in this list has a non-empty value.
  14110. // This may be used to include null fields in Patch requests.
  14111. NullFields []string `json:"-"`
  14112. }
  14113. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  14114. type NoMethod NodeGroupsListNodes
  14115. raw := NoMethod(*s)
  14116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14117. }
  14118. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  14119. // message.
  14120. type NodeGroupsListNodesWarning struct {
  14121. // Code: [Output Only] A warning code, if applicable. For example,
  14122. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14123. // the response.
  14124. //
  14125. // Possible values:
  14126. // "CLEANUP_FAILED"
  14127. // "DEPRECATED_RESOURCE_USED"
  14128. // "DEPRECATED_TYPE_USED"
  14129. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14130. // "EXPERIMENTAL_TYPE_USED"
  14131. // "EXTERNAL_API_WARNING"
  14132. // "FIELD_VALUE_OVERRIDEN"
  14133. // "INJECTED_KERNELS_DEPRECATED"
  14134. // "MISSING_TYPE_DEPENDENCY"
  14135. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14136. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14137. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14138. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14139. // "NEXT_HOP_NOT_RUNNING"
  14140. // "NOT_CRITICAL_ERROR"
  14141. // "NO_RESULTS_ON_PAGE"
  14142. // "REQUIRED_TOS_AGREEMENT"
  14143. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14144. // "RESOURCE_NOT_DELETED"
  14145. // "SCHEMA_VALIDATION_IGNORED"
  14146. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14147. // "UNDECLARED_PROPERTIES"
  14148. // "UNREACHABLE"
  14149. Code string `json:"code,omitempty"`
  14150. // Data: [Output Only] Metadata about this warning in key: value format.
  14151. // For example:
  14152. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14153. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  14154. // Message: [Output Only] A human-readable description of the warning
  14155. // code.
  14156. Message string `json:"message,omitempty"`
  14157. // ForceSendFields is a list of field names (e.g. "Code") to
  14158. // unconditionally include in API requests. By default, fields with
  14159. // empty values are omitted from API requests. However, any non-pointer,
  14160. // non-interface field appearing in ForceSendFields will be sent to the
  14161. // server regardless of whether the field is empty or not. This may be
  14162. // used to include empty fields in Patch requests.
  14163. ForceSendFields []string `json:"-"`
  14164. // NullFields is a list of field names (e.g. "Code") to include in API
  14165. // requests with the JSON null value. By default, fields with empty
  14166. // values are omitted from API requests. However, any field with an
  14167. // empty value appearing in NullFields will be sent to the server as
  14168. // null. It is an error if a field in this list has a non-empty value.
  14169. // This may be used to include null fields in Patch requests.
  14170. NullFields []string `json:"-"`
  14171. }
  14172. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  14173. type NoMethod NodeGroupsListNodesWarning
  14174. raw := NoMethod(*s)
  14175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14176. }
  14177. type NodeGroupsListNodesWarningData struct {
  14178. // Key: [Output Only] A key that provides more detail on the warning
  14179. // being returned. For example, for warnings where there are no results
  14180. // in a list request for a particular zone, this key might be scope and
  14181. // the key value might be the zone name. Other examples might be a key
  14182. // indicating a deprecated resource and a suggested replacement, or a
  14183. // warning about invalid network settings (for example, if an instance
  14184. // attempts to perform IP forwarding but is not enabled for IP
  14185. // forwarding).
  14186. Key string `json:"key,omitempty"`
  14187. // Value: [Output Only] A warning data value corresponding to the key.
  14188. Value string `json:"value,omitempty"`
  14189. // ForceSendFields is a list of field names (e.g. "Key") to
  14190. // unconditionally include in API requests. By default, fields with
  14191. // empty values are omitted from API requests. However, any non-pointer,
  14192. // non-interface field appearing in ForceSendFields will be sent to the
  14193. // server regardless of whether the field is empty or not. This may be
  14194. // used to include empty fields in Patch requests.
  14195. ForceSendFields []string `json:"-"`
  14196. // NullFields is a list of field names (e.g. "Key") to include in API
  14197. // requests with the JSON null value. By default, fields with empty
  14198. // values are omitted from API requests. However, any field with an
  14199. // empty value appearing in NullFields will be sent to the server as
  14200. // null. It is an error if a field in this list has a non-empty value.
  14201. // This may be used to include null fields in Patch requests.
  14202. NullFields []string `json:"-"`
  14203. }
  14204. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  14205. type NoMethod NodeGroupsListNodesWarningData
  14206. raw := NoMethod(*s)
  14207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14208. }
  14209. type NodeGroupsScopedList struct {
  14210. // NodeGroups: [Output Only] A list of node groups contained in this
  14211. // scope.
  14212. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  14213. // Warning: [Output Only] An informational warning that appears when the
  14214. // nodeGroup list is empty.
  14215. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  14216. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  14217. // unconditionally include in API requests. By default, fields with
  14218. // empty values are omitted from API requests. However, any non-pointer,
  14219. // non-interface field appearing in ForceSendFields will be sent to the
  14220. // server regardless of whether the field is empty or not. This may be
  14221. // used to include empty fields in Patch requests.
  14222. ForceSendFields []string `json:"-"`
  14223. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  14224. // API requests with the JSON null value. By default, fields with empty
  14225. // values are omitted from API requests. However, any field with an
  14226. // empty value appearing in NullFields will be sent to the server as
  14227. // null. It is an error if a field in this list has a non-empty value.
  14228. // This may be used to include null fields in Patch requests.
  14229. NullFields []string `json:"-"`
  14230. }
  14231. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  14232. type NoMethod NodeGroupsScopedList
  14233. raw := NoMethod(*s)
  14234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14235. }
  14236. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  14237. // that appears when the nodeGroup list is empty.
  14238. type NodeGroupsScopedListWarning struct {
  14239. // Code: [Output Only] A warning code, if applicable. For example,
  14240. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14241. // the response.
  14242. //
  14243. // Possible values:
  14244. // "CLEANUP_FAILED"
  14245. // "DEPRECATED_RESOURCE_USED"
  14246. // "DEPRECATED_TYPE_USED"
  14247. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14248. // "EXPERIMENTAL_TYPE_USED"
  14249. // "EXTERNAL_API_WARNING"
  14250. // "FIELD_VALUE_OVERRIDEN"
  14251. // "INJECTED_KERNELS_DEPRECATED"
  14252. // "MISSING_TYPE_DEPENDENCY"
  14253. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14254. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14255. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14256. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14257. // "NEXT_HOP_NOT_RUNNING"
  14258. // "NOT_CRITICAL_ERROR"
  14259. // "NO_RESULTS_ON_PAGE"
  14260. // "REQUIRED_TOS_AGREEMENT"
  14261. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14262. // "RESOURCE_NOT_DELETED"
  14263. // "SCHEMA_VALIDATION_IGNORED"
  14264. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14265. // "UNDECLARED_PROPERTIES"
  14266. // "UNREACHABLE"
  14267. Code string `json:"code,omitempty"`
  14268. // Data: [Output Only] Metadata about this warning in key: value format.
  14269. // For example:
  14270. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14271. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  14272. // Message: [Output Only] A human-readable description of the warning
  14273. // code.
  14274. Message string `json:"message,omitempty"`
  14275. // ForceSendFields is a list of field names (e.g. "Code") to
  14276. // unconditionally include in API requests. By default, fields with
  14277. // empty values are omitted from API requests. However, any non-pointer,
  14278. // non-interface field appearing in ForceSendFields will be sent to the
  14279. // server regardless of whether the field is empty or not. This may be
  14280. // used to include empty fields in Patch requests.
  14281. ForceSendFields []string `json:"-"`
  14282. // NullFields is a list of field names (e.g. "Code") to include in API
  14283. // requests with the JSON null value. By default, fields with empty
  14284. // values are omitted from API requests. However, any field with an
  14285. // empty value appearing in NullFields will be sent to the server as
  14286. // null. It is an error if a field in this list has a non-empty value.
  14287. // This may be used to include null fields in Patch requests.
  14288. NullFields []string `json:"-"`
  14289. }
  14290. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  14291. type NoMethod NodeGroupsScopedListWarning
  14292. raw := NoMethod(*s)
  14293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14294. }
  14295. type NodeGroupsScopedListWarningData struct {
  14296. // Key: [Output Only] A key that provides more detail on the warning
  14297. // being returned. For example, for warnings where there are no results
  14298. // in a list request for a particular zone, this key might be scope and
  14299. // the key value might be the zone name. Other examples might be a key
  14300. // indicating a deprecated resource and a suggested replacement, or a
  14301. // warning about invalid network settings (for example, if an instance
  14302. // attempts to perform IP forwarding but is not enabled for IP
  14303. // forwarding).
  14304. Key string `json:"key,omitempty"`
  14305. // Value: [Output Only] A warning data value corresponding to the key.
  14306. Value string `json:"value,omitempty"`
  14307. // ForceSendFields is a list of field names (e.g. "Key") to
  14308. // unconditionally include in API requests. By default, fields with
  14309. // empty values are omitted from API requests. However, any non-pointer,
  14310. // non-interface field appearing in ForceSendFields will be sent to the
  14311. // server regardless of whether the field is empty or not. This may be
  14312. // used to include empty fields in Patch requests.
  14313. ForceSendFields []string `json:"-"`
  14314. // NullFields is a list of field names (e.g. "Key") to include in API
  14315. // requests with the JSON null value. By default, fields with empty
  14316. // values are omitted from API requests. However, any field with an
  14317. // empty value appearing in NullFields will be sent to the server as
  14318. // null. It is an error if a field in this list has a non-empty value.
  14319. // This may be used to include null fields in Patch requests.
  14320. NullFields []string `json:"-"`
  14321. }
  14322. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14323. type NoMethod NodeGroupsScopedListWarningData
  14324. raw := NoMethod(*s)
  14325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14326. }
  14327. type NodeGroupsSetNodeTemplateRequest struct {
  14328. // NodeTemplate: Full or partial URL of the node template resource to be
  14329. // updated for this node group.
  14330. NodeTemplate string `json:"nodeTemplate,omitempty"`
  14331. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  14332. // unconditionally include in API requests. By default, fields with
  14333. // empty values are omitted from API requests. However, any non-pointer,
  14334. // non-interface field appearing in ForceSendFields will be sent to the
  14335. // server regardless of whether the field is empty or not. This may be
  14336. // used to include empty fields in Patch requests.
  14337. ForceSendFields []string `json:"-"`
  14338. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  14339. // in API requests with the JSON null value. By default, fields with
  14340. // empty values are omitted from API requests. However, any field with
  14341. // an empty value appearing in NullFields will be sent to the server as
  14342. // null. It is an error if a field in this list has a non-empty value.
  14343. // This may be used to include null fields in Patch requests.
  14344. NullFields []string `json:"-"`
  14345. }
  14346. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  14347. type NoMethod NodeGroupsSetNodeTemplateRequest
  14348. raw := NoMethod(*s)
  14349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14350. }
  14351. // NodeTemplate: A Node Template resource.
  14352. type NodeTemplate struct {
  14353. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14354. // format.
  14355. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14356. // Description: An optional description of this resource. Provide this
  14357. // property when you create the resource.
  14358. Description string `json:"description,omitempty"`
  14359. // Id: [Output Only] The unique identifier for the resource. This
  14360. // identifier is defined by the server.
  14361. Id uint64 `json:"id,omitempty,string"`
  14362. // Kind: [Output Only] The type of the resource. Always
  14363. // compute#nodeTemplate for node templates.
  14364. Kind string `json:"kind,omitempty"`
  14365. // Name: The name of the resource, provided by the client when initially
  14366. // creating the resource. The resource name must be 1-63 characters
  14367. // long, and comply with RFC1035. Specifically, the name must be 1-63
  14368. // characters long and match the regular expression
  14369. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  14370. // a lowercase letter, and all following characters must be a dash,
  14371. // lowercase letter, or digit, except the last character, which cannot
  14372. // be a dash.
  14373. Name string `json:"name,omitempty"`
  14374. // NodeAffinityLabels: Labels to use for node affinity, which will be
  14375. // used in instance scheduling.
  14376. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  14377. // NodeType: The node type to use for nodes group that are created from
  14378. // this template.
  14379. NodeType string `json:"nodeType,omitempty"`
  14380. // NodeTypeFlexibility: The flexible properties of the desired node
  14381. // type. Node groups that use this node template will create nodes of a
  14382. // type that matches these properties.
  14383. //
  14384. // This field is mutually exclusive with the node_type property; you can
  14385. // only define one or the other, but not both.
  14386. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  14387. // Region: [Output Only] The name of the region where the node template
  14388. // resides, such as us-central1.
  14389. Region string `json:"region,omitempty"`
  14390. // SelfLink: [Output Only] Server-defined URL for the resource.
  14391. SelfLink string `json:"selfLink,omitempty"`
  14392. // Status: [Output Only] The status of the node template. One of the
  14393. // following values: CREATING, READY, and DELETING.
  14394. //
  14395. // Possible values:
  14396. // "CREATING"
  14397. // "DELETING"
  14398. // "INVALID"
  14399. // "READY"
  14400. Status string `json:"status,omitempty"`
  14401. // StatusMessage: [Output Only] An optional, human-readable explanation
  14402. // of the status.
  14403. StatusMessage string `json:"statusMessage,omitempty"`
  14404. // ServerResponse contains the HTTP response code and headers from the
  14405. // server.
  14406. googleapi.ServerResponse `json:"-"`
  14407. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14408. // to unconditionally include in API requests. By default, fields with
  14409. // empty values are omitted from API requests. However, any non-pointer,
  14410. // non-interface field appearing in ForceSendFields will be sent to the
  14411. // server regardless of whether the field is empty or not. This may be
  14412. // used to include empty fields in Patch requests.
  14413. ForceSendFields []string `json:"-"`
  14414. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14415. // include in API requests with the JSON null value. By default, fields
  14416. // with empty values are omitted from API requests. However, any field
  14417. // with an empty value appearing in NullFields will be sent to the
  14418. // server as null. It is an error if a field in this list has a
  14419. // non-empty value. This may be used to include null fields in Patch
  14420. // requests.
  14421. NullFields []string `json:"-"`
  14422. }
  14423. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  14424. type NoMethod NodeTemplate
  14425. raw := NoMethod(*s)
  14426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14427. }
  14428. type NodeTemplateAggregatedList struct {
  14429. // Id: [Output Only] Unique identifier for the resource; defined by the
  14430. // server.
  14431. Id string `json:"id,omitempty"`
  14432. // Items: A list of NodeTemplatesScopedList resources.
  14433. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  14434. // Kind: [Output Only] Type of resource.Always
  14435. // compute#nodeTemplateAggregatedList for aggregated lists of node
  14436. // templates.
  14437. Kind string `json:"kind,omitempty"`
  14438. // NextPageToken: [Output Only] This token allows you to get the next
  14439. // page of results for list requests. If the number of results is larger
  14440. // than maxResults, use the nextPageToken as a value for the query
  14441. // parameter pageToken in the next list request. Subsequent list
  14442. // requests will have their own nextPageToken to continue paging through
  14443. // the results.
  14444. NextPageToken string `json:"nextPageToken,omitempty"`
  14445. // SelfLink: [Output Only] Server-defined URL for this resource.
  14446. SelfLink string `json:"selfLink,omitempty"`
  14447. // Warning: [Output Only] Informational warning message.
  14448. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  14449. // ServerResponse contains the HTTP response code and headers from the
  14450. // server.
  14451. googleapi.ServerResponse `json:"-"`
  14452. // ForceSendFields is a list of field names (e.g. "Id") to
  14453. // unconditionally include in API requests. By default, fields with
  14454. // empty values are omitted from API requests. However, any non-pointer,
  14455. // non-interface field appearing in ForceSendFields will be sent to the
  14456. // server regardless of whether the field is empty or not. This may be
  14457. // used to include empty fields in Patch requests.
  14458. ForceSendFields []string `json:"-"`
  14459. // NullFields is a list of field names (e.g. "Id") to include in API
  14460. // requests with the JSON null value. By default, fields with empty
  14461. // values are omitted from API requests. However, any field with an
  14462. // empty value appearing in NullFields will be sent to the server as
  14463. // null. It is an error if a field in this list has a non-empty value.
  14464. // This may be used to include null fields in Patch requests.
  14465. NullFields []string `json:"-"`
  14466. }
  14467. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  14468. type NoMethod NodeTemplateAggregatedList
  14469. raw := NoMethod(*s)
  14470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14471. }
  14472. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  14473. // warning message.
  14474. type NodeTemplateAggregatedListWarning struct {
  14475. // Code: [Output Only] A warning code, if applicable. For example,
  14476. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14477. // the response.
  14478. //
  14479. // Possible values:
  14480. // "CLEANUP_FAILED"
  14481. // "DEPRECATED_RESOURCE_USED"
  14482. // "DEPRECATED_TYPE_USED"
  14483. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14484. // "EXPERIMENTAL_TYPE_USED"
  14485. // "EXTERNAL_API_WARNING"
  14486. // "FIELD_VALUE_OVERRIDEN"
  14487. // "INJECTED_KERNELS_DEPRECATED"
  14488. // "MISSING_TYPE_DEPENDENCY"
  14489. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14490. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14491. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14492. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14493. // "NEXT_HOP_NOT_RUNNING"
  14494. // "NOT_CRITICAL_ERROR"
  14495. // "NO_RESULTS_ON_PAGE"
  14496. // "REQUIRED_TOS_AGREEMENT"
  14497. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14498. // "RESOURCE_NOT_DELETED"
  14499. // "SCHEMA_VALIDATION_IGNORED"
  14500. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14501. // "UNDECLARED_PROPERTIES"
  14502. // "UNREACHABLE"
  14503. Code string `json:"code,omitempty"`
  14504. // Data: [Output Only] Metadata about this warning in key: value format.
  14505. // For example:
  14506. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14507. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  14508. // Message: [Output Only] A human-readable description of the warning
  14509. // code.
  14510. Message string `json:"message,omitempty"`
  14511. // ForceSendFields is a list of field names (e.g. "Code") to
  14512. // unconditionally include in API requests. By default, fields with
  14513. // empty values are omitted from API requests. However, any non-pointer,
  14514. // non-interface field appearing in ForceSendFields will be sent to the
  14515. // server regardless of whether the field is empty or not. This may be
  14516. // used to include empty fields in Patch requests.
  14517. ForceSendFields []string `json:"-"`
  14518. // NullFields is a list of field names (e.g. "Code") to include in API
  14519. // requests with the JSON null value. By default, fields with empty
  14520. // values are omitted from API requests. However, any field with an
  14521. // empty value appearing in NullFields will be sent to the server as
  14522. // null. It is an error if a field in this list has a non-empty value.
  14523. // This may be used to include null fields in Patch requests.
  14524. NullFields []string `json:"-"`
  14525. }
  14526. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14527. type NoMethod NodeTemplateAggregatedListWarning
  14528. raw := NoMethod(*s)
  14529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14530. }
  14531. type NodeTemplateAggregatedListWarningData struct {
  14532. // Key: [Output Only] A key that provides more detail on the warning
  14533. // being returned. For example, for warnings where there are no results
  14534. // in a list request for a particular zone, this key might be scope and
  14535. // the key value might be the zone name. Other examples might be a key
  14536. // indicating a deprecated resource and a suggested replacement, or a
  14537. // warning about invalid network settings (for example, if an instance
  14538. // attempts to perform IP forwarding but is not enabled for IP
  14539. // forwarding).
  14540. Key string `json:"key,omitempty"`
  14541. // Value: [Output Only] A warning data value corresponding to the key.
  14542. Value string `json:"value,omitempty"`
  14543. // ForceSendFields is a list of field names (e.g. "Key") to
  14544. // unconditionally include in API requests. By default, fields with
  14545. // empty values are omitted from API requests. However, any non-pointer,
  14546. // non-interface field appearing in ForceSendFields will be sent to the
  14547. // server regardless of whether the field is empty or not. This may be
  14548. // used to include empty fields in Patch requests.
  14549. ForceSendFields []string `json:"-"`
  14550. // NullFields is a list of field names (e.g. "Key") to include in API
  14551. // requests with the JSON null value. By default, fields with empty
  14552. // values are omitted from API requests. However, any field with an
  14553. // empty value appearing in NullFields will be sent to the server as
  14554. // null. It is an error if a field in this list has a non-empty value.
  14555. // This may be used to include null fields in Patch requests.
  14556. NullFields []string `json:"-"`
  14557. }
  14558. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  14559. type NoMethod NodeTemplateAggregatedListWarningData
  14560. raw := NoMethod(*s)
  14561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14562. }
  14563. // NodeTemplateList: Contains a list of node templates.
  14564. type NodeTemplateList struct {
  14565. // Id: [Output Only] Unique identifier for the resource; defined by the
  14566. // server.
  14567. Id string `json:"id,omitempty"`
  14568. // Items: A list of NodeTemplate resources.
  14569. Items []*NodeTemplate `json:"items,omitempty"`
  14570. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  14571. // for lists of node templates.
  14572. Kind string `json:"kind,omitempty"`
  14573. // NextPageToken: [Output Only] This token allows you to get the next
  14574. // page of results for list requests. If the number of results is larger
  14575. // than maxResults, use the nextPageToken as a value for the query
  14576. // parameter pageToken in the next list request. Subsequent list
  14577. // requests will have their own nextPageToken to continue paging through
  14578. // the results.
  14579. NextPageToken string `json:"nextPageToken,omitempty"`
  14580. // SelfLink: [Output Only] Server-defined URL for this resource.
  14581. SelfLink string `json:"selfLink,omitempty"`
  14582. // Warning: [Output Only] Informational warning message.
  14583. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  14584. // ServerResponse contains the HTTP response code and headers from the
  14585. // server.
  14586. googleapi.ServerResponse `json:"-"`
  14587. // ForceSendFields is a list of field names (e.g. "Id") to
  14588. // unconditionally include in API requests. By default, fields with
  14589. // empty values are omitted from API requests. However, any non-pointer,
  14590. // non-interface field appearing in ForceSendFields will be sent to the
  14591. // server regardless of whether the field is empty or not. This may be
  14592. // used to include empty fields in Patch requests.
  14593. ForceSendFields []string `json:"-"`
  14594. // NullFields is a list of field names (e.g. "Id") to include in API
  14595. // requests with the JSON null value. By default, fields with empty
  14596. // values are omitted from API requests. However, any field with an
  14597. // empty value appearing in NullFields will be sent to the server as
  14598. // null. It is an error if a field in this list has a non-empty value.
  14599. // This may be used to include null fields in Patch requests.
  14600. NullFields []string `json:"-"`
  14601. }
  14602. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  14603. type NoMethod NodeTemplateList
  14604. raw := NoMethod(*s)
  14605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14606. }
  14607. // NodeTemplateListWarning: [Output Only] Informational warning message.
  14608. type NodeTemplateListWarning struct {
  14609. // Code: [Output Only] A warning code, if applicable. For example,
  14610. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14611. // the response.
  14612. //
  14613. // Possible values:
  14614. // "CLEANUP_FAILED"
  14615. // "DEPRECATED_RESOURCE_USED"
  14616. // "DEPRECATED_TYPE_USED"
  14617. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14618. // "EXPERIMENTAL_TYPE_USED"
  14619. // "EXTERNAL_API_WARNING"
  14620. // "FIELD_VALUE_OVERRIDEN"
  14621. // "INJECTED_KERNELS_DEPRECATED"
  14622. // "MISSING_TYPE_DEPENDENCY"
  14623. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14624. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14625. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14626. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14627. // "NEXT_HOP_NOT_RUNNING"
  14628. // "NOT_CRITICAL_ERROR"
  14629. // "NO_RESULTS_ON_PAGE"
  14630. // "REQUIRED_TOS_AGREEMENT"
  14631. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14632. // "RESOURCE_NOT_DELETED"
  14633. // "SCHEMA_VALIDATION_IGNORED"
  14634. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14635. // "UNDECLARED_PROPERTIES"
  14636. // "UNREACHABLE"
  14637. Code string `json:"code,omitempty"`
  14638. // Data: [Output Only] Metadata about this warning in key: value format.
  14639. // For example:
  14640. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14641. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  14642. // Message: [Output Only] A human-readable description of the warning
  14643. // code.
  14644. Message string `json:"message,omitempty"`
  14645. // ForceSendFields is a list of field names (e.g. "Code") to
  14646. // unconditionally include in API requests. By default, fields with
  14647. // empty values are omitted from API requests. However, any non-pointer,
  14648. // non-interface field appearing in ForceSendFields will be sent to the
  14649. // server regardless of whether the field is empty or not. This may be
  14650. // used to include empty fields in Patch requests.
  14651. ForceSendFields []string `json:"-"`
  14652. // NullFields is a list of field names (e.g. "Code") to include in API
  14653. // requests with the JSON null value. By default, fields with empty
  14654. // values are omitted from API requests. However, any field with an
  14655. // empty value appearing in NullFields will be sent to the server as
  14656. // null. It is an error if a field in this list has a non-empty value.
  14657. // This may be used to include null fields in Patch requests.
  14658. NullFields []string `json:"-"`
  14659. }
  14660. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  14661. type NoMethod NodeTemplateListWarning
  14662. raw := NoMethod(*s)
  14663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14664. }
  14665. type NodeTemplateListWarningData struct {
  14666. // Key: [Output Only] A key that provides more detail on the warning
  14667. // being returned. For example, for warnings where there are no results
  14668. // in a list request for a particular zone, this key might be scope and
  14669. // the key value might be the zone name. Other examples might be a key
  14670. // indicating a deprecated resource and a suggested replacement, or a
  14671. // warning about invalid network settings (for example, if an instance
  14672. // attempts to perform IP forwarding but is not enabled for IP
  14673. // forwarding).
  14674. Key string `json:"key,omitempty"`
  14675. // Value: [Output Only] A warning data value corresponding to the key.
  14676. Value string `json:"value,omitempty"`
  14677. // ForceSendFields is a list of field names (e.g. "Key") to
  14678. // unconditionally include in API requests. By default, fields with
  14679. // empty values are omitted from API requests. However, any non-pointer,
  14680. // non-interface field appearing in ForceSendFields will be sent to the
  14681. // server regardless of whether the field is empty or not. This may be
  14682. // used to include empty fields in Patch requests.
  14683. ForceSendFields []string `json:"-"`
  14684. // NullFields is a list of field names (e.g. "Key") to include in API
  14685. // requests with the JSON null value. By default, fields with empty
  14686. // values are omitted from API requests. However, any field with an
  14687. // empty value appearing in NullFields will be sent to the server as
  14688. // null. It is an error if a field in this list has a non-empty value.
  14689. // This may be used to include null fields in Patch requests.
  14690. NullFields []string `json:"-"`
  14691. }
  14692. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  14693. type NoMethod NodeTemplateListWarningData
  14694. raw := NoMethod(*s)
  14695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14696. }
  14697. type NodeTemplateNodeTypeFlexibility struct {
  14698. Cpus string `json:"cpus,omitempty"`
  14699. LocalSsd string `json:"localSsd,omitempty"`
  14700. Memory string `json:"memory,omitempty"`
  14701. // ForceSendFields is a list of field names (e.g. "Cpus") to
  14702. // unconditionally include in API requests. By default, fields with
  14703. // empty values are omitted from API requests. However, any non-pointer,
  14704. // non-interface field appearing in ForceSendFields will be sent to the
  14705. // server regardless of whether the field is empty or not. This may be
  14706. // used to include empty fields in Patch requests.
  14707. ForceSendFields []string `json:"-"`
  14708. // NullFields is a list of field names (e.g. "Cpus") to include in API
  14709. // requests with the JSON null value. By default, fields with empty
  14710. // values are omitted from API requests. However, any field with an
  14711. // empty value appearing in NullFields will be sent to the server as
  14712. // null. It is an error if a field in this list has a non-empty value.
  14713. // This may be used to include null fields in Patch requests.
  14714. NullFields []string `json:"-"`
  14715. }
  14716. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  14717. type NoMethod NodeTemplateNodeTypeFlexibility
  14718. raw := NoMethod(*s)
  14719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14720. }
  14721. type NodeTemplatesScopedList struct {
  14722. // NodeTemplates: [Output Only] A list of node templates contained in
  14723. // this scope.
  14724. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  14725. // Warning: [Output Only] An informational warning that appears when the
  14726. // node templates list is empty.
  14727. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  14728. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  14729. // unconditionally include in API requests. By default, fields with
  14730. // empty values are omitted from API requests. However, any non-pointer,
  14731. // non-interface field appearing in ForceSendFields will be sent to the
  14732. // server regardless of whether the field is empty or not. This may be
  14733. // used to include empty fields in Patch requests.
  14734. ForceSendFields []string `json:"-"`
  14735. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  14736. // in API requests with the JSON null value. By default, fields with
  14737. // empty values are omitted from API requests. However, any field with
  14738. // an empty value appearing in NullFields will be sent to the server as
  14739. // null. It is an error if a field in this list has a non-empty value.
  14740. // This may be used to include null fields in Patch requests.
  14741. NullFields []string `json:"-"`
  14742. }
  14743. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  14744. type NoMethod NodeTemplatesScopedList
  14745. raw := NoMethod(*s)
  14746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14747. }
  14748. // NodeTemplatesScopedListWarning: [Output Only] An informational
  14749. // warning that appears when the node templates list is empty.
  14750. type NodeTemplatesScopedListWarning struct {
  14751. // Code: [Output Only] A warning code, if applicable. For example,
  14752. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14753. // the response.
  14754. //
  14755. // Possible values:
  14756. // "CLEANUP_FAILED"
  14757. // "DEPRECATED_RESOURCE_USED"
  14758. // "DEPRECATED_TYPE_USED"
  14759. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14760. // "EXPERIMENTAL_TYPE_USED"
  14761. // "EXTERNAL_API_WARNING"
  14762. // "FIELD_VALUE_OVERRIDEN"
  14763. // "INJECTED_KERNELS_DEPRECATED"
  14764. // "MISSING_TYPE_DEPENDENCY"
  14765. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14766. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14767. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14768. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14769. // "NEXT_HOP_NOT_RUNNING"
  14770. // "NOT_CRITICAL_ERROR"
  14771. // "NO_RESULTS_ON_PAGE"
  14772. // "REQUIRED_TOS_AGREEMENT"
  14773. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14774. // "RESOURCE_NOT_DELETED"
  14775. // "SCHEMA_VALIDATION_IGNORED"
  14776. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14777. // "UNDECLARED_PROPERTIES"
  14778. // "UNREACHABLE"
  14779. Code string `json:"code,omitempty"`
  14780. // Data: [Output Only] Metadata about this warning in key: value format.
  14781. // For example:
  14782. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14783. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  14784. // Message: [Output Only] A human-readable description of the warning
  14785. // code.
  14786. Message string `json:"message,omitempty"`
  14787. // ForceSendFields is a list of field names (e.g. "Code") to
  14788. // unconditionally include in API requests. By default, fields with
  14789. // empty values are omitted from API requests. However, any non-pointer,
  14790. // non-interface field appearing in ForceSendFields will be sent to the
  14791. // server regardless of whether the field is empty or not. This may be
  14792. // used to include empty fields in Patch requests.
  14793. ForceSendFields []string `json:"-"`
  14794. // NullFields is a list of field names (e.g. "Code") to include in API
  14795. // requests with the JSON null value. By default, fields with empty
  14796. // values are omitted from API requests. However, any field with an
  14797. // empty value appearing in NullFields will be sent to the server as
  14798. // null. It is an error if a field in this list has a non-empty value.
  14799. // This may be used to include null fields in Patch requests.
  14800. NullFields []string `json:"-"`
  14801. }
  14802. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  14803. type NoMethod NodeTemplatesScopedListWarning
  14804. raw := NoMethod(*s)
  14805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14806. }
  14807. type NodeTemplatesScopedListWarningData struct {
  14808. // Key: [Output Only] A key that provides more detail on the warning
  14809. // being returned. For example, for warnings where there are no results
  14810. // in a list request for a particular zone, this key might be scope and
  14811. // the key value might be the zone name. Other examples might be a key
  14812. // indicating a deprecated resource and a suggested replacement, or a
  14813. // warning about invalid network settings (for example, if an instance
  14814. // attempts to perform IP forwarding but is not enabled for IP
  14815. // forwarding).
  14816. Key string `json:"key,omitempty"`
  14817. // Value: [Output Only] A warning data value corresponding to the key.
  14818. Value string `json:"value,omitempty"`
  14819. // ForceSendFields is a list of field names (e.g. "Key") to
  14820. // unconditionally include in API requests. By default, fields with
  14821. // empty values are omitted from API requests. However, any non-pointer,
  14822. // non-interface field appearing in ForceSendFields will be sent to the
  14823. // server regardless of whether the field is empty or not. This may be
  14824. // used to include empty fields in Patch requests.
  14825. ForceSendFields []string `json:"-"`
  14826. // NullFields is a list of field names (e.g. "Key") to include in API
  14827. // requests with the JSON null value. By default, fields with empty
  14828. // values are omitted from API requests. However, any field with an
  14829. // empty value appearing in NullFields will be sent to the server as
  14830. // null. It is an error if a field in this list has a non-empty value.
  14831. // This may be used to include null fields in Patch requests.
  14832. NullFields []string `json:"-"`
  14833. }
  14834. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  14835. type NoMethod NodeTemplatesScopedListWarningData
  14836. raw := NoMethod(*s)
  14837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14838. }
  14839. // NodeType: A Node Type resource.
  14840. type NodeType struct {
  14841. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  14842. CpuPlatform string `json:"cpuPlatform,omitempty"`
  14843. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14844. // format.
  14845. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14846. // Deprecated: [Output Only] The deprecation status associated with this
  14847. // node type.
  14848. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  14849. // Description: [Output Only] An optional textual description of the
  14850. // resource.
  14851. Description string `json:"description,omitempty"`
  14852. // GuestCpus: [Output Only] The number of virtual CPUs that are
  14853. // available to the node type.
  14854. GuestCpus int64 `json:"guestCpus,omitempty"`
  14855. // Id: [Output Only] The unique identifier for the resource. This
  14856. // identifier is defined by the server.
  14857. Id uint64 `json:"id,omitempty,string"`
  14858. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  14859. // for node types.
  14860. Kind string `json:"kind,omitempty"`
  14861. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  14862. // defined in GB.
  14863. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  14864. // MemoryMb: [Output Only] The amount of physical memory available to
  14865. // the node type, defined in MB.
  14866. MemoryMb int64 `json:"memoryMb,omitempty"`
  14867. // Name: [Output Only] Name of the resource.
  14868. Name string `json:"name,omitempty"`
  14869. // SelfLink: [Output Only] Server-defined URL for the resource.
  14870. SelfLink string `json:"selfLink,omitempty"`
  14871. // Zone: [Output Only] The name of the zone where the node type resides,
  14872. // such as us-central1-a.
  14873. Zone string `json:"zone,omitempty"`
  14874. // ServerResponse contains the HTTP response code and headers from the
  14875. // server.
  14876. googleapi.ServerResponse `json:"-"`
  14877. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  14878. // unconditionally include in API requests. By default, fields with
  14879. // empty values are omitted from API requests. However, any non-pointer,
  14880. // non-interface field appearing in ForceSendFields will be sent to the
  14881. // server regardless of whether the field is empty or not. This may be
  14882. // used to include empty fields in Patch requests.
  14883. ForceSendFields []string `json:"-"`
  14884. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  14885. // in API requests with the JSON null value. By default, fields with
  14886. // empty values are omitted from API requests. However, any field with
  14887. // an empty value appearing in NullFields will be sent to the server as
  14888. // null. It is an error if a field in this list has a non-empty value.
  14889. // This may be used to include null fields in Patch requests.
  14890. NullFields []string `json:"-"`
  14891. }
  14892. func (s *NodeType) MarshalJSON() ([]byte, error) {
  14893. type NoMethod NodeType
  14894. raw := NoMethod(*s)
  14895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14896. }
  14897. type NodeTypeAggregatedList struct {
  14898. // Id: [Output Only] Unique identifier for the resource; defined by the
  14899. // server.
  14900. Id string `json:"id,omitempty"`
  14901. // Items: A list of NodeTypesScopedList resources.
  14902. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  14903. // Kind: [Output Only] Type of resource.Always
  14904. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  14905. Kind string `json:"kind,omitempty"`
  14906. // NextPageToken: [Output Only] This token allows you to get the next
  14907. // page of results for list requests. If the number of results is larger
  14908. // than maxResults, use the nextPageToken as a value for the query
  14909. // parameter pageToken in the next list request. Subsequent list
  14910. // requests will have their own nextPageToken to continue paging through
  14911. // the results.
  14912. NextPageToken string `json:"nextPageToken,omitempty"`
  14913. // SelfLink: [Output Only] Server-defined URL for this resource.
  14914. SelfLink string `json:"selfLink,omitempty"`
  14915. // Warning: [Output Only] Informational warning message.
  14916. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  14917. // ServerResponse contains the HTTP response code and headers from the
  14918. // server.
  14919. googleapi.ServerResponse `json:"-"`
  14920. // ForceSendFields is a list of field names (e.g. "Id") to
  14921. // unconditionally include in API requests. By default, fields with
  14922. // empty values are omitted from API requests. However, any non-pointer,
  14923. // non-interface field appearing in ForceSendFields will be sent to the
  14924. // server regardless of whether the field is empty or not. This may be
  14925. // used to include empty fields in Patch requests.
  14926. ForceSendFields []string `json:"-"`
  14927. // NullFields is a list of field names (e.g. "Id") to include in API
  14928. // requests with the JSON null value. By default, fields with empty
  14929. // values are omitted from API requests. However, any field with an
  14930. // empty value appearing in NullFields will be sent to the server as
  14931. // null. It is an error if a field in this list has a non-empty value.
  14932. // This may be used to include null fields in Patch requests.
  14933. NullFields []string `json:"-"`
  14934. }
  14935. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  14936. type NoMethod NodeTypeAggregatedList
  14937. raw := NoMethod(*s)
  14938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14939. }
  14940. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  14941. // message.
  14942. type NodeTypeAggregatedListWarning struct {
  14943. // Code: [Output Only] A warning code, if applicable. For example,
  14944. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14945. // the response.
  14946. //
  14947. // Possible values:
  14948. // "CLEANUP_FAILED"
  14949. // "DEPRECATED_RESOURCE_USED"
  14950. // "DEPRECATED_TYPE_USED"
  14951. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14952. // "EXPERIMENTAL_TYPE_USED"
  14953. // "EXTERNAL_API_WARNING"
  14954. // "FIELD_VALUE_OVERRIDEN"
  14955. // "INJECTED_KERNELS_DEPRECATED"
  14956. // "MISSING_TYPE_DEPENDENCY"
  14957. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14958. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14959. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14960. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14961. // "NEXT_HOP_NOT_RUNNING"
  14962. // "NOT_CRITICAL_ERROR"
  14963. // "NO_RESULTS_ON_PAGE"
  14964. // "REQUIRED_TOS_AGREEMENT"
  14965. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14966. // "RESOURCE_NOT_DELETED"
  14967. // "SCHEMA_VALIDATION_IGNORED"
  14968. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14969. // "UNDECLARED_PROPERTIES"
  14970. // "UNREACHABLE"
  14971. Code string `json:"code,omitempty"`
  14972. // Data: [Output Only] Metadata about this warning in key: value format.
  14973. // For example:
  14974. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14975. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  14976. // Message: [Output Only] A human-readable description of the warning
  14977. // code.
  14978. Message string `json:"message,omitempty"`
  14979. // ForceSendFields is a list of field names (e.g. "Code") to
  14980. // unconditionally include in API requests. By default, fields with
  14981. // empty values are omitted from API requests. However, any non-pointer,
  14982. // non-interface field appearing in ForceSendFields will be sent to the
  14983. // server regardless of whether the field is empty or not. This may be
  14984. // used to include empty fields in Patch requests.
  14985. ForceSendFields []string `json:"-"`
  14986. // NullFields is a list of field names (e.g. "Code") to include in API
  14987. // requests with the JSON null value. By default, fields with empty
  14988. // values are omitted from API requests. However, any field with an
  14989. // empty value appearing in NullFields will be sent to the server as
  14990. // null. It is an error if a field in this list has a non-empty value.
  14991. // This may be used to include null fields in Patch requests.
  14992. NullFields []string `json:"-"`
  14993. }
  14994. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14995. type NoMethod NodeTypeAggregatedListWarning
  14996. raw := NoMethod(*s)
  14997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14998. }
  14999. type NodeTypeAggregatedListWarningData struct {
  15000. // Key: [Output Only] A key that provides more detail on the warning
  15001. // being returned. For example, for warnings where there are no results
  15002. // in a list request for a particular zone, this key might be scope and
  15003. // the key value might be the zone name. Other examples might be a key
  15004. // indicating a deprecated resource and a suggested replacement, or a
  15005. // warning about invalid network settings (for example, if an instance
  15006. // attempts to perform IP forwarding but is not enabled for IP
  15007. // forwarding).
  15008. Key string `json:"key,omitempty"`
  15009. // Value: [Output Only] A warning data value corresponding to the key.
  15010. Value string `json:"value,omitempty"`
  15011. // ForceSendFields is a list of field names (e.g. "Key") to
  15012. // unconditionally include in API requests. By default, fields with
  15013. // empty values are omitted from API requests. However, any non-pointer,
  15014. // non-interface field appearing in ForceSendFields will be sent to the
  15015. // server regardless of whether the field is empty or not. This may be
  15016. // used to include empty fields in Patch requests.
  15017. ForceSendFields []string `json:"-"`
  15018. // NullFields is a list of field names (e.g. "Key") to include in API
  15019. // requests with the JSON null value. By default, fields with empty
  15020. // values are omitted from API requests. However, any field with an
  15021. // empty value appearing in NullFields will be sent to the server as
  15022. // null. It is an error if a field in this list has a non-empty value.
  15023. // This may be used to include null fields in Patch requests.
  15024. NullFields []string `json:"-"`
  15025. }
  15026. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15027. type NoMethod NodeTypeAggregatedListWarningData
  15028. raw := NoMethod(*s)
  15029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15030. }
  15031. // NodeTypeList: Contains a list of node types.
  15032. type NodeTypeList struct {
  15033. // Id: [Output Only] Unique identifier for the resource; defined by the
  15034. // server.
  15035. Id string `json:"id,omitempty"`
  15036. // Items: A list of NodeType resources.
  15037. Items []*NodeType `json:"items,omitempty"`
  15038. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  15039. // lists of node types.
  15040. Kind string `json:"kind,omitempty"`
  15041. // NextPageToken: [Output Only] This token allows you to get the next
  15042. // page of results for list requests. If the number of results is larger
  15043. // than maxResults, use the nextPageToken as a value for the query
  15044. // parameter pageToken in the next list request. Subsequent list
  15045. // requests will have their own nextPageToken to continue paging through
  15046. // the results.
  15047. NextPageToken string `json:"nextPageToken,omitempty"`
  15048. // SelfLink: [Output Only] Server-defined URL for this resource.
  15049. SelfLink string `json:"selfLink,omitempty"`
  15050. // Warning: [Output Only] Informational warning message.
  15051. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  15052. // ServerResponse contains the HTTP response code and headers from the
  15053. // server.
  15054. googleapi.ServerResponse `json:"-"`
  15055. // ForceSendFields is a list of field names (e.g. "Id") to
  15056. // unconditionally include in API requests. By default, fields with
  15057. // empty values are omitted from API requests. However, any non-pointer,
  15058. // non-interface field appearing in ForceSendFields will be sent to the
  15059. // server regardless of whether the field is empty or not. This may be
  15060. // used to include empty fields in Patch requests.
  15061. ForceSendFields []string `json:"-"`
  15062. // NullFields is a list of field names (e.g. "Id") to include in API
  15063. // requests with the JSON null value. By default, fields with empty
  15064. // values are omitted from API requests. However, any field with an
  15065. // empty value appearing in NullFields will be sent to the server as
  15066. // null. It is an error if a field in this list has a non-empty value.
  15067. // This may be used to include null fields in Patch requests.
  15068. NullFields []string `json:"-"`
  15069. }
  15070. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  15071. type NoMethod NodeTypeList
  15072. raw := NoMethod(*s)
  15073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15074. }
  15075. // NodeTypeListWarning: [Output Only] Informational warning message.
  15076. type NodeTypeListWarning struct {
  15077. // Code: [Output Only] A warning code, if applicable. For example,
  15078. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15079. // the response.
  15080. //
  15081. // Possible values:
  15082. // "CLEANUP_FAILED"
  15083. // "DEPRECATED_RESOURCE_USED"
  15084. // "DEPRECATED_TYPE_USED"
  15085. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15086. // "EXPERIMENTAL_TYPE_USED"
  15087. // "EXTERNAL_API_WARNING"
  15088. // "FIELD_VALUE_OVERRIDEN"
  15089. // "INJECTED_KERNELS_DEPRECATED"
  15090. // "MISSING_TYPE_DEPENDENCY"
  15091. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15092. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15093. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15094. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15095. // "NEXT_HOP_NOT_RUNNING"
  15096. // "NOT_CRITICAL_ERROR"
  15097. // "NO_RESULTS_ON_PAGE"
  15098. // "REQUIRED_TOS_AGREEMENT"
  15099. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15100. // "RESOURCE_NOT_DELETED"
  15101. // "SCHEMA_VALIDATION_IGNORED"
  15102. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15103. // "UNDECLARED_PROPERTIES"
  15104. // "UNREACHABLE"
  15105. Code string `json:"code,omitempty"`
  15106. // Data: [Output Only] Metadata about this warning in key: value format.
  15107. // For example:
  15108. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15109. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  15110. // Message: [Output Only] A human-readable description of the warning
  15111. // code.
  15112. Message string `json:"message,omitempty"`
  15113. // ForceSendFields is a list of field names (e.g. "Code") to
  15114. // unconditionally include in API requests. By default, fields with
  15115. // empty values are omitted from API requests. However, any non-pointer,
  15116. // non-interface field appearing in ForceSendFields will be sent to the
  15117. // server regardless of whether the field is empty or not. This may be
  15118. // used to include empty fields in Patch requests.
  15119. ForceSendFields []string `json:"-"`
  15120. // NullFields is a list of field names (e.g. "Code") to include in API
  15121. // requests with the JSON null value. By default, fields with empty
  15122. // values are omitted from API requests. However, any field with an
  15123. // empty value appearing in NullFields will be sent to the server as
  15124. // null. It is an error if a field in this list has a non-empty value.
  15125. // This may be used to include null fields in Patch requests.
  15126. NullFields []string `json:"-"`
  15127. }
  15128. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  15129. type NoMethod NodeTypeListWarning
  15130. raw := NoMethod(*s)
  15131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15132. }
  15133. type NodeTypeListWarningData struct {
  15134. // Key: [Output Only] A key that provides more detail on the warning
  15135. // being returned. For example, for warnings where there are no results
  15136. // in a list request for a particular zone, this key might be scope and
  15137. // the key value might be the zone name. Other examples might be a key
  15138. // indicating a deprecated resource and a suggested replacement, or a
  15139. // warning about invalid network settings (for example, if an instance
  15140. // attempts to perform IP forwarding but is not enabled for IP
  15141. // forwarding).
  15142. Key string `json:"key,omitempty"`
  15143. // Value: [Output Only] A warning data value corresponding to the key.
  15144. Value string `json:"value,omitempty"`
  15145. // ForceSendFields is a list of field names (e.g. "Key") to
  15146. // unconditionally include in API requests. By default, fields with
  15147. // empty values are omitted from API requests. However, any non-pointer,
  15148. // non-interface field appearing in ForceSendFields will be sent to the
  15149. // server regardless of whether the field is empty or not. This may be
  15150. // used to include empty fields in Patch requests.
  15151. ForceSendFields []string `json:"-"`
  15152. // NullFields is a list of field names (e.g. "Key") to include in API
  15153. // requests with the JSON null value. By default, fields with empty
  15154. // values are omitted from API requests. However, any field with an
  15155. // empty value appearing in NullFields will be sent to the server as
  15156. // null. It is an error if a field in this list has a non-empty value.
  15157. // This may be used to include null fields in Patch requests.
  15158. NullFields []string `json:"-"`
  15159. }
  15160. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  15161. type NoMethod NodeTypeListWarningData
  15162. raw := NoMethod(*s)
  15163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15164. }
  15165. type NodeTypesScopedList struct {
  15166. // NodeTypes: [Output Only] A list of node types contained in this
  15167. // scope.
  15168. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  15169. // Warning: [Output Only] An informational warning that appears when the
  15170. // node types list is empty.
  15171. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  15172. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  15173. // unconditionally include in API requests. By default, fields with
  15174. // empty values are omitted from API requests. However, any non-pointer,
  15175. // non-interface field appearing in ForceSendFields will be sent to the
  15176. // server regardless of whether the field is empty or not. This may be
  15177. // used to include empty fields in Patch requests.
  15178. ForceSendFields []string `json:"-"`
  15179. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  15180. // API requests with the JSON null value. By default, fields with empty
  15181. // values are omitted from API requests. However, any field with an
  15182. // empty value appearing in NullFields will be sent to the server as
  15183. // null. It is an error if a field in this list has a non-empty value.
  15184. // This may be used to include null fields in Patch requests.
  15185. NullFields []string `json:"-"`
  15186. }
  15187. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  15188. type NoMethod NodeTypesScopedList
  15189. raw := NoMethod(*s)
  15190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15191. }
  15192. // NodeTypesScopedListWarning: [Output Only] An informational warning
  15193. // that appears when the node types list is empty.
  15194. type NodeTypesScopedListWarning struct {
  15195. // Code: [Output Only] A warning code, if applicable. For example,
  15196. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15197. // the response.
  15198. //
  15199. // Possible values:
  15200. // "CLEANUP_FAILED"
  15201. // "DEPRECATED_RESOURCE_USED"
  15202. // "DEPRECATED_TYPE_USED"
  15203. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15204. // "EXPERIMENTAL_TYPE_USED"
  15205. // "EXTERNAL_API_WARNING"
  15206. // "FIELD_VALUE_OVERRIDEN"
  15207. // "INJECTED_KERNELS_DEPRECATED"
  15208. // "MISSING_TYPE_DEPENDENCY"
  15209. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15210. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15211. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15212. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15213. // "NEXT_HOP_NOT_RUNNING"
  15214. // "NOT_CRITICAL_ERROR"
  15215. // "NO_RESULTS_ON_PAGE"
  15216. // "REQUIRED_TOS_AGREEMENT"
  15217. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15218. // "RESOURCE_NOT_DELETED"
  15219. // "SCHEMA_VALIDATION_IGNORED"
  15220. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15221. // "UNDECLARED_PROPERTIES"
  15222. // "UNREACHABLE"
  15223. Code string `json:"code,omitempty"`
  15224. // Data: [Output Only] Metadata about this warning in key: value format.
  15225. // For example:
  15226. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15227. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  15228. // Message: [Output Only] A human-readable description of the warning
  15229. // code.
  15230. Message string `json:"message,omitempty"`
  15231. // ForceSendFields is a list of field names (e.g. "Code") to
  15232. // unconditionally include in API requests. By default, fields with
  15233. // empty values are omitted from API requests. However, any non-pointer,
  15234. // non-interface field appearing in ForceSendFields will be sent to the
  15235. // server regardless of whether the field is empty or not. This may be
  15236. // used to include empty fields in Patch requests.
  15237. ForceSendFields []string `json:"-"`
  15238. // NullFields is a list of field names (e.g. "Code") to include in API
  15239. // requests with the JSON null value. By default, fields with empty
  15240. // values are omitted from API requests. However, any field with an
  15241. // empty value appearing in NullFields will be sent to the server as
  15242. // null. It is an error if a field in this list has a non-empty value.
  15243. // This may be used to include null fields in Patch requests.
  15244. NullFields []string `json:"-"`
  15245. }
  15246. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  15247. type NoMethod NodeTypesScopedListWarning
  15248. raw := NoMethod(*s)
  15249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15250. }
  15251. type NodeTypesScopedListWarningData struct {
  15252. // Key: [Output Only] A key that provides more detail on the warning
  15253. // being returned. For example, for warnings where there are no results
  15254. // in a list request for a particular zone, this key might be scope and
  15255. // the key value might be the zone name. Other examples might be a key
  15256. // indicating a deprecated resource and a suggested replacement, or a
  15257. // warning about invalid network settings (for example, if an instance
  15258. // attempts to perform IP forwarding but is not enabled for IP
  15259. // forwarding).
  15260. Key string `json:"key,omitempty"`
  15261. // Value: [Output Only] A warning data value corresponding to the key.
  15262. Value string `json:"value,omitempty"`
  15263. // ForceSendFields is a list of field names (e.g. "Key") to
  15264. // unconditionally include in API requests. By default, fields with
  15265. // empty values are omitted from API requests. However, any non-pointer,
  15266. // non-interface field appearing in ForceSendFields will be sent to the
  15267. // server regardless of whether the field is empty or not. This may be
  15268. // used to include empty fields in Patch requests.
  15269. ForceSendFields []string `json:"-"`
  15270. // NullFields is a list of field names (e.g. "Key") to include in API
  15271. // requests with the JSON null value. By default, fields with empty
  15272. // values are omitted from API requests. However, any field with an
  15273. // empty value appearing in NullFields will be sent to the server as
  15274. // null. It is an error if a field in this list has a non-empty value.
  15275. // This may be used to include null fields in Patch requests.
  15276. NullFields []string `json:"-"`
  15277. }
  15278. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15279. type NoMethod NodeTypesScopedListWarningData
  15280. raw := NoMethod(*s)
  15281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15282. }
  15283. // Operation: An Operation resource, used to manage asynchronous API
  15284. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  15285. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  15286. // (== resource_for beta.regionOperations ==) (== resource_for
  15287. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  15288. type Operation struct {
  15289. // ClientOperationId: [Output Only] The value of `requestId` if you
  15290. // provided it in the request. Not present otherwise.
  15291. ClientOperationId string `json:"clientOperationId,omitempty"`
  15292. // CreationTimestamp: [Deprecated] This field is deprecated.
  15293. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15294. // Description: [Output Only] A textual description of the operation,
  15295. // which is set when the operation is created.
  15296. Description string `json:"description,omitempty"`
  15297. // EndTime: [Output Only] The time that this operation was completed.
  15298. // This value is in RFC3339 text format.
  15299. EndTime string `json:"endTime,omitempty"`
  15300. // Error: [Output Only] If errors are generated during processing of the
  15301. // operation, this field will be populated.
  15302. Error *OperationError `json:"error,omitempty"`
  15303. // HttpErrorMessage: [Output Only] If the operation fails, this field
  15304. // contains the HTTP error message that was returned, such as NOT FOUND.
  15305. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  15306. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  15307. // contains the HTTP error status code that was returned. For example, a
  15308. // 404 means the resource was not found.
  15309. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  15310. // Id: [Output Only] The unique identifier for the resource. This
  15311. // identifier is defined by the server.
  15312. Id uint64 `json:"id,omitempty,string"`
  15313. // InsertTime: [Output Only] The time that this operation was requested.
  15314. // This value is in RFC3339 text format.
  15315. InsertTime string `json:"insertTime,omitempty"`
  15316. // Kind: [Output Only] Type of the resource. Always compute#operation
  15317. // for Operation resources.
  15318. Kind string `json:"kind,omitempty"`
  15319. // Name: [Output Only] Name of the resource.
  15320. Name string `json:"name,omitempty"`
  15321. // OperationType: [Output Only] The type of operation, such as insert,
  15322. // update, or delete, and so on.
  15323. OperationType string `json:"operationType,omitempty"`
  15324. // Progress: [Output Only] An optional progress indicator that ranges
  15325. // from 0 to 100. There is no requirement that this be linear or support
  15326. // any granularity of operations. This should not be used to guess when
  15327. // the operation will be complete. This number should monotonically
  15328. // increase as the operation progresses.
  15329. Progress int64 `json:"progress,omitempty"`
  15330. // Region: [Output Only] The URL of the region where the operation
  15331. // resides. Only available when performing regional operations. You must
  15332. // specify this field as part of the HTTP request URL. It is not
  15333. // settable as a field in the request body.
  15334. Region string `json:"region,omitempty"`
  15335. // SelfLink: [Output Only] Server-defined URL for the resource.
  15336. SelfLink string `json:"selfLink,omitempty"`
  15337. // StartTime: [Output Only] The time that this operation was started by
  15338. // the server. This value is in RFC3339 text format.
  15339. StartTime string `json:"startTime,omitempty"`
  15340. // Status: [Output Only] The status of the operation, which can be one
  15341. // of the following: PENDING, RUNNING, or DONE.
  15342. //
  15343. // Possible values:
  15344. // "DONE"
  15345. // "PENDING"
  15346. // "RUNNING"
  15347. Status string `json:"status,omitempty"`
  15348. // StatusMessage: [Output Only] An optional textual description of the
  15349. // current status of the operation.
  15350. StatusMessage string `json:"statusMessage,omitempty"`
  15351. // TargetId: [Output Only] The unique target ID, which identifies a
  15352. // specific incarnation of the target resource.
  15353. TargetId uint64 `json:"targetId,omitempty,string"`
  15354. // TargetLink: [Output Only] The URL of the resource that the operation
  15355. // modifies. For operations related to creating a snapshot, this points
  15356. // to the persistent disk that the snapshot was created from.
  15357. TargetLink string `json:"targetLink,omitempty"`
  15358. // User: [Output Only] User who requested the operation, for example:
  15359. // user@example.com.
  15360. User string `json:"user,omitempty"`
  15361. // Warnings: [Output Only] If warning messages are generated during
  15362. // processing of the operation, this field will be populated.
  15363. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  15364. // Zone: [Output Only] The URL of the zone where the operation resides.
  15365. // Only available when performing per-zone operations. You must specify
  15366. // this field as part of the HTTP request URL. It is not settable as a
  15367. // field in the request body.
  15368. Zone string `json:"zone,omitempty"`
  15369. // ServerResponse contains the HTTP response code and headers from the
  15370. // server.
  15371. googleapi.ServerResponse `json:"-"`
  15372. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  15373. // to unconditionally include in API requests. By default, fields with
  15374. // empty values are omitted from API requests. However, any non-pointer,
  15375. // non-interface field appearing in ForceSendFields will be sent to the
  15376. // server regardless of whether the field is empty or not. This may be
  15377. // used to include empty fields in Patch requests.
  15378. ForceSendFields []string `json:"-"`
  15379. // NullFields is a list of field names (e.g. "ClientOperationId") to
  15380. // include in API requests with the JSON null value. By default, fields
  15381. // with empty values are omitted from API requests. However, any field
  15382. // with an empty value appearing in NullFields will be sent to the
  15383. // server as null. It is an error if a field in this list has a
  15384. // non-empty value. This may be used to include null fields in Patch
  15385. // requests.
  15386. NullFields []string `json:"-"`
  15387. }
  15388. func (s *Operation) MarshalJSON() ([]byte, error) {
  15389. type NoMethod Operation
  15390. raw := NoMethod(*s)
  15391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15392. }
  15393. // OperationError: [Output Only] If errors are generated during
  15394. // processing of the operation, this field will be populated.
  15395. type OperationError struct {
  15396. // Errors: [Output Only] The array of errors encountered while
  15397. // processing this operation.
  15398. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  15399. // ForceSendFields is a list of field names (e.g. "Errors") to
  15400. // unconditionally include in API requests. By default, fields with
  15401. // empty values are omitted from API requests. However, any non-pointer,
  15402. // non-interface field appearing in ForceSendFields will be sent to the
  15403. // server regardless of whether the field is empty or not. This may be
  15404. // used to include empty fields in Patch requests.
  15405. ForceSendFields []string `json:"-"`
  15406. // NullFields is a list of field names (e.g. "Errors") to include in API
  15407. // requests with the JSON null value. By default, fields with empty
  15408. // values are omitted from API requests. However, any field with an
  15409. // empty value appearing in NullFields will be sent to the server as
  15410. // null. It is an error if a field in this list has a non-empty value.
  15411. // This may be used to include null fields in Patch requests.
  15412. NullFields []string `json:"-"`
  15413. }
  15414. func (s *OperationError) MarshalJSON() ([]byte, error) {
  15415. type NoMethod OperationError
  15416. raw := NoMethod(*s)
  15417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15418. }
  15419. type OperationErrorErrors struct {
  15420. // Code: [Output Only] The error type identifier for this error.
  15421. Code string `json:"code,omitempty"`
  15422. // Location: [Output Only] Indicates the field in the request that
  15423. // caused the error. This property is optional.
  15424. Location string `json:"location,omitempty"`
  15425. // Message: [Output Only] An optional, human-readable error message.
  15426. Message string `json:"message,omitempty"`
  15427. // ForceSendFields is a list of field names (e.g. "Code") to
  15428. // unconditionally include in API requests. By default, fields with
  15429. // empty values are omitted from API requests. However, any non-pointer,
  15430. // non-interface field appearing in ForceSendFields will be sent to the
  15431. // server regardless of whether the field is empty or not. This may be
  15432. // used to include empty fields in Patch requests.
  15433. ForceSendFields []string `json:"-"`
  15434. // NullFields is a list of field names (e.g. "Code") to include in API
  15435. // requests with the JSON null value. By default, fields with empty
  15436. // values are omitted from API requests. However, any field with an
  15437. // empty value appearing in NullFields will be sent to the server as
  15438. // null. It is an error if a field in this list has a non-empty value.
  15439. // This may be used to include null fields in Patch requests.
  15440. NullFields []string `json:"-"`
  15441. }
  15442. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  15443. type NoMethod OperationErrorErrors
  15444. raw := NoMethod(*s)
  15445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15446. }
  15447. type OperationWarnings struct {
  15448. // Code: [Output Only] A warning code, if applicable. For example,
  15449. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15450. // the response.
  15451. //
  15452. // Possible values:
  15453. // "CLEANUP_FAILED"
  15454. // "DEPRECATED_RESOURCE_USED"
  15455. // "DEPRECATED_TYPE_USED"
  15456. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15457. // "EXPERIMENTAL_TYPE_USED"
  15458. // "EXTERNAL_API_WARNING"
  15459. // "FIELD_VALUE_OVERRIDEN"
  15460. // "INJECTED_KERNELS_DEPRECATED"
  15461. // "MISSING_TYPE_DEPENDENCY"
  15462. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15463. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15464. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15465. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15466. // "NEXT_HOP_NOT_RUNNING"
  15467. // "NOT_CRITICAL_ERROR"
  15468. // "NO_RESULTS_ON_PAGE"
  15469. // "REQUIRED_TOS_AGREEMENT"
  15470. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15471. // "RESOURCE_NOT_DELETED"
  15472. // "SCHEMA_VALIDATION_IGNORED"
  15473. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15474. // "UNDECLARED_PROPERTIES"
  15475. // "UNREACHABLE"
  15476. Code string `json:"code,omitempty"`
  15477. // Data: [Output Only] Metadata about this warning in key: value format.
  15478. // For example:
  15479. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15480. Data []*OperationWarningsData `json:"data,omitempty"`
  15481. // Message: [Output Only] A human-readable description of the warning
  15482. // code.
  15483. Message string `json:"message,omitempty"`
  15484. // ForceSendFields is a list of field names (e.g. "Code") to
  15485. // unconditionally include in API requests. By default, fields with
  15486. // empty values are omitted from API requests. However, any non-pointer,
  15487. // non-interface field appearing in ForceSendFields will be sent to the
  15488. // server regardless of whether the field is empty or not. This may be
  15489. // used to include empty fields in Patch requests.
  15490. ForceSendFields []string `json:"-"`
  15491. // NullFields is a list of field names (e.g. "Code") to include in API
  15492. // requests with the JSON null value. By default, fields with empty
  15493. // values are omitted from API requests. However, any field with an
  15494. // empty value appearing in NullFields will be sent to the server as
  15495. // null. It is an error if a field in this list has a non-empty value.
  15496. // This may be used to include null fields in Patch requests.
  15497. NullFields []string `json:"-"`
  15498. }
  15499. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  15500. type NoMethod OperationWarnings
  15501. raw := NoMethod(*s)
  15502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15503. }
  15504. type OperationWarningsData struct {
  15505. // Key: [Output Only] A key that provides more detail on the warning
  15506. // being returned. For example, for warnings where there are no results
  15507. // in a list request for a particular zone, this key might be scope and
  15508. // the key value might be the zone name. Other examples might be a key
  15509. // indicating a deprecated resource and a suggested replacement, or a
  15510. // warning about invalid network settings (for example, if an instance
  15511. // attempts to perform IP forwarding but is not enabled for IP
  15512. // forwarding).
  15513. Key string `json:"key,omitempty"`
  15514. // Value: [Output Only] A warning data value corresponding to the key.
  15515. Value string `json:"value,omitempty"`
  15516. // ForceSendFields is a list of field names (e.g. "Key") to
  15517. // unconditionally include in API requests. By default, fields with
  15518. // empty values are omitted from API requests. However, any non-pointer,
  15519. // non-interface field appearing in ForceSendFields will be sent to the
  15520. // server regardless of whether the field is empty or not. This may be
  15521. // used to include empty fields in Patch requests.
  15522. ForceSendFields []string `json:"-"`
  15523. // NullFields is a list of field names (e.g. "Key") to include in API
  15524. // requests with the JSON null value. By default, fields with empty
  15525. // values are omitted from API requests. However, any field with an
  15526. // empty value appearing in NullFields will be sent to the server as
  15527. // null. It is an error if a field in this list has a non-empty value.
  15528. // This may be used to include null fields in Patch requests.
  15529. NullFields []string `json:"-"`
  15530. }
  15531. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  15532. type NoMethod OperationWarningsData
  15533. raw := NoMethod(*s)
  15534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15535. }
  15536. type OperationAggregatedList struct {
  15537. // Id: [Output Only] The unique identifier for the resource. This
  15538. // identifier is defined by the server.
  15539. Id string `json:"id,omitempty"`
  15540. // Items: [Output Only] A map of scoped operation lists.
  15541. Items map[string]OperationsScopedList `json:"items,omitempty"`
  15542. // Kind: [Output Only] Type of resource. Always
  15543. // compute#operationAggregatedList for aggregated lists of operations.
  15544. Kind string `json:"kind,omitempty"`
  15545. // NextPageToken: [Output Only] This token allows you to get the next
  15546. // page of results for list requests. If the number of results is larger
  15547. // than maxResults, use the nextPageToken as a value for the query
  15548. // parameter pageToken in the next list request. Subsequent list
  15549. // requests will have their own nextPageToken to continue paging through
  15550. // the results.
  15551. NextPageToken string `json:"nextPageToken,omitempty"`
  15552. // SelfLink: [Output Only] Server-defined URL for this resource.
  15553. SelfLink string `json:"selfLink,omitempty"`
  15554. // Warning: [Output Only] Informational warning message.
  15555. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  15556. // ServerResponse contains the HTTP response code and headers from the
  15557. // server.
  15558. googleapi.ServerResponse `json:"-"`
  15559. // ForceSendFields is a list of field names (e.g. "Id") to
  15560. // unconditionally include in API requests. By default, fields with
  15561. // empty values are omitted from API requests. However, any non-pointer,
  15562. // non-interface field appearing in ForceSendFields will be sent to the
  15563. // server regardless of whether the field is empty or not. This may be
  15564. // used to include empty fields in Patch requests.
  15565. ForceSendFields []string `json:"-"`
  15566. // NullFields is a list of field names (e.g. "Id") to include in API
  15567. // requests with the JSON null value. By default, fields with empty
  15568. // values are omitted from API requests. However, any field with an
  15569. // empty value appearing in NullFields will be sent to the server as
  15570. // null. It is an error if a field in this list has a non-empty value.
  15571. // This may be used to include null fields in Patch requests.
  15572. NullFields []string `json:"-"`
  15573. }
  15574. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  15575. type NoMethod OperationAggregatedList
  15576. raw := NoMethod(*s)
  15577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15578. }
  15579. // OperationAggregatedListWarning: [Output Only] Informational warning
  15580. // message.
  15581. type OperationAggregatedListWarning struct {
  15582. // Code: [Output Only] A warning code, if applicable. For example,
  15583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15584. // the response.
  15585. //
  15586. // Possible values:
  15587. // "CLEANUP_FAILED"
  15588. // "DEPRECATED_RESOURCE_USED"
  15589. // "DEPRECATED_TYPE_USED"
  15590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15591. // "EXPERIMENTAL_TYPE_USED"
  15592. // "EXTERNAL_API_WARNING"
  15593. // "FIELD_VALUE_OVERRIDEN"
  15594. // "INJECTED_KERNELS_DEPRECATED"
  15595. // "MISSING_TYPE_DEPENDENCY"
  15596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15600. // "NEXT_HOP_NOT_RUNNING"
  15601. // "NOT_CRITICAL_ERROR"
  15602. // "NO_RESULTS_ON_PAGE"
  15603. // "REQUIRED_TOS_AGREEMENT"
  15604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15605. // "RESOURCE_NOT_DELETED"
  15606. // "SCHEMA_VALIDATION_IGNORED"
  15607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15608. // "UNDECLARED_PROPERTIES"
  15609. // "UNREACHABLE"
  15610. Code string `json:"code,omitempty"`
  15611. // Data: [Output Only] Metadata about this warning in key: value format.
  15612. // For example:
  15613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15614. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  15615. // Message: [Output Only] A human-readable description of the warning
  15616. // code.
  15617. Message string `json:"message,omitempty"`
  15618. // ForceSendFields is a list of field names (e.g. "Code") to
  15619. // unconditionally include in API requests. By default, fields with
  15620. // empty values are omitted from API requests. However, any non-pointer,
  15621. // non-interface field appearing in ForceSendFields will be sent to the
  15622. // server regardless of whether the field is empty or not. This may be
  15623. // used to include empty fields in Patch requests.
  15624. ForceSendFields []string `json:"-"`
  15625. // NullFields is a list of field names (e.g. "Code") to include in API
  15626. // requests with the JSON null value. By default, fields with empty
  15627. // values are omitted from API requests. However, any field with an
  15628. // empty value appearing in NullFields will be sent to the server as
  15629. // null. It is an error if a field in this list has a non-empty value.
  15630. // This may be used to include null fields in Patch requests.
  15631. NullFields []string `json:"-"`
  15632. }
  15633. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15634. type NoMethod OperationAggregatedListWarning
  15635. raw := NoMethod(*s)
  15636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15637. }
  15638. type OperationAggregatedListWarningData struct {
  15639. // Key: [Output Only] A key that provides more detail on the warning
  15640. // being returned. For example, for warnings where there are no results
  15641. // in a list request for a particular zone, this key might be scope and
  15642. // the key value might be the zone name. Other examples might be a key
  15643. // indicating a deprecated resource and a suggested replacement, or a
  15644. // warning about invalid network settings (for example, if an instance
  15645. // attempts to perform IP forwarding but is not enabled for IP
  15646. // forwarding).
  15647. Key string `json:"key,omitempty"`
  15648. // Value: [Output Only] A warning data value corresponding to the key.
  15649. Value string `json:"value,omitempty"`
  15650. // ForceSendFields is a list of field names (e.g. "Key") to
  15651. // unconditionally include in API requests. By default, fields with
  15652. // empty values are omitted from API requests. However, any non-pointer,
  15653. // non-interface field appearing in ForceSendFields will be sent to the
  15654. // server regardless of whether the field is empty or not. This may be
  15655. // used to include empty fields in Patch requests.
  15656. ForceSendFields []string `json:"-"`
  15657. // NullFields is a list of field names (e.g. "Key") to include in API
  15658. // requests with the JSON null value. By default, fields with empty
  15659. // values are omitted from API requests. However, any field with an
  15660. // empty value appearing in NullFields will be sent to the server as
  15661. // null. It is an error if a field in this list has a non-empty value.
  15662. // This may be used to include null fields in Patch requests.
  15663. NullFields []string `json:"-"`
  15664. }
  15665. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15666. type NoMethod OperationAggregatedListWarningData
  15667. raw := NoMethod(*s)
  15668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15669. }
  15670. // OperationList: Contains a list of Operation resources.
  15671. type OperationList struct {
  15672. // Id: [Output Only] The unique identifier for the resource. This
  15673. // identifier is defined by the server.
  15674. Id string `json:"id,omitempty"`
  15675. // Items: [Output Only] A list of Operation resources.
  15676. Items []*Operation `json:"items,omitempty"`
  15677. // Kind: [Output Only] Type of resource. Always compute#operations for
  15678. // Operations resource.
  15679. Kind string `json:"kind,omitempty"`
  15680. // NextPageToken: [Output Only] This token allows you to get the next
  15681. // page of results for list requests. If the number of results is larger
  15682. // than maxResults, use the nextPageToken as a value for the query
  15683. // parameter pageToken in the next list request. Subsequent list
  15684. // requests will have their own nextPageToken to continue paging through
  15685. // the results.
  15686. NextPageToken string `json:"nextPageToken,omitempty"`
  15687. // SelfLink: [Output Only] Server-defined URL for this resource.
  15688. SelfLink string `json:"selfLink,omitempty"`
  15689. // Warning: [Output Only] Informational warning message.
  15690. Warning *OperationListWarning `json:"warning,omitempty"`
  15691. // ServerResponse contains the HTTP response code and headers from the
  15692. // server.
  15693. googleapi.ServerResponse `json:"-"`
  15694. // ForceSendFields is a list of field names (e.g. "Id") to
  15695. // unconditionally include in API requests. By default, fields with
  15696. // empty values are omitted from API requests. However, any non-pointer,
  15697. // non-interface field appearing in ForceSendFields will be sent to the
  15698. // server regardless of whether the field is empty or not. This may be
  15699. // used to include empty fields in Patch requests.
  15700. ForceSendFields []string `json:"-"`
  15701. // NullFields is a list of field names (e.g. "Id") to include in API
  15702. // requests with the JSON null value. By default, fields with empty
  15703. // values are omitted from API requests. However, any field with an
  15704. // empty value appearing in NullFields will be sent to the server as
  15705. // null. It is an error if a field in this list has a non-empty value.
  15706. // This may be used to include null fields in Patch requests.
  15707. NullFields []string `json:"-"`
  15708. }
  15709. func (s *OperationList) MarshalJSON() ([]byte, error) {
  15710. type NoMethod OperationList
  15711. raw := NoMethod(*s)
  15712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15713. }
  15714. // OperationListWarning: [Output Only] Informational warning message.
  15715. type OperationListWarning struct {
  15716. // Code: [Output Only] A warning code, if applicable. For example,
  15717. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15718. // the response.
  15719. //
  15720. // Possible values:
  15721. // "CLEANUP_FAILED"
  15722. // "DEPRECATED_RESOURCE_USED"
  15723. // "DEPRECATED_TYPE_USED"
  15724. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15725. // "EXPERIMENTAL_TYPE_USED"
  15726. // "EXTERNAL_API_WARNING"
  15727. // "FIELD_VALUE_OVERRIDEN"
  15728. // "INJECTED_KERNELS_DEPRECATED"
  15729. // "MISSING_TYPE_DEPENDENCY"
  15730. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15731. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15732. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15733. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15734. // "NEXT_HOP_NOT_RUNNING"
  15735. // "NOT_CRITICAL_ERROR"
  15736. // "NO_RESULTS_ON_PAGE"
  15737. // "REQUIRED_TOS_AGREEMENT"
  15738. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15739. // "RESOURCE_NOT_DELETED"
  15740. // "SCHEMA_VALIDATION_IGNORED"
  15741. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15742. // "UNDECLARED_PROPERTIES"
  15743. // "UNREACHABLE"
  15744. Code string `json:"code,omitempty"`
  15745. // Data: [Output Only] Metadata about this warning in key: value format.
  15746. // For example:
  15747. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15748. Data []*OperationListWarningData `json:"data,omitempty"`
  15749. // Message: [Output Only] A human-readable description of the warning
  15750. // code.
  15751. Message string `json:"message,omitempty"`
  15752. // ForceSendFields is a list of field names (e.g. "Code") to
  15753. // unconditionally include in API requests. By default, fields with
  15754. // empty values are omitted from API requests. However, any non-pointer,
  15755. // non-interface field appearing in ForceSendFields will be sent to the
  15756. // server regardless of whether the field is empty or not. This may be
  15757. // used to include empty fields in Patch requests.
  15758. ForceSendFields []string `json:"-"`
  15759. // NullFields is a list of field names (e.g. "Code") to include in API
  15760. // requests with the JSON null value. By default, fields with empty
  15761. // values are omitted from API requests. However, any field with an
  15762. // empty value appearing in NullFields will be sent to the server as
  15763. // null. It is an error if a field in this list has a non-empty value.
  15764. // This may be used to include null fields in Patch requests.
  15765. NullFields []string `json:"-"`
  15766. }
  15767. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  15768. type NoMethod OperationListWarning
  15769. raw := NoMethod(*s)
  15770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15771. }
  15772. type OperationListWarningData struct {
  15773. // Key: [Output Only] A key that provides more detail on the warning
  15774. // being returned. For example, for warnings where there are no results
  15775. // in a list request for a particular zone, this key might be scope and
  15776. // the key value might be the zone name. Other examples might be a key
  15777. // indicating a deprecated resource and a suggested replacement, or a
  15778. // warning about invalid network settings (for example, if an instance
  15779. // attempts to perform IP forwarding but is not enabled for IP
  15780. // forwarding).
  15781. Key string `json:"key,omitempty"`
  15782. // Value: [Output Only] A warning data value corresponding to the key.
  15783. Value string `json:"value,omitempty"`
  15784. // ForceSendFields is a list of field names (e.g. "Key") to
  15785. // unconditionally include in API requests. By default, fields with
  15786. // empty values are omitted from API requests. However, any non-pointer,
  15787. // non-interface field appearing in ForceSendFields will be sent to the
  15788. // server regardless of whether the field is empty or not. This may be
  15789. // used to include empty fields in Patch requests.
  15790. ForceSendFields []string `json:"-"`
  15791. // NullFields is a list of field names (e.g. "Key") to include in API
  15792. // requests with the JSON null value. By default, fields with empty
  15793. // values are omitted from API requests. However, any field with an
  15794. // empty value appearing in NullFields will be sent to the server as
  15795. // null. It is an error if a field in this list has a non-empty value.
  15796. // This may be used to include null fields in Patch requests.
  15797. NullFields []string `json:"-"`
  15798. }
  15799. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  15800. type NoMethod OperationListWarningData
  15801. raw := NoMethod(*s)
  15802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15803. }
  15804. type OperationsScopedList struct {
  15805. // Operations: [Output Only] A list of operations contained in this
  15806. // scope.
  15807. Operations []*Operation `json:"operations,omitempty"`
  15808. // Warning: [Output Only] Informational warning which replaces the list
  15809. // of operations when the list is empty.
  15810. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  15811. // ForceSendFields is a list of field names (e.g. "Operations") to
  15812. // unconditionally include in API requests. By default, fields with
  15813. // empty values are omitted from API requests. However, any non-pointer,
  15814. // non-interface field appearing in ForceSendFields will be sent to the
  15815. // server regardless of whether the field is empty or not. This may be
  15816. // used to include empty fields in Patch requests.
  15817. ForceSendFields []string `json:"-"`
  15818. // NullFields is a list of field names (e.g. "Operations") to include in
  15819. // API requests with the JSON null value. By default, fields with empty
  15820. // values are omitted from API requests. However, any field with an
  15821. // empty value appearing in NullFields will be sent to the server as
  15822. // null. It is an error if a field in this list has a non-empty value.
  15823. // This may be used to include null fields in Patch requests.
  15824. NullFields []string `json:"-"`
  15825. }
  15826. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  15827. type NoMethod OperationsScopedList
  15828. raw := NoMethod(*s)
  15829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15830. }
  15831. // OperationsScopedListWarning: [Output Only] Informational warning
  15832. // which replaces the list of operations when the list is empty.
  15833. type OperationsScopedListWarning struct {
  15834. // Code: [Output Only] A warning code, if applicable. For example,
  15835. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15836. // the response.
  15837. //
  15838. // Possible values:
  15839. // "CLEANUP_FAILED"
  15840. // "DEPRECATED_RESOURCE_USED"
  15841. // "DEPRECATED_TYPE_USED"
  15842. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15843. // "EXPERIMENTAL_TYPE_USED"
  15844. // "EXTERNAL_API_WARNING"
  15845. // "FIELD_VALUE_OVERRIDEN"
  15846. // "INJECTED_KERNELS_DEPRECATED"
  15847. // "MISSING_TYPE_DEPENDENCY"
  15848. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15849. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15850. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15851. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15852. // "NEXT_HOP_NOT_RUNNING"
  15853. // "NOT_CRITICAL_ERROR"
  15854. // "NO_RESULTS_ON_PAGE"
  15855. // "REQUIRED_TOS_AGREEMENT"
  15856. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15857. // "RESOURCE_NOT_DELETED"
  15858. // "SCHEMA_VALIDATION_IGNORED"
  15859. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15860. // "UNDECLARED_PROPERTIES"
  15861. // "UNREACHABLE"
  15862. Code string `json:"code,omitempty"`
  15863. // Data: [Output Only] Metadata about this warning in key: value format.
  15864. // For example:
  15865. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15866. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  15867. // Message: [Output Only] A human-readable description of the warning
  15868. // code.
  15869. Message string `json:"message,omitempty"`
  15870. // ForceSendFields is a list of field names (e.g. "Code") to
  15871. // unconditionally include in API requests. By default, fields with
  15872. // empty values are omitted from API requests. However, any non-pointer,
  15873. // non-interface field appearing in ForceSendFields will be sent to the
  15874. // server regardless of whether the field is empty or not. This may be
  15875. // used to include empty fields in Patch requests.
  15876. ForceSendFields []string `json:"-"`
  15877. // NullFields is a list of field names (e.g. "Code") to include in API
  15878. // requests with the JSON null value. By default, fields with empty
  15879. // values are omitted from API requests. However, any field with an
  15880. // empty value appearing in NullFields will be sent to the server as
  15881. // null. It is an error if a field in this list has a non-empty value.
  15882. // This may be used to include null fields in Patch requests.
  15883. NullFields []string `json:"-"`
  15884. }
  15885. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  15886. type NoMethod OperationsScopedListWarning
  15887. raw := NoMethod(*s)
  15888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15889. }
  15890. type OperationsScopedListWarningData struct {
  15891. // Key: [Output Only] A key that provides more detail on the warning
  15892. // being returned. For example, for warnings where there are no results
  15893. // in a list request for a particular zone, this key might be scope and
  15894. // the key value might be the zone name. Other examples might be a key
  15895. // indicating a deprecated resource and a suggested replacement, or a
  15896. // warning about invalid network settings (for example, if an instance
  15897. // attempts to perform IP forwarding but is not enabled for IP
  15898. // forwarding).
  15899. Key string `json:"key,omitempty"`
  15900. // Value: [Output Only] A warning data value corresponding to the key.
  15901. Value string `json:"value,omitempty"`
  15902. // ForceSendFields is a list of field names (e.g. "Key") to
  15903. // unconditionally include in API requests. By default, fields with
  15904. // empty values are omitted from API requests. However, any non-pointer,
  15905. // non-interface field appearing in ForceSendFields will be sent to the
  15906. // server regardless of whether the field is empty or not. This may be
  15907. // used to include empty fields in Patch requests.
  15908. ForceSendFields []string `json:"-"`
  15909. // NullFields is a list of field names (e.g. "Key") to include in API
  15910. // requests with the JSON null value. By default, fields with empty
  15911. // values are omitted from API requests. However, any field with an
  15912. // empty value appearing in NullFields will be sent to the server as
  15913. // null. It is an error if a field in this list has a non-empty value.
  15914. // This may be used to include null fields in Patch requests.
  15915. NullFields []string `json:"-"`
  15916. }
  15917. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  15918. type NoMethod OperationsScopedListWarningData
  15919. raw := NoMethod(*s)
  15920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15921. }
  15922. // PathMatcher: A matcher for the path portion of the URL. The
  15923. // BackendService from the longest-matched rule will serve the URL. If
  15924. // no rule was matched, the default service will be used.
  15925. type PathMatcher struct {
  15926. // DefaultService: The full or partial URL to the BackendService
  15927. // resource. This will be used if none of the pathRules or routeRules
  15928. // defined by this PathMatcher are matched. For example, the following
  15929. // are all valid URLs to a BackendService resource:
  15930. // -
  15931. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  15932. // - compute/v1/projects/project/global/backendServices/backendService
  15933. //
  15934. // - global/backendServices/backendService
  15935. // Use defaultService instead of defaultRouteAction when simple routing
  15936. // to a backend service is desired and other advanced capabilities like
  15937. // traffic splitting and URL rewrites are not required.
  15938. // Only one of defaultService, defaultRouteAction or defaultUrlRedirect
  15939. // must be set.
  15940. // Authorization requires one or more of the following Google IAM
  15941. // permissions on the specified resource default_service:
  15942. // - compute.backendBuckets.use
  15943. // - compute.backendServices.use
  15944. DefaultService string `json:"defaultService,omitempty"`
  15945. // Description: An optional description of this resource. Provide this
  15946. // property when you create the resource.
  15947. Description string `json:"description,omitempty"`
  15948. // Name: The name to which this PathMatcher is referred by the HostRule.
  15949. Name string `json:"name,omitempty"`
  15950. // PathRules: The list of path rules. Use this list instead of
  15951. // routeRules when routing based on simple path matching is all that's
  15952. // required. The order by which path rules are specified does not
  15953. // matter. Matches are always done on the longest-path-first basis.
  15954. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  15955. // irrespective of the order in which those paths appear in this
  15956. // list.
  15957. // Only one of pathRules or routeRules must be set.
  15958. PathRules []*PathRule `json:"pathRules,omitempty"`
  15959. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  15960. // unconditionally include in API requests. By default, fields with
  15961. // empty values are omitted from API requests. However, any non-pointer,
  15962. // non-interface field appearing in ForceSendFields will be sent to the
  15963. // server regardless of whether the field is empty or not. This may be
  15964. // used to include empty fields in Patch requests.
  15965. ForceSendFields []string `json:"-"`
  15966. // NullFields is a list of field names (e.g. "DefaultService") to
  15967. // include in API requests with the JSON null value. By default, fields
  15968. // with empty values are omitted from API requests. However, any field
  15969. // with an empty value appearing in NullFields will be sent to the
  15970. // server as null. It is an error if a field in this list has a
  15971. // non-empty value. This may be used to include null fields in Patch
  15972. // requests.
  15973. NullFields []string `json:"-"`
  15974. }
  15975. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  15976. type NoMethod PathMatcher
  15977. raw := NoMethod(*s)
  15978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15979. }
  15980. // PathRule: A path-matching rule for a URL. If matched, will use the
  15981. // specified BackendService to handle the traffic arriving at this URL.
  15982. type PathRule struct {
  15983. // Paths: The list of path patterns to match. Each must start with / and
  15984. // the only place a * is allowed is at the end following a /. The string
  15985. // fed to the path matcher does not include any text after the first ?
  15986. // or #, and those chars are not allowed here.
  15987. Paths []string `json:"paths,omitempty"`
  15988. // Service: The URL of the backend service resource if this rule is
  15989. // matched.
  15990. // Use service instead of routeAction when simple routing to a backend
  15991. // service is desired and other advanced capabilities like traffic
  15992. // splitting and rewrites are not required.
  15993. // Only one of service, routeAction or urlRedirect should must be set.
  15994. Service string `json:"service,omitempty"`
  15995. // ForceSendFields is a list of field names (e.g. "Paths") to
  15996. // unconditionally include in API requests. By default, fields with
  15997. // empty values are omitted from API requests. However, any non-pointer,
  15998. // non-interface field appearing in ForceSendFields will be sent to the
  15999. // server regardless of whether the field is empty or not. This may be
  16000. // used to include empty fields in Patch requests.
  16001. ForceSendFields []string `json:"-"`
  16002. // NullFields is a list of field names (e.g. "Paths") to include in API
  16003. // requests with the JSON null value. By default, fields with empty
  16004. // values are omitted from API requests. However, any field with an
  16005. // empty value appearing in NullFields will be sent to the server as
  16006. // null. It is an error if a field in this list has a non-empty value.
  16007. // This may be used to include null fields in Patch requests.
  16008. NullFields []string `json:"-"`
  16009. }
  16010. func (s *PathRule) MarshalJSON() ([]byte, error) {
  16011. type NoMethod PathRule
  16012. raw := NoMethod(*s)
  16013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16014. }
  16015. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  16016. // used to specify access control policies for Cloud Platform
  16017. // resources.
  16018. //
  16019. //
  16020. //
  16021. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  16022. // of `members` to a `role`, where the members can be user accounts,
  16023. // Google groups, Google domains, and service accounts. A `role` is a
  16024. // named list of permissions defined by IAM.
  16025. //
  16026. // **JSON Example**
  16027. //
  16028. // { "bindings": [ { "role": "roles/owner", "members": [
  16029. // "user:mike@example.com", "group:admins@example.com",
  16030. // "domain:google.com",
  16031. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  16032. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  16033. // }
  16034. //
  16035. // **YAML Example**
  16036. //
  16037. // bindings: - members: - user:mike@example.com -
  16038. // group:admins@example.com - domain:google.com -
  16039. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  16040. // roles/owner - members: - user:sean@example.com role:
  16041. // roles/viewer
  16042. //
  16043. //
  16044. //
  16045. // For a description of IAM and its features, see the [IAM developer's
  16046. // guide](https://cloud.google.com/iam/docs).
  16047. type Policy struct {
  16048. // AuditConfigs: Specifies cloud audit logging configuration for this
  16049. // policy.
  16050. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  16051. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  16052. // no members will result in an error.
  16053. Bindings []*Binding `json:"bindings,omitempty"`
  16054. // Etag: `etag` is used for optimistic concurrency control as a way to
  16055. // help prevent simultaneous updates of a policy from overwriting each
  16056. // other. It is strongly suggested that systems make use of the `etag`
  16057. // in the read-modify-write cycle to perform policy updates in order to
  16058. // avoid race conditions: An `etag` is returned in the response to
  16059. // `getIamPolicy`, and systems are expected to put that etag in the
  16060. // request to `setIamPolicy` to ensure that their change will be applied
  16061. // to the same version of the policy.
  16062. //
  16063. // If no `etag` is provided in the call to `setIamPolicy`, then the
  16064. // existing policy is overwritten blindly.
  16065. Etag string `json:"etag,omitempty"`
  16066. IamOwned bool `json:"iamOwned,omitempty"`
  16067. // Rules: If more than one rule is specified, the rules are applied in
  16068. // the following manner: - All matching LOG rules are always applied. -
  16069. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  16070. // will be applied if one or more matching rule requires logging. -
  16071. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  16072. // granted. Logging will be applied if one or more matching rule
  16073. // requires logging. - Otherwise, if no rule applies, permission is
  16074. // denied.
  16075. Rules []*Rule `json:"rules,omitempty"`
  16076. // Version: Deprecated.
  16077. Version int64 `json:"version,omitempty"`
  16078. // ServerResponse contains the HTTP response code and headers from the
  16079. // server.
  16080. googleapi.ServerResponse `json:"-"`
  16081. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  16082. // unconditionally include in API requests. By default, fields with
  16083. // empty values are omitted from API requests. However, any non-pointer,
  16084. // non-interface field appearing in ForceSendFields will be sent to the
  16085. // server regardless of whether the field is empty or not. This may be
  16086. // used to include empty fields in Patch requests.
  16087. ForceSendFields []string `json:"-"`
  16088. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  16089. // in API requests with the JSON null value. By default, fields with
  16090. // empty values are omitted from API requests. However, any field with
  16091. // an empty value appearing in NullFields will be sent to the server as
  16092. // null. It is an error if a field in this list has a non-empty value.
  16093. // This may be used to include null fields in Patch requests.
  16094. NullFields []string `json:"-"`
  16095. }
  16096. func (s *Policy) MarshalJSON() ([]byte, error) {
  16097. type NoMethod Policy
  16098. raw := NoMethod(*s)
  16099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16100. }
  16101. // Project: A Project resource. For an overview of projects, see Cloud
  16102. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  16103. // resource_for beta.projects ==)
  16104. type Project struct {
  16105. // CommonInstanceMetadata: Metadata key/value pairs available to all
  16106. // instances contained in this project. See Custom metadata for more
  16107. // information.
  16108. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  16109. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16110. // format.
  16111. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16112. // DefaultNetworkTier: This signifies the default network tier used for
  16113. // configuring resources of the project and can only take the following
  16114. // values: PREMIUM, STANDARD. Initially the default network tier is
  16115. // PREMIUM.
  16116. //
  16117. // Possible values:
  16118. // "PREMIUM"
  16119. // "STANDARD"
  16120. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  16121. // DefaultServiceAccount: [Output Only] Default service account used by
  16122. // VMs running in this project.
  16123. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  16124. // Description: An optional textual description of the resource.
  16125. Description string `json:"description,omitempty"`
  16126. // EnabledFeatures: Restricted features enabled for use on this project.
  16127. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  16128. // Id: [Output Only] The unique identifier for the resource. This
  16129. // identifier is defined by the server. This is not the project ID, and
  16130. // is just a unique ID used by Compute Engine to identify resources.
  16131. Id uint64 `json:"id,omitempty,string"`
  16132. // Kind: [Output Only] Type of the resource. Always compute#project for
  16133. // projects.
  16134. Kind string `json:"kind,omitempty"`
  16135. // Name: The project ID. For example: my-example-project. Use the
  16136. // project ID to make requests to Compute Engine.
  16137. Name string `json:"name,omitempty"`
  16138. // Quotas: [Output Only] Quotas assigned to this project.
  16139. Quotas []*Quota `json:"quotas,omitempty"`
  16140. // SelfLink: [Output Only] Server-defined URL for the resource.
  16141. SelfLink string `json:"selfLink,omitempty"`
  16142. // UsageExportLocation: The naming prefix for daily usage reports and
  16143. // the Google Cloud Storage bucket where they are stored.
  16144. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  16145. // XpnProjectStatus: [Output Only] The role this project has in a shared
  16146. // VPC configuration. Currently only HOST projects are differentiated.
  16147. //
  16148. // Possible values:
  16149. // "HOST"
  16150. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  16151. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  16152. // ServerResponse contains the HTTP response code and headers from the
  16153. // server.
  16154. googleapi.ServerResponse `json:"-"`
  16155. // ForceSendFields is a list of field names (e.g.
  16156. // "CommonInstanceMetadata") to unconditionally include in API requests.
  16157. // By default, fields with empty values are omitted from API requests.
  16158. // However, any non-pointer, non-interface field appearing in
  16159. // ForceSendFields will be sent to the server regardless of whether the
  16160. // field is empty or not. This may be used to include empty fields in
  16161. // Patch requests.
  16162. ForceSendFields []string `json:"-"`
  16163. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  16164. // to include in API requests with the JSON null value. By default,
  16165. // fields with empty values are omitted from API requests. However, any
  16166. // field with an empty value appearing in NullFields will be sent to the
  16167. // server as null. It is an error if a field in this list has a
  16168. // non-empty value. This may be used to include null fields in Patch
  16169. // requests.
  16170. NullFields []string `json:"-"`
  16171. }
  16172. func (s *Project) MarshalJSON() ([]byte, error) {
  16173. type NoMethod Project
  16174. raw := NoMethod(*s)
  16175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16176. }
  16177. type ProjectsDisableXpnResourceRequest struct {
  16178. // XpnResource: Service resource (a.k.a service project) ID.
  16179. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  16180. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  16181. // unconditionally include in API requests. By default, fields with
  16182. // empty values are omitted from API requests. However, any non-pointer,
  16183. // non-interface field appearing in ForceSendFields will be sent to the
  16184. // server regardless of whether the field is empty or not. This may be
  16185. // used to include empty fields in Patch requests.
  16186. ForceSendFields []string `json:"-"`
  16187. // NullFields is a list of field names (e.g. "XpnResource") to include
  16188. // in API requests with the JSON null value. By default, fields with
  16189. // empty values are omitted from API requests. However, any field with
  16190. // an empty value appearing in NullFields will be sent to the server as
  16191. // null. It is an error if a field in this list has a non-empty value.
  16192. // This may be used to include null fields in Patch requests.
  16193. NullFields []string `json:"-"`
  16194. }
  16195. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  16196. type NoMethod ProjectsDisableXpnResourceRequest
  16197. raw := NoMethod(*s)
  16198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16199. }
  16200. type ProjectsEnableXpnResourceRequest struct {
  16201. // XpnResource: Service resource (a.k.a service project) ID.
  16202. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  16203. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  16204. // unconditionally include in API requests. By default, fields with
  16205. // empty values are omitted from API requests. However, any non-pointer,
  16206. // non-interface field appearing in ForceSendFields will be sent to the
  16207. // server regardless of whether the field is empty or not. This may be
  16208. // used to include empty fields in Patch requests.
  16209. ForceSendFields []string `json:"-"`
  16210. // NullFields is a list of field names (e.g. "XpnResource") to include
  16211. // in API requests with the JSON null value. By default, fields with
  16212. // empty values are omitted from API requests. However, any field with
  16213. // an empty value appearing in NullFields will be sent to the server as
  16214. // null. It is an error if a field in this list has a non-empty value.
  16215. // This may be used to include null fields in Patch requests.
  16216. NullFields []string `json:"-"`
  16217. }
  16218. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  16219. type NoMethod ProjectsEnableXpnResourceRequest
  16220. raw := NoMethod(*s)
  16221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16222. }
  16223. type ProjectsGetXpnResources struct {
  16224. // Kind: [Output Only] Type of resource. Always
  16225. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  16226. // service projects)
  16227. Kind string `json:"kind,omitempty"`
  16228. // NextPageToken: [Output Only] This token allows you to get the next
  16229. // page of results for list requests. If the number of results is larger
  16230. // than maxResults, use the nextPageToken as a value for the query
  16231. // parameter pageToken in the next list request. Subsequent list
  16232. // requests will have their own nextPageToken to continue paging through
  16233. // the results.
  16234. NextPageToken string `json:"nextPageToken,omitempty"`
  16235. // Resources: Service resources (a.k.a service projects) attached to
  16236. // this project as their shared VPC host.
  16237. Resources []*XpnResourceId `json:"resources,omitempty"`
  16238. // ServerResponse contains the HTTP response code and headers from the
  16239. // server.
  16240. googleapi.ServerResponse `json:"-"`
  16241. // ForceSendFields is a list of field names (e.g. "Kind") to
  16242. // unconditionally include in API requests. By default, fields with
  16243. // empty values are omitted from API requests. However, any non-pointer,
  16244. // non-interface field appearing in ForceSendFields will be sent to the
  16245. // server regardless of whether the field is empty or not. This may be
  16246. // used to include empty fields in Patch requests.
  16247. ForceSendFields []string `json:"-"`
  16248. // NullFields is a list of field names (e.g. "Kind") to include in API
  16249. // requests with the JSON null value. By default, fields with empty
  16250. // values are omitted from API requests. However, any field with an
  16251. // empty value appearing in NullFields will be sent to the server as
  16252. // null. It is an error if a field in this list has a non-empty value.
  16253. // This may be used to include null fields in Patch requests.
  16254. NullFields []string `json:"-"`
  16255. }
  16256. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  16257. type NoMethod ProjectsGetXpnResources
  16258. raw := NoMethod(*s)
  16259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16260. }
  16261. type ProjectsListXpnHostsRequest struct {
  16262. // Organization: Optional organization ID managed by Cloud Resource
  16263. // Manager, for which to list shared VPC host projects. If not
  16264. // specified, the organization will be inferred from the project.
  16265. Organization string `json:"organization,omitempty"`
  16266. // ForceSendFields is a list of field names (e.g. "Organization") to
  16267. // unconditionally include in API requests. By default, fields with
  16268. // empty values are omitted from API requests. However, any non-pointer,
  16269. // non-interface field appearing in ForceSendFields will be sent to the
  16270. // server regardless of whether the field is empty or not. This may be
  16271. // used to include empty fields in Patch requests.
  16272. ForceSendFields []string `json:"-"`
  16273. // NullFields is a list of field names (e.g. "Organization") to include
  16274. // in API requests with the JSON null value. By default, fields with
  16275. // empty values are omitted from API requests. However, any field with
  16276. // an empty value appearing in NullFields will be sent to the server as
  16277. // null. It is an error if a field in this list has a non-empty value.
  16278. // This may be used to include null fields in Patch requests.
  16279. NullFields []string `json:"-"`
  16280. }
  16281. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  16282. type NoMethod ProjectsListXpnHostsRequest
  16283. raw := NoMethod(*s)
  16284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16285. }
  16286. type ProjectsSetDefaultNetworkTierRequest struct {
  16287. // NetworkTier: Default network tier to be set.
  16288. //
  16289. // Possible values:
  16290. // "PREMIUM"
  16291. // "STANDARD"
  16292. NetworkTier string `json:"networkTier,omitempty"`
  16293. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  16294. // unconditionally include in API requests. By default, fields with
  16295. // empty values are omitted from API requests. However, any non-pointer,
  16296. // non-interface field appearing in ForceSendFields will be sent to the
  16297. // server regardless of whether the field is empty or not. This may be
  16298. // used to include empty fields in Patch requests.
  16299. ForceSendFields []string `json:"-"`
  16300. // NullFields is a list of field names (e.g. "NetworkTier") to include
  16301. // in API requests with the JSON null value. By default, fields with
  16302. // empty values are omitted from API requests. However, any field with
  16303. // an empty value appearing in NullFields will be sent to the server as
  16304. // null. It is an error if a field in this list has a non-empty value.
  16305. // This may be used to include null fields in Patch requests.
  16306. NullFields []string `json:"-"`
  16307. }
  16308. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  16309. type NoMethod ProjectsSetDefaultNetworkTierRequest
  16310. raw := NoMethod(*s)
  16311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16312. }
  16313. // Quota: A quotas entry.
  16314. type Quota struct {
  16315. // Limit: [Output Only] Quota limit for this metric.
  16316. Limit float64 `json:"limit,omitempty"`
  16317. // Metric: [Output Only] Name of the quota metric.
  16318. //
  16319. // Possible values:
  16320. // "AUTOSCALERS"
  16321. // "BACKEND_BUCKETS"
  16322. // "BACKEND_SERVICES"
  16323. // "COMMITMENTS"
  16324. // "CPUS"
  16325. // "CPUS_ALL_REGIONS"
  16326. // "DISKS_TOTAL_GB"
  16327. // "FIREWALLS"
  16328. // "FORWARDING_RULES"
  16329. // "GLOBAL_INTERNAL_ADDRESSES"
  16330. // "GPUS_ALL_REGIONS"
  16331. // "HEALTH_CHECKS"
  16332. // "IMAGES"
  16333. // "INSTANCES"
  16334. // "INSTANCE_GROUPS"
  16335. // "INSTANCE_GROUP_MANAGERS"
  16336. // "INSTANCE_TEMPLATES"
  16337. // "INTERCONNECTS"
  16338. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  16339. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  16340. // "INTERNAL_ADDRESSES"
  16341. // "IN_USE_ADDRESSES"
  16342. // "IN_USE_BACKUP_SCHEDULES"
  16343. // "LOCAL_SSD_TOTAL_GB"
  16344. // "NETWORKS"
  16345. // "NVIDIA_K80_GPUS"
  16346. // "NVIDIA_P100_GPUS"
  16347. // "NVIDIA_P100_VWS_GPUS"
  16348. // "NVIDIA_P4_GPUS"
  16349. // "NVIDIA_P4_VWS_GPUS"
  16350. // "NVIDIA_T4_GPUS"
  16351. // "NVIDIA_T4_VWS_GPUS"
  16352. // "NVIDIA_V100_GPUS"
  16353. // "PREEMPTIBLE_CPUS"
  16354. // "PREEMPTIBLE_LOCAL_SSD_GB"
  16355. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  16356. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  16357. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  16358. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  16359. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  16360. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  16361. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  16362. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  16363. // "REGIONAL_AUTOSCALERS"
  16364. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  16365. // "RESOURCE_POLICIES"
  16366. // "ROUTERS"
  16367. // "ROUTES"
  16368. // "SECURITY_POLICIES"
  16369. // "SECURITY_POLICY_RULES"
  16370. // "SNAPSHOTS"
  16371. // "SSD_TOTAL_GB"
  16372. // "SSL_CERTIFICATES"
  16373. // "STATIC_ADDRESSES"
  16374. // "SUBNETWORKS"
  16375. // "TARGET_HTTPS_PROXIES"
  16376. // "TARGET_HTTP_PROXIES"
  16377. // "TARGET_INSTANCES"
  16378. // "TARGET_POOLS"
  16379. // "TARGET_SSL_PROXIES"
  16380. // "TARGET_TCP_PROXIES"
  16381. // "TARGET_VPN_GATEWAYS"
  16382. // "URL_MAPS"
  16383. // "VPN_GATEWAYS"
  16384. // "VPN_TUNNELS"
  16385. Metric string `json:"metric,omitempty"`
  16386. // Usage: [Output Only] Current usage of this metric.
  16387. Usage float64 `json:"usage,omitempty"`
  16388. // ForceSendFields is a list of field names (e.g. "Limit") to
  16389. // unconditionally include in API requests. By default, fields with
  16390. // empty values are omitted from API requests. However, any non-pointer,
  16391. // non-interface field appearing in ForceSendFields will be sent to the
  16392. // server regardless of whether the field is empty or not. This may be
  16393. // used to include empty fields in Patch requests.
  16394. ForceSendFields []string `json:"-"`
  16395. // NullFields is a list of field names (e.g. "Limit") to include in API
  16396. // requests with the JSON null value. By default, fields with empty
  16397. // values are omitted from API requests. However, any field with an
  16398. // empty value appearing in NullFields will be sent to the server as
  16399. // null. It is an error if a field in this list has a non-empty value.
  16400. // This may be used to include null fields in Patch requests.
  16401. NullFields []string `json:"-"`
  16402. }
  16403. func (s *Quota) MarshalJSON() ([]byte, error) {
  16404. type NoMethod Quota
  16405. raw := NoMethod(*s)
  16406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16407. }
  16408. func (s *Quota) UnmarshalJSON(data []byte) error {
  16409. type NoMethod Quota
  16410. var s1 struct {
  16411. Limit gensupport.JSONFloat64 `json:"limit"`
  16412. Usage gensupport.JSONFloat64 `json:"usage"`
  16413. *NoMethod
  16414. }
  16415. s1.NoMethod = (*NoMethod)(s)
  16416. if err := json.Unmarshal(data, &s1); err != nil {
  16417. return err
  16418. }
  16419. s.Limit = float64(s1.Limit)
  16420. s.Usage = float64(s1.Usage)
  16421. return nil
  16422. }
  16423. // Reference: Represents a reference to a resource.
  16424. type Reference struct {
  16425. // Kind: [Output Only] Type of the resource. Always compute#reference
  16426. // for references.
  16427. Kind string `json:"kind,omitempty"`
  16428. // ReferenceType: A description of the reference type with no implied
  16429. // semantics. Possible values include:
  16430. // - MEMBER_OF
  16431. ReferenceType string `json:"referenceType,omitempty"`
  16432. // Referrer: URL of the resource which refers to the target.
  16433. Referrer string `json:"referrer,omitempty"`
  16434. // Target: URL of the resource to which this reference points.
  16435. Target string `json:"target,omitempty"`
  16436. // ForceSendFields is a list of field names (e.g. "Kind") to
  16437. // unconditionally include in API requests. By default, fields with
  16438. // empty values are omitted from API requests. However, any non-pointer,
  16439. // non-interface field appearing in ForceSendFields will be sent to the
  16440. // server regardless of whether the field is empty or not. This may be
  16441. // used to include empty fields in Patch requests.
  16442. ForceSendFields []string `json:"-"`
  16443. // NullFields is a list of field names (e.g. "Kind") to include in API
  16444. // requests with the JSON null value. By default, fields with empty
  16445. // values are omitted from API requests. However, any field with an
  16446. // empty value appearing in NullFields will be sent to the server as
  16447. // null. It is an error if a field in this list has a non-empty value.
  16448. // This may be used to include null fields in Patch requests.
  16449. NullFields []string `json:"-"`
  16450. }
  16451. func (s *Reference) MarshalJSON() ([]byte, error) {
  16452. type NoMethod Reference
  16453. raw := NoMethod(*s)
  16454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16455. }
  16456. // Region: Region resource. (== resource_for beta.regions ==) (==
  16457. // resource_for v1.regions ==)
  16458. type Region struct {
  16459. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16460. // format.
  16461. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16462. // Deprecated: [Output Only] The deprecation status associated with this
  16463. // region.
  16464. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  16465. // Description: [Output Only] Textual description of the resource.
  16466. Description string `json:"description,omitempty"`
  16467. // Id: [Output Only] The unique identifier for the resource. This
  16468. // identifier is defined by the server.
  16469. Id uint64 `json:"id,omitempty,string"`
  16470. // Kind: [Output Only] Type of the resource. Always compute#region for
  16471. // regions.
  16472. Kind string `json:"kind,omitempty"`
  16473. // Name: [Output Only] Name of the resource.
  16474. Name string `json:"name,omitempty"`
  16475. // Quotas: [Output Only] Quotas assigned to this region.
  16476. Quotas []*Quota `json:"quotas,omitempty"`
  16477. // SelfLink: [Output Only] Server-defined URL for the resource.
  16478. SelfLink string `json:"selfLink,omitempty"`
  16479. // Status: [Output Only] Status of the region, either UP or DOWN.
  16480. //
  16481. // Possible values:
  16482. // "DOWN"
  16483. // "UP"
  16484. Status string `json:"status,omitempty"`
  16485. // Zones: [Output Only] A list of zones available in this region, in the
  16486. // form of resource URLs.
  16487. Zones []string `json:"zones,omitempty"`
  16488. // ServerResponse contains the HTTP response code and headers from the
  16489. // server.
  16490. googleapi.ServerResponse `json:"-"`
  16491. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16492. // to unconditionally include in API requests. By default, fields with
  16493. // empty values are omitted from API requests. However, any non-pointer,
  16494. // non-interface field appearing in ForceSendFields will be sent to the
  16495. // server regardless of whether the field is empty or not. This may be
  16496. // used to include empty fields in Patch requests.
  16497. ForceSendFields []string `json:"-"`
  16498. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16499. // include in API requests with the JSON null value. By default, fields
  16500. // with empty values are omitted from API requests. However, any field
  16501. // with an empty value appearing in NullFields will be sent to the
  16502. // server as null. It is an error if a field in this list has a
  16503. // non-empty value. This may be used to include null fields in Patch
  16504. // requests.
  16505. NullFields []string `json:"-"`
  16506. }
  16507. func (s *Region) MarshalJSON() ([]byte, error) {
  16508. type NoMethod Region
  16509. raw := NoMethod(*s)
  16510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16511. }
  16512. // RegionAutoscalerList: Contains a list of autoscalers.
  16513. type RegionAutoscalerList struct {
  16514. // Id: [Output Only] Unique identifier for the resource; defined by the
  16515. // server.
  16516. Id string `json:"id,omitempty"`
  16517. // Items: A list of Autoscaler resources.
  16518. Items []*Autoscaler `json:"items,omitempty"`
  16519. // Kind: Type of resource.
  16520. Kind string `json:"kind,omitempty"`
  16521. // NextPageToken: [Output Only] This token allows you to get the next
  16522. // page of results for list requests. If the number of results is larger
  16523. // than maxResults, use the nextPageToken as a value for the query
  16524. // parameter pageToken in the next list request. Subsequent list
  16525. // requests will have their own nextPageToken to continue paging through
  16526. // the results.
  16527. NextPageToken string `json:"nextPageToken,omitempty"`
  16528. // SelfLink: [Output Only] Server-defined URL for this resource.
  16529. SelfLink string `json:"selfLink,omitempty"`
  16530. // Warning: [Output Only] Informational warning message.
  16531. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  16532. // ServerResponse contains the HTTP response code and headers from the
  16533. // server.
  16534. googleapi.ServerResponse `json:"-"`
  16535. // ForceSendFields is a list of field names (e.g. "Id") to
  16536. // unconditionally include in API requests. By default, fields with
  16537. // empty values are omitted from API requests. However, any non-pointer,
  16538. // non-interface field appearing in ForceSendFields will be sent to the
  16539. // server regardless of whether the field is empty or not. This may be
  16540. // used to include empty fields in Patch requests.
  16541. ForceSendFields []string `json:"-"`
  16542. // NullFields is a list of field names (e.g. "Id") to include in API
  16543. // requests with the JSON null value. By default, fields with empty
  16544. // values are omitted from API requests. However, any field with an
  16545. // empty value appearing in NullFields will be sent to the server as
  16546. // null. It is an error if a field in this list has a non-empty value.
  16547. // This may be used to include null fields in Patch requests.
  16548. NullFields []string `json:"-"`
  16549. }
  16550. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  16551. type NoMethod RegionAutoscalerList
  16552. raw := NoMethod(*s)
  16553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16554. }
  16555. // RegionAutoscalerListWarning: [Output Only] Informational warning
  16556. // message.
  16557. type RegionAutoscalerListWarning struct {
  16558. // Code: [Output Only] A warning code, if applicable. For example,
  16559. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16560. // the response.
  16561. //
  16562. // Possible values:
  16563. // "CLEANUP_FAILED"
  16564. // "DEPRECATED_RESOURCE_USED"
  16565. // "DEPRECATED_TYPE_USED"
  16566. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16567. // "EXPERIMENTAL_TYPE_USED"
  16568. // "EXTERNAL_API_WARNING"
  16569. // "FIELD_VALUE_OVERRIDEN"
  16570. // "INJECTED_KERNELS_DEPRECATED"
  16571. // "MISSING_TYPE_DEPENDENCY"
  16572. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16573. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16574. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16575. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16576. // "NEXT_HOP_NOT_RUNNING"
  16577. // "NOT_CRITICAL_ERROR"
  16578. // "NO_RESULTS_ON_PAGE"
  16579. // "REQUIRED_TOS_AGREEMENT"
  16580. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16581. // "RESOURCE_NOT_DELETED"
  16582. // "SCHEMA_VALIDATION_IGNORED"
  16583. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16584. // "UNDECLARED_PROPERTIES"
  16585. // "UNREACHABLE"
  16586. Code string `json:"code,omitempty"`
  16587. // Data: [Output Only] Metadata about this warning in key: value format.
  16588. // For example:
  16589. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16590. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  16591. // Message: [Output Only] A human-readable description of the warning
  16592. // code.
  16593. Message string `json:"message,omitempty"`
  16594. // ForceSendFields is a list of field names (e.g. "Code") to
  16595. // unconditionally include in API requests. By default, fields with
  16596. // empty values are omitted from API requests. However, any non-pointer,
  16597. // non-interface field appearing in ForceSendFields will be sent to the
  16598. // server regardless of whether the field is empty or not. This may be
  16599. // used to include empty fields in Patch requests.
  16600. ForceSendFields []string `json:"-"`
  16601. // NullFields is a list of field names (e.g. "Code") to include in API
  16602. // requests with the JSON null value. By default, fields with empty
  16603. // values are omitted from API requests. However, any field with an
  16604. // empty value appearing in NullFields will be sent to the server as
  16605. // null. It is an error if a field in this list has a non-empty value.
  16606. // This may be used to include null fields in Patch requests.
  16607. NullFields []string `json:"-"`
  16608. }
  16609. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  16610. type NoMethod RegionAutoscalerListWarning
  16611. raw := NoMethod(*s)
  16612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16613. }
  16614. type RegionAutoscalerListWarningData struct {
  16615. // Key: [Output Only] A key that provides more detail on the warning
  16616. // being returned. For example, for warnings where there are no results
  16617. // in a list request for a particular zone, this key might be scope and
  16618. // the key value might be the zone name. Other examples might be a key
  16619. // indicating a deprecated resource and a suggested replacement, or a
  16620. // warning about invalid network settings (for example, if an instance
  16621. // attempts to perform IP forwarding but is not enabled for IP
  16622. // forwarding).
  16623. Key string `json:"key,omitempty"`
  16624. // Value: [Output Only] A warning data value corresponding to the key.
  16625. Value string `json:"value,omitempty"`
  16626. // ForceSendFields is a list of field names (e.g. "Key") to
  16627. // unconditionally include in API requests. By default, fields with
  16628. // empty values are omitted from API requests. However, any non-pointer,
  16629. // non-interface field appearing in ForceSendFields will be sent to the
  16630. // server regardless of whether the field is empty or not. This may be
  16631. // used to include empty fields in Patch requests.
  16632. ForceSendFields []string `json:"-"`
  16633. // NullFields is a list of field names (e.g. "Key") to include in API
  16634. // requests with the JSON null value. By default, fields with empty
  16635. // values are omitted from API requests. However, any field with an
  16636. // empty value appearing in NullFields will be sent to the server as
  16637. // null. It is an error if a field in this list has a non-empty value.
  16638. // This may be used to include null fields in Patch requests.
  16639. NullFields []string `json:"-"`
  16640. }
  16641. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  16642. type NoMethod RegionAutoscalerListWarningData
  16643. raw := NoMethod(*s)
  16644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16645. }
  16646. type RegionDiskTypeList struct {
  16647. // Id: [Output Only] Unique identifier for the resource; defined by the
  16648. // server.
  16649. Id string `json:"id,omitempty"`
  16650. // Items: A list of DiskType resources.
  16651. Items []*DiskType `json:"items,omitempty"`
  16652. // Kind: [Output Only] Type of resource. Always
  16653. // compute#regionDiskTypeList for region disk types.
  16654. Kind string `json:"kind,omitempty"`
  16655. // NextPageToken: [Output Only] This token allows you to get the next
  16656. // page of results for list requests. If the number of results is larger
  16657. // than maxResults, use the nextPageToken as a value for the query
  16658. // parameter pageToken in the next list request. Subsequent list
  16659. // requests will have their own nextPageToken to continue paging through
  16660. // the results.
  16661. NextPageToken string `json:"nextPageToken,omitempty"`
  16662. // SelfLink: [Output Only] Server-defined URL for this resource.
  16663. SelfLink string `json:"selfLink,omitempty"`
  16664. // Warning: [Output Only] Informational warning message.
  16665. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  16666. // ServerResponse contains the HTTP response code and headers from the
  16667. // server.
  16668. googleapi.ServerResponse `json:"-"`
  16669. // ForceSendFields is a list of field names (e.g. "Id") to
  16670. // unconditionally include in API requests. By default, fields with
  16671. // empty values are omitted from API requests. However, any non-pointer,
  16672. // non-interface field appearing in ForceSendFields will be sent to the
  16673. // server regardless of whether the field is empty or not. This may be
  16674. // used to include empty fields in Patch requests.
  16675. ForceSendFields []string `json:"-"`
  16676. // NullFields is a list of field names (e.g. "Id") to include in API
  16677. // requests with the JSON null value. By default, fields with empty
  16678. // values are omitted from API requests. However, any field with an
  16679. // empty value appearing in NullFields will be sent to the server as
  16680. // null. It is an error if a field in this list has a non-empty value.
  16681. // This may be used to include null fields in Patch requests.
  16682. NullFields []string `json:"-"`
  16683. }
  16684. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  16685. type NoMethod RegionDiskTypeList
  16686. raw := NoMethod(*s)
  16687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16688. }
  16689. // RegionDiskTypeListWarning: [Output Only] Informational warning
  16690. // message.
  16691. type RegionDiskTypeListWarning struct {
  16692. // Code: [Output Only] A warning code, if applicable. For example,
  16693. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16694. // the response.
  16695. //
  16696. // Possible values:
  16697. // "CLEANUP_FAILED"
  16698. // "DEPRECATED_RESOURCE_USED"
  16699. // "DEPRECATED_TYPE_USED"
  16700. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16701. // "EXPERIMENTAL_TYPE_USED"
  16702. // "EXTERNAL_API_WARNING"
  16703. // "FIELD_VALUE_OVERRIDEN"
  16704. // "INJECTED_KERNELS_DEPRECATED"
  16705. // "MISSING_TYPE_DEPENDENCY"
  16706. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16707. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16708. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16709. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16710. // "NEXT_HOP_NOT_RUNNING"
  16711. // "NOT_CRITICAL_ERROR"
  16712. // "NO_RESULTS_ON_PAGE"
  16713. // "REQUIRED_TOS_AGREEMENT"
  16714. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16715. // "RESOURCE_NOT_DELETED"
  16716. // "SCHEMA_VALIDATION_IGNORED"
  16717. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16718. // "UNDECLARED_PROPERTIES"
  16719. // "UNREACHABLE"
  16720. Code string `json:"code,omitempty"`
  16721. // Data: [Output Only] Metadata about this warning in key: value format.
  16722. // For example:
  16723. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16724. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  16725. // Message: [Output Only] A human-readable description of the warning
  16726. // code.
  16727. Message string `json:"message,omitempty"`
  16728. // ForceSendFields is a list of field names (e.g. "Code") to
  16729. // unconditionally include in API requests. By default, fields with
  16730. // empty values are omitted from API requests. However, any non-pointer,
  16731. // non-interface field appearing in ForceSendFields will be sent to the
  16732. // server regardless of whether the field is empty or not. This may be
  16733. // used to include empty fields in Patch requests.
  16734. ForceSendFields []string `json:"-"`
  16735. // NullFields is a list of field names (e.g. "Code") to include in API
  16736. // requests with the JSON null value. By default, fields with empty
  16737. // values are omitted from API requests. However, any field with an
  16738. // empty value appearing in NullFields will be sent to the server as
  16739. // null. It is an error if a field in this list has a non-empty value.
  16740. // This may be used to include null fields in Patch requests.
  16741. NullFields []string `json:"-"`
  16742. }
  16743. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  16744. type NoMethod RegionDiskTypeListWarning
  16745. raw := NoMethod(*s)
  16746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16747. }
  16748. type RegionDiskTypeListWarningData struct {
  16749. // Key: [Output Only] A key that provides more detail on the warning
  16750. // being returned. For example, for warnings where there are no results
  16751. // in a list request for a particular zone, this key might be scope and
  16752. // the key value might be the zone name. Other examples might be a key
  16753. // indicating a deprecated resource and a suggested replacement, or a
  16754. // warning about invalid network settings (for example, if an instance
  16755. // attempts to perform IP forwarding but is not enabled for IP
  16756. // forwarding).
  16757. Key string `json:"key,omitempty"`
  16758. // Value: [Output Only] A warning data value corresponding to the key.
  16759. Value string `json:"value,omitempty"`
  16760. // ForceSendFields is a list of field names (e.g. "Key") to
  16761. // unconditionally include in API requests. By default, fields with
  16762. // empty values are omitted from API requests. However, any non-pointer,
  16763. // non-interface field appearing in ForceSendFields will be sent to the
  16764. // server regardless of whether the field is empty or not. This may be
  16765. // used to include empty fields in Patch requests.
  16766. ForceSendFields []string `json:"-"`
  16767. // NullFields is a list of field names (e.g. "Key") to include in API
  16768. // requests with the JSON null value. By default, fields with empty
  16769. // values are omitted from API requests. However, any field with an
  16770. // empty value appearing in NullFields will be sent to the server as
  16771. // null. It is an error if a field in this list has a non-empty value.
  16772. // This may be used to include null fields in Patch requests.
  16773. NullFields []string `json:"-"`
  16774. }
  16775. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  16776. type NoMethod RegionDiskTypeListWarningData
  16777. raw := NoMethod(*s)
  16778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16779. }
  16780. type RegionDisksResizeRequest struct {
  16781. // SizeGb: The new size of the regional persistent disk, which is
  16782. // specified in GB.
  16783. SizeGb int64 `json:"sizeGb,omitempty,string"`
  16784. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  16785. // unconditionally include in API requests. By default, fields with
  16786. // empty values are omitted from API requests. However, any non-pointer,
  16787. // non-interface field appearing in ForceSendFields will be sent to the
  16788. // server regardless of whether the field is empty or not. This may be
  16789. // used to include empty fields in Patch requests.
  16790. ForceSendFields []string `json:"-"`
  16791. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  16792. // requests with the JSON null value. By default, fields with empty
  16793. // values are omitted from API requests. However, any field with an
  16794. // empty value appearing in NullFields will be sent to the server as
  16795. // null. It is an error if a field in this list has a non-empty value.
  16796. // This may be used to include null fields in Patch requests.
  16797. NullFields []string `json:"-"`
  16798. }
  16799. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  16800. type NoMethod RegionDisksResizeRequest
  16801. raw := NoMethod(*s)
  16802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16803. }
  16804. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  16805. type RegionInstanceGroupList struct {
  16806. // Id: [Output Only] Unique identifier for the resource; defined by the
  16807. // server.
  16808. Id string `json:"id,omitempty"`
  16809. // Items: A list of InstanceGroup resources.
  16810. Items []*InstanceGroup `json:"items,omitempty"`
  16811. // Kind: The resource type.
  16812. Kind string `json:"kind,omitempty"`
  16813. // NextPageToken: [Output Only] This token allows you to get the next
  16814. // page of results for list requests. If the number of results is larger
  16815. // than maxResults, use the nextPageToken as a value for the query
  16816. // parameter pageToken in the next list request. Subsequent list
  16817. // requests will have their own nextPageToken to continue paging through
  16818. // the results.
  16819. NextPageToken string `json:"nextPageToken,omitempty"`
  16820. // SelfLink: [Output Only] Server-defined URL for this resource.
  16821. SelfLink string `json:"selfLink,omitempty"`
  16822. // Warning: [Output Only] Informational warning message.
  16823. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  16824. // ServerResponse contains the HTTP response code and headers from the
  16825. // server.
  16826. googleapi.ServerResponse `json:"-"`
  16827. // ForceSendFields is a list of field names (e.g. "Id") to
  16828. // unconditionally include in API requests. By default, fields with
  16829. // empty values are omitted from API requests. However, any non-pointer,
  16830. // non-interface field appearing in ForceSendFields will be sent to the
  16831. // server regardless of whether the field is empty or not. This may be
  16832. // used to include empty fields in Patch requests.
  16833. ForceSendFields []string `json:"-"`
  16834. // NullFields is a list of field names (e.g. "Id") to include in API
  16835. // requests with the JSON null value. By default, fields with empty
  16836. // values are omitted from API requests. However, any field with an
  16837. // empty value appearing in NullFields will be sent to the server as
  16838. // null. It is an error if a field in this list has a non-empty value.
  16839. // This may be used to include null fields in Patch requests.
  16840. NullFields []string `json:"-"`
  16841. }
  16842. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  16843. type NoMethod RegionInstanceGroupList
  16844. raw := NoMethod(*s)
  16845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16846. }
  16847. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  16848. // message.
  16849. type RegionInstanceGroupListWarning struct {
  16850. // Code: [Output Only] A warning code, if applicable. For example,
  16851. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16852. // the response.
  16853. //
  16854. // Possible values:
  16855. // "CLEANUP_FAILED"
  16856. // "DEPRECATED_RESOURCE_USED"
  16857. // "DEPRECATED_TYPE_USED"
  16858. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16859. // "EXPERIMENTAL_TYPE_USED"
  16860. // "EXTERNAL_API_WARNING"
  16861. // "FIELD_VALUE_OVERRIDEN"
  16862. // "INJECTED_KERNELS_DEPRECATED"
  16863. // "MISSING_TYPE_DEPENDENCY"
  16864. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16865. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16866. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16867. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16868. // "NEXT_HOP_NOT_RUNNING"
  16869. // "NOT_CRITICAL_ERROR"
  16870. // "NO_RESULTS_ON_PAGE"
  16871. // "REQUIRED_TOS_AGREEMENT"
  16872. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16873. // "RESOURCE_NOT_DELETED"
  16874. // "SCHEMA_VALIDATION_IGNORED"
  16875. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16876. // "UNDECLARED_PROPERTIES"
  16877. // "UNREACHABLE"
  16878. Code string `json:"code,omitempty"`
  16879. // Data: [Output Only] Metadata about this warning in key: value format.
  16880. // For example:
  16881. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16882. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  16883. // Message: [Output Only] A human-readable description of the warning
  16884. // code.
  16885. Message string `json:"message,omitempty"`
  16886. // ForceSendFields is a list of field names (e.g. "Code") to
  16887. // unconditionally include in API requests. By default, fields with
  16888. // empty values are omitted from API requests. However, any non-pointer,
  16889. // non-interface field appearing in ForceSendFields will be sent to the
  16890. // server regardless of whether the field is empty or not. This may be
  16891. // used to include empty fields in Patch requests.
  16892. ForceSendFields []string `json:"-"`
  16893. // NullFields is a list of field names (e.g. "Code") to include in API
  16894. // requests with the JSON null value. By default, fields with empty
  16895. // values are omitted from API requests. However, any field with an
  16896. // empty value appearing in NullFields will be sent to the server as
  16897. // null. It is an error if a field in this list has a non-empty value.
  16898. // This may be used to include null fields in Patch requests.
  16899. NullFields []string `json:"-"`
  16900. }
  16901. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  16902. type NoMethod RegionInstanceGroupListWarning
  16903. raw := NoMethod(*s)
  16904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16905. }
  16906. type RegionInstanceGroupListWarningData struct {
  16907. // Key: [Output Only] A key that provides more detail on the warning
  16908. // being returned. For example, for warnings where there are no results
  16909. // in a list request for a particular zone, this key might be scope and
  16910. // the key value might be the zone name. Other examples might be a key
  16911. // indicating a deprecated resource and a suggested replacement, or a
  16912. // warning about invalid network settings (for example, if an instance
  16913. // attempts to perform IP forwarding but is not enabled for IP
  16914. // forwarding).
  16915. Key string `json:"key,omitempty"`
  16916. // Value: [Output Only] A warning data value corresponding to the key.
  16917. Value string `json:"value,omitempty"`
  16918. // ForceSendFields is a list of field names (e.g. "Key") to
  16919. // unconditionally include in API requests. By default, fields with
  16920. // empty values are omitted from API requests. However, any non-pointer,
  16921. // non-interface field appearing in ForceSendFields will be sent to the
  16922. // server regardless of whether the field is empty or not. This may be
  16923. // used to include empty fields in Patch requests.
  16924. ForceSendFields []string `json:"-"`
  16925. // NullFields is a list of field names (e.g. "Key") to include in API
  16926. // requests with the JSON null value. By default, fields with empty
  16927. // values are omitted from API requests. However, any field with an
  16928. // empty value appearing in NullFields will be sent to the server as
  16929. // null. It is an error if a field in this list has a non-empty value.
  16930. // This may be used to include null fields in Patch requests.
  16931. NullFields []string `json:"-"`
  16932. }
  16933. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  16934. type NoMethod RegionInstanceGroupListWarningData
  16935. raw := NoMethod(*s)
  16936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16937. }
  16938. // RegionInstanceGroupManagerList: Contains a list of managed instance
  16939. // groups.
  16940. type RegionInstanceGroupManagerList struct {
  16941. // Id: [Output Only] Unique identifier for the resource; defined by the
  16942. // server.
  16943. Id string `json:"id,omitempty"`
  16944. // Items: A list of InstanceGroupManager resources.
  16945. Items []*InstanceGroupManager `json:"items,omitempty"`
  16946. // Kind: [Output Only] The resource type, which is always
  16947. // compute#instanceGroupManagerList for a list of managed instance
  16948. // groups that exist in th regional scope.
  16949. Kind string `json:"kind,omitempty"`
  16950. // NextPageToken: [Output Only] This token allows you to get the next
  16951. // page of results for list requests. If the number of results is larger
  16952. // than maxResults, use the nextPageToken as a value for the query
  16953. // parameter pageToken in the next list request. Subsequent list
  16954. // requests will have their own nextPageToken to continue paging through
  16955. // the results.
  16956. NextPageToken string `json:"nextPageToken,omitempty"`
  16957. // SelfLink: [Output Only] Server-defined URL for this resource.
  16958. SelfLink string `json:"selfLink,omitempty"`
  16959. // Warning: [Output Only] Informational warning message.
  16960. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  16961. // ServerResponse contains the HTTP response code and headers from the
  16962. // server.
  16963. googleapi.ServerResponse `json:"-"`
  16964. // ForceSendFields is a list of field names (e.g. "Id") to
  16965. // unconditionally include in API requests. By default, fields with
  16966. // empty values are omitted from API requests. However, any non-pointer,
  16967. // non-interface field appearing in ForceSendFields will be sent to the
  16968. // server regardless of whether the field is empty or not. This may be
  16969. // used to include empty fields in Patch requests.
  16970. ForceSendFields []string `json:"-"`
  16971. // NullFields is a list of field names (e.g. "Id") to include in API
  16972. // requests with the JSON null value. By default, fields with empty
  16973. // values are omitted from API requests. However, any field with an
  16974. // empty value appearing in NullFields will be sent to the server as
  16975. // null. It is an error if a field in this list has a non-empty value.
  16976. // This may be used to include null fields in Patch requests.
  16977. NullFields []string `json:"-"`
  16978. }
  16979. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  16980. type NoMethod RegionInstanceGroupManagerList
  16981. raw := NoMethod(*s)
  16982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16983. }
  16984. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  16985. // warning message.
  16986. type RegionInstanceGroupManagerListWarning struct {
  16987. // Code: [Output Only] A warning code, if applicable. For example,
  16988. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16989. // the response.
  16990. //
  16991. // Possible values:
  16992. // "CLEANUP_FAILED"
  16993. // "DEPRECATED_RESOURCE_USED"
  16994. // "DEPRECATED_TYPE_USED"
  16995. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16996. // "EXPERIMENTAL_TYPE_USED"
  16997. // "EXTERNAL_API_WARNING"
  16998. // "FIELD_VALUE_OVERRIDEN"
  16999. // "INJECTED_KERNELS_DEPRECATED"
  17000. // "MISSING_TYPE_DEPENDENCY"
  17001. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17002. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17003. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17004. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17005. // "NEXT_HOP_NOT_RUNNING"
  17006. // "NOT_CRITICAL_ERROR"
  17007. // "NO_RESULTS_ON_PAGE"
  17008. // "REQUIRED_TOS_AGREEMENT"
  17009. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17010. // "RESOURCE_NOT_DELETED"
  17011. // "SCHEMA_VALIDATION_IGNORED"
  17012. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17013. // "UNDECLARED_PROPERTIES"
  17014. // "UNREACHABLE"
  17015. Code string `json:"code,omitempty"`
  17016. // Data: [Output Only] Metadata about this warning in key: value format.
  17017. // For example:
  17018. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17019. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  17020. // Message: [Output Only] A human-readable description of the warning
  17021. // code.
  17022. Message string `json:"message,omitempty"`
  17023. // ForceSendFields is a list of field names (e.g. "Code") to
  17024. // unconditionally include in API requests. By default, fields with
  17025. // empty values are omitted from API requests. However, any non-pointer,
  17026. // non-interface field appearing in ForceSendFields will be sent to the
  17027. // server regardless of whether the field is empty or not. This may be
  17028. // used to include empty fields in Patch requests.
  17029. ForceSendFields []string `json:"-"`
  17030. // NullFields is a list of field names (e.g. "Code") to include in API
  17031. // requests with the JSON null value. By default, fields with empty
  17032. // values are omitted from API requests. However, any field with an
  17033. // empty value appearing in NullFields will be sent to the server as
  17034. // null. It is an error if a field in this list has a non-empty value.
  17035. // This may be used to include null fields in Patch requests.
  17036. NullFields []string `json:"-"`
  17037. }
  17038. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  17039. type NoMethod RegionInstanceGroupManagerListWarning
  17040. raw := NoMethod(*s)
  17041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17042. }
  17043. type RegionInstanceGroupManagerListWarningData struct {
  17044. // Key: [Output Only] A key that provides more detail on the warning
  17045. // being returned. For example, for warnings where there are no results
  17046. // in a list request for a particular zone, this key might be scope and
  17047. // the key value might be the zone name. Other examples might be a key
  17048. // indicating a deprecated resource and a suggested replacement, or a
  17049. // warning about invalid network settings (for example, if an instance
  17050. // attempts to perform IP forwarding but is not enabled for IP
  17051. // forwarding).
  17052. Key string `json:"key,omitempty"`
  17053. // Value: [Output Only] A warning data value corresponding to the key.
  17054. Value string `json:"value,omitempty"`
  17055. // ForceSendFields is a list of field names (e.g. "Key") to
  17056. // unconditionally include in API requests. By default, fields with
  17057. // empty values are omitted from API requests. However, any non-pointer,
  17058. // non-interface field appearing in ForceSendFields will be sent to the
  17059. // server regardless of whether the field is empty or not. This may be
  17060. // used to include empty fields in Patch requests.
  17061. ForceSendFields []string `json:"-"`
  17062. // NullFields is a list of field names (e.g. "Key") to include in API
  17063. // requests with the JSON null value. By default, fields with empty
  17064. // values are omitted from API requests. However, any field with an
  17065. // empty value appearing in NullFields will be sent to the server as
  17066. // null. It is an error if a field in this list has a non-empty value.
  17067. // This may be used to include null fields in Patch requests.
  17068. NullFields []string `json:"-"`
  17069. }
  17070. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  17071. type NoMethod RegionInstanceGroupManagerListWarningData
  17072. raw := NoMethod(*s)
  17073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17074. }
  17075. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  17076. // Instances: The URLs of one or more instances to abandon. This can be
  17077. // a full URL or a partial URL, such as
  17078. // zones/[ZONE]/instances/[INSTANCE_NAME].
  17079. Instances []string `json:"instances,omitempty"`
  17080. // ForceSendFields is a list of field names (e.g. "Instances") to
  17081. // unconditionally include in API requests. By default, fields with
  17082. // empty values are omitted from API requests. However, any non-pointer,
  17083. // non-interface field appearing in ForceSendFields will be sent to the
  17084. // server regardless of whether the field is empty or not. This may be
  17085. // used to include empty fields in Patch requests.
  17086. ForceSendFields []string `json:"-"`
  17087. // NullFields is a list of field names (e.g. "Instances") to include in
  17088. // API requests with the JSON null value. By default, fields with empty
  17089. // values are omitted from API requests. However, any field with an
  17090. // empty value appearing in NullFields will be sent to the server as
  17091. // null. It is an error if a field in this list has a non-empty value.
  17092. // This may be used to include null fields in Patch requests.
  17093. NullFields []string `json:"-"`
  17094. }
  17095. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  17096. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  17097. raw := NoMethod(*s)
  17098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17099. }
  17100. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  17101. // Instances: The URLs of one or more instances to delete. This can be a
  17102. // full URL or a partial URL, such as
  17103. // zones/[ZONE]/instances/[INSTANCE_NAME].
  17104. Instances []string `json:"instances,omitempty"`
  17105. // ForceSendFields is a list of field names (e.g. "Instances") to
  17106. // unconditionally include in API requests. By default, fields with
  17107. // empty values are omitted from API requests. However, any non-pointer,
  17108. // non-interface field appearing in ForceSendFields will be sent to the
  17109. // server regardless of whether the field is empty or not. This may be
  17110. // used to include empty fields in Patch requests.
  17111. ForceSendFields []string `json:"-"`
  17112. // NullFields is a list of field names (e.g. "Instances") to include in
  17113. // API requests with the JSON null value. By default, fields with empty
  17114. // values are omitted from API requests. However, any field with an
  17115. // empty value appearing in NullFields will be sent to the server as
  17116. // null. It is an error if a field in this list has a non-empty value.
  17117. // This may be used to include null fields in Patch requests.
  17118. NullFields []string `json:"-"`
  17119. }
  17120. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  17121. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  17122. raw := NoMethod(*s)
  17123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17124. }
  17125. type RegionInstanceGroupManagersListInstancesResponse struct {
  17126. // ManagedInstances: A list of managed instances.
  17127. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  17128. // ServerResponse contains the HTTP response code and headers from the
  17129. // server.
  17130. googleapi.ServerResponse `json:"-"`
  17131. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  17132. // unconditionally include in API requests. By default, fields with
  17133. // empty values are omitted from API requests. However, any non-pointer,
  17134. // non-interface field appearing in ForceSendFields will be sent to the
  17135. // server regardless of whether the field is empty or not. This may be
  17136. // used to include empty fields in Patch requests.
  17137. ForceSendFields []string `json:"-"`
  17138. // NullFields is a list of field names (e.g. "ManagedInstances") to
  17139. // include in API requests with the JSON null value. By default, fields
  17140. // with empty values are omitted from API requests. However, any field
  17141. // with an empty value appearing in NullFields will be sent to the
  17142. // server as null. It is an error if a field in this list has a
  17143. // non-empty value. This may be used to include null fields in Patch
  17144. // requests.
  17145. NullFields []string `json:"-"`
  17146. }
  17147. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  17148. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  17149. raw := NoMethod(*s)
  17150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17151. }
  17152. type RegionInstanceGroupManagersRecreateRequest struct {
  17153. // Instances: The URLs of one or more instances to recreate. This can be
  17154. // a full URL or a partial URL, such as
  17155. // zones/[ZONE]/instances/[INSTANCE_NAME].
  17156. Instances []string `json:"instances,omitempty"`
  17157. // ForceSendFields is a list of field names (e.g. "Instances") to
  17158. // unconditionally include in API requests. By default, fields with
  17159. // empty values are omitted from API requests. However, any non-pointer,
  17160. // non-interface field appearing in ForceSendFields will be sent to the
  17161. // server regardless of whether the field is empty or not. This may be
  17162. // used to include empty fields in Patch requests.
  17163. ForceSendFields []string `json:"-"`
  17164. // NullFields is a list of field names (e.g. "Instances") to include in
  17165. // API requests with the JSON null value. By default, fields with empty
  17166. // values are omitted from API requests. However, any field with an
  17167. // empty value appearing in NullFields will be sent to the server as
  17168. // null. It is an error if a field in this list has a non-empty value.
  17169. // This may be used to include null fields in Patch requests.
  17170. NullFields []string `json:"-"`
  17171. }
  17172. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  17173. type NoMethod RegionInstanceGroupManagersRecreateRequest
  17174. raw := NoMethod(*s)
  17175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17176. }
  17177. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  17178. // Fingerprint: Fingerprint of the target pools information, which is a
  17179. // hash of the contents. This field is used for optimistic locking when
  17180. // you update the target pool entries. This field is optional.
  17181. Fingerprint string `json:"fingerprint,omitempty"`
  17182. // TargetPools: The URL of all TargetPool resources to which instances
  17183. // in the instanceGroup field are added. The target pools automatically
  17184. // apply to all of the instances in the managed instance group.
  17185. TargetPools []string `json:"targetPools,omitempty"`
  17186. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  17187. // unconditionally include in API requests. By default, fields with
  17188. // empty values are omitted from API requests. However, any non-pointer,
  17189. // non-interface field appearing in ForceSendFields will be sent to the
  17190. // server regardless of whether the field is empty or not. This may be
  17191. // used to include empty fields in Patch requests.
  17192. ForceSendFields []string `json:"-"`
  17193. // NullFields is a list of field names (e.g. "Fingerprint") to include
  17194. // in API requests with the JSON null value. By default, fields with
  17195. // empty values are omitted from API requests. However, any field with
  17196. // an empty value appearing in NullFields will be sent to the server as
  17197. // null. It is an error if a field in this list has a non-empty value.
  17198. // This may be used to include null fields in Patch requests.
  17199. NullFields []string `json:"-"`
  17200. }
  17201. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  17202. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  17203. raw := NoMethod(*s)
  17204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17205. }
  17206. type RegionInstanceGroupManagersSetTemplateRequest struct {
  17207. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  17208. // new instances will be created.
  17209. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  17210. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  17211. // unconditionally include in API requests. By default, fields with
  17212. // empty values are omitted from API requests. However, any non-pointer,
  17213. // non-interface field appearing in ForceSendFields will be sent to the
  17214. // server regardless of whether the field is empty or not. This may be
  17215. // used to include empty fields in Patch requests.
  17216. ForceSendFields []string `json:"-"`
  17217. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  17218. // include in API requests with the JSON null value. By default, fields
  17219. // with empty values are omitted from API requests. However, any field
  17220. // with an empty value appearing in NullFields will be sent to the
  17221. // server as null. It is an error if a field in this list has a
  17222. // non-empty value. This may be used to include null fields in Patch
  17223. // requests.
  17224. NullFields []string `json:"-"`
  17225. }
  17226. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  17227. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  17228. raw := NoMethod(*s)
  17229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17230. }
  17231. type RegionInstanceGroupsListInstances struct {
  17232. // Id: [Output Only] Unique identifier for the resource; defined by the
  17233. // server.
  17234. Id string `json:"id,omitempty"`
  17235. // Items: A list of InstanceWithNamedPorts resources.
  17236. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  17237. // Kind: The resource type.
  17238. Kind string `json:"kind,omitempty"`
  17239. // NextPageToken: [Output Only] This token allows you to get the next
  17240. // page of results for list requests. If the number of results is larger
  17241. // than maxResults, use the nextPageToken as a value for the query
  17242. // parameter pageToken in the next list request. Subsequent list
  17243. // requests will have their own nextPageToken to continue paging through
  17244. // the results.
  17245. NextPageToken string `json:"nextPageToken,omitempty"`
  17246. // SelfLink: [Output Only] Server-defined URL for this resource.
  17247. SelfLink string `json:"selfLink,omitempty"`
  17248. // Warning: [Output Only] Informational warning message.
  17249. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  17250. // ServerResponse contains the HTTP response code and headers from the
  17251. // server.
  17252. googleapi.ServerResponse `json:"-"`
  17253. // ForceSendFields is a list of field names (e.g. "Id") to
  17254. // unconditionally include in API requests. By default, fields with
  17255. // empty values are omitted from API requests. However, any non-pointer,
  17256. // non-interface field appearing in ForceSendFields will be sent to the
  17257. // server regardless of whether the field is empty or not. This may be
  17258. // used to include empty fields in Patch requests.
  17259. ForceSendFields []string `json:"-"`
  17260. // NullFields is a list of field names (e.g. "Id") to include in API
  17261. // requests with the JSON null value. By default, fields with empty
  17262. // values are omitted from API requests. However, any field with an
  17263. // empty value appearing in NullFields will be sent to the server as
  17264. // null. It is an error if a field in this list has a non-empty value.
  17265. // This may be used to include null fields in Patch requests.
  17266. NullFields []string `json:"-"`
  17267. }
  17268. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  17269. type NoMethod RegionInstanceGroupsListInstances
  17270. raw := NoMethod(*s)
  17271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17272. }
  17273. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  17274. // warning message.
  17275. type RegionInstanceGroupsListInstancesWarning struct {
  17276. // Code: [Output Only] A warning code, if applicable. For example,
  17277. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17278. // the response.
  17279. //
  17280. // Possible values:
  17281. // "CLEANUP_FAILED"
  17282. // "DEPRECATED_RESOURCE_USED"
  17283. // "DEPRECATED_TYPE_USED"
  17284. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17285. // "EXPERIMENTAL_TYPE_USED"
  17286. // "EXTERNAL_API_WARNING"
  17287. // "FIELD_VALUE_OVERRIDEN"
  17288. // "INJECTED_KERNELS_DEPRECATED"
  17289. // "MISSING_TYPE_DEPENDENCY"
  17290. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17291. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17292. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17293. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17294. // "NEXT_HOP_NOT_RUNNING"
  17295. // "NOT_CRITICAL_ERROR"
  17296. // "NO_RESULTS_ON_PAGE"
  17297. // "REQUIRED_TOS_AGREEMENT"
  17298. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17299. // "RESOURCE_NOT_DELETED"
  17300. // "SCHEMA_VALIDATION_IGNORED"
  17301. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17302. // "UNDECLARED_PROPERTIES"
  17303. // "UNREACHABLE"
  17304. Code string `json:"code,omitempty"`
  17305. // Data: [Output Only] Metadata about this warning in key: value format.
  17306. // For example:
  17307. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17308. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  17309. // Message: [Output Only] A human-readable description of the warning
  17310. // code.
  17311. Message string `json:"message,omitempty"`
  17312. // ForceSendFields is a list of field names (e.g. "Code") to
  17313. // unconditionally include in API requests. By default, fields with
  17314. // empty values are omitted from API requests. However, any non-pointer,
  17315. // non-interface field appearing in ForceSendFields will be sent to the
  17316. // server regardless of whether the field is empty or not. This may be
  17317. // used to include empty fields in Patch requests.
  17318. ForceSendFields []string `json:"-"`
  17319. // NullFields is a list of field names (e.g. "Code") to include in API
  17320. // requests with the JSON null value. By default, fields with empty
  17321. // values are omitted from API requests. However, any field with an
  17322. // empty value appearing in NullFields will be sent to the server as
  17323. // null. It is an error if a field in this list has a non-empty value.
  17324. // This may be used to include null fields in Patch requests.
  17325. NullFields []string `json:"-"`
  17326. }
  17327. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  17328. type NoMethod RegionInstanceGroupsListInstancesWarning
  17329. raw := NoMethod(*s)
  17330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17331. }
  17332. type RegionInstanceGroupsListInstancesWarningData struct {
  17333. // Key: [Output Only] A key that provides more detail on the warning
  17334. // being returned. For example, for warnings where there are no results
  17335. // in a list request for a particular zone, this key might be scope and
  17336. // the key value might be the zone name. Other examples might be a key
  17337. // indicating a deprecated resource and a suggested replacement, or a
  17338. // warning about invalid network settings (for example, if an instance
  17339. // attempts to perform IP forwarding but is not enabled for IP
  17340. // forwarding).
  17341. Key string `json:"key,omitempty"`
  17342. // Value: [Output Only] A warning data value corresponding to the key.
  17343. Value string `json:"value,omitempty"`
  17344. // ForceSendFields is a list of field names (e.g. "Key") to
  17345. // unconditionally include in API requests. By default, fields with
  17346. // empty values are omitted from API requests. However, any non-pointer,
  17347. // non-interface field appearing in ForceSendFields will be sent to the
  17348. // server regardless of whether the field is empty or not. This may be
  17349. // used to include empty fields in Patch requests.
  17350. ForceSendFields []string `json:"-"`
  17351. // NullFields is a list of field names (e.g. "Key") to include in API
  17352. // requests with the JSON null value. By default, fields with empty
  17353. // values are omitted from API requests. However, any field with an
  17354. // empty value appearing in NullFields will be sent to the server as
  17355. // null. It is an error if a field in this list has a non-empty value.
  17356. // This may be used to include null fields in Patch requests.
  17357. NullFields []string `json:"-"`
  17358. }
  17359. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  17360. type NoMethod RegionInstanceGroupsListInstancesWarningData
  17361. raw := NoMethod(*s)
  17362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17363. }
  17364. type RegionInstanceGroupsListInstancesRequest struct {
  17365. // InstanceState: Instances in which state should be returned. Valid
  17366. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  17367. //
  17368. // Possible values:
  17369. // "ALL"
  17370. // "RUNNING"
  17371. InstanceState string `json:"instanceState,omitempty"`
  17372. // PortName: Name of port user is interested in. It is optional. If it
  17373. // is set, only information about this ports will be returned. If it is
  17374. // not set, all the named ports will be returned. Always lists all
  17375. // instances.
  17376. PortName string `json:"portName,omitempty"`
  17377. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  17378. // unconditionally include in API requests. By default, fields with
  17379. // empty values are omitted from API requests. However, any non-pointer,
  17380. // non-interface field appearing in ForceSendFields will be sent to the
  17381. // server regardless of whether the field is empty or not. This may be
  17382. // used to include empty fields in Patch requests.
  17383. ForceSendFields []string `json:"-"`
  17384. // NullFields is a list of field names (e.g. "InstanceState") to include
  17385. // in API requests with the JSON null value. By default, fields with
  17386. // empty values are omitted from API requests. However, any field with
  17387. // an empty value appearing in NullFields will be sent to the server as
  17388. // null. It is an error if a field in this list has a non-empty value.
  17389. // This may be used to include null fields in Patch requests.
  17390. NullFields []string `json:"-"`
  17391. }
  17392. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  17393. type NoMethod RegionInstanceGroupsListInstancesRequest
  17394. raw := NoMethod(*s)
  17395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17396. }
  17397. type RegionInstanceGroupsSetNamedPortsRequest struct {
  17398. // Fingerprint: The fingerprint of the named ports information for this
  17399. // instance group. Use this optional property to prevent conflicts when
  17400. // multiple users change the named ports settings concurrently. Obtain
  17401. // the fingerprint with the instanceGroups.get method. Then, include the
  17402. // fingerprint in your request to ensure that you do not overwrite
  17403. // changes that were applied from another concurrent request.
  17404. Fingerprint string `json:"fingerprint,omitempty"`
  17405. // NamedPorts: The list of named ports to set for this instance group.
  17406. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  17407. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  17408. // unconditionally include in API requests. By default, fields with
  17409. // empty values are omitted from API requests. However, any non-pointer,
  17410. // non-interface field appearing in ForceSendFields will be sent to the
  17411. // server regardless of whether the field is empty or not. This may be
  17412. // used to include empty fields in Patch requests.
  17413. ForceSendFields []string `json:"-"`
  17414. // NullFields is a list of field names (e.g. "Fingerprint") to include
  17415. // in API requests with the JSON null value. By default, fields with
  17416. // empty values are omitted from API requests. However, any field with
  17417. // an empty value appearing in NullFields will be sent to the server as
  17418. // null. It is an error if a field in this list has a non-empty value.
  17419. // This may be used to include null fields in Patch requests.
  17420. NullFields []string `json:"-"`
  17421. }
  17422. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  17423. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  17424. raw := NoMethod(*s)
  17425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17426. }
  17427. // RegionList: Contains a list of region resources.
  17428. type RegionList struct {
  17429. // Id: [Output Only] Unique identifier for the resource; defined by the
  17430. // server.
  17431. Id string `json:"id,omitempty"`
  17432. // Items: A list of Region resources.
  17433. Items []*Region `json:"items,omitempty"`
  17434. // Kind: [Output Only] Type of resource. Always compute#regionList for
  17435. // lists of regions.
  17436. Kind string `json:"kind,omitempty"`
  17437. // NextPageToken: [Output Only] This token allows you to get the next
  17438. // page of results for list requests. If the number of results is larger
  17439. // than maxResults, use the nextPageToken as a value for the query
  17440. // parameter pageToken in the next list request. Subsequent list
  17441. // requests will have their own nextPageToken to continue paging through
  17442. // the results.
  17443. NextPageToken string `json:"nextPageToken,omitempty"`
  17444. // SelfLink: [Output Only] Server-defined URL for this resource.
  17445. SelfLink string `json:"selfLink,omitempty"`
  17446. // Warning: [Output Only] Informational warning message.
  17447. Warning *RegionListWarning `json:"warning,omitempty"`
  17448. // ServerResponse contains the HTTP response code and headers from the
  17449. // server.
  17450. googleapi.ServerResponse `json:"-"`
  17451. // ForceSendFields is a list of field names (e.g. "Id") to
  17452. // unconditionally include in API requests. By default, fields with
  17453. // empty values are omitted from API requests. However, any non-pointer,
  17454. // non-interface field appearing in ForceSendFields will be sent to the
  17455. // server regardless of whether the field is empty or not. This may be
  17456. // used to include empty fields in Patch requests.
  17457. ForceSendFields []string `json:"-"`
  17458. // NullFields is a list of field names (e.g. "Id") to include in API
  17459. // requests with the JSON null value. By default, fields with empty
  17460. // values are omitted from API requests. However, any field with an
  17461. // empty value appearing in NullFields will be sent to the server as
  17462. // null. It is an error if a field in this list has a non-empty value.
  17463. // This may be used to include null fields in Patch requests.
  17464. NullFields []string `json:"-"`
  17465. }
  17466. func (s *RegionList) MarshalJSON() ([]byte, error) {
  17467. type NoMethod RegionList
  17468. raw := NoMethod(*s)
  17469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17470. }
  17471. // RegionListWarning: [Output Only] Informational warning message.
  17472. type RegionListWarning struct {
  17473. // Code: [Output Only] A warning code, if applicable. For example,
  17474. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17475. // the response.
  17476. //
  17477. // Possible values:
  17478. // "CLEANUP_FAILED"
  17479. // "DEPRECATED_RESOURCE_USED"
  17480. // "DEPRECATED_TYPE_USED"
  17481. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17482. // "EXPERIMENTAL_TYPE_USED"
  17483. // "EXTERNAL_API_WARNING"
  17484. // "FIELD_VALUE_OVERRIDEN"
  17485. // "INJECTED_KERNELS_DEPRECATED"
  17486. // "MISSING_TYPE_DEPENDENCY"
  17487. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17488. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17489. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17490. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17491. // "NEXT_HOP_NOT_RUNNING"
  17492. // "NOT_CRITICAL_ERROR"
  17493. // "NO_RESULTS_ON_PAGE"
  17494. // "REQUIRED_TOS_AGREEMENT"
  17495. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17496. // "RESOURCE_NOT_DELETED"
  17497. // "SCHEMA_VALIDATION_IGNORED"
  17498. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17499. // "UNDECLARED_PROPERTIES"
  17500. // "UNREACHABLE"
  17501. Code string `json:"code,omitempty"`
  17502. // Data: [Output Only] Metadata about this warning in key: value format.
  17503. // For example:
  17504. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17505. Data []*RegionListWarningData `json:"data,omitempty"`
  17506. // Message: [Output Only] A human-readable description of the warning
  17507. // code.
  17508. Message string `json:"message,omitempty"`
  17509. // ForceSendFields is a list of field names (e.g. "Code") to
  17510. // unconditionally include in API requests. By default, fields with
  17511. // empty values are omitted from API requests. However, any non-pointer,
  17512. // non-interface field appearing in ForceSendFields will be sent to the
  17513. // server regardless of whether the field is empty or not. This may be
  17514. // used to include empty fields in Patch requests.
  17515. ForceSendFields []string `json:"-"`
  17516. // NullFields is a list of field names (e.g. "Code") to include in API
  17517. // requests with the JSON null value. By default, fields with empty
  17518. // values are omitted from API requests. However, any field with an
  17519. // empty value appearing in NullFields will be sent to the server as
  17520. // null. It is an error if a field in this list has a non-empty value.
  17521. // This may be used to include null fields in Patch requests.
  17522. NullFields []string `json:"-"`
  17523. }
  17524. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  17525. type NoMethod RegionListWarning
  17526. raw := NoMethod(*s)
  17527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17528. }
  17529. type RegionListWarningData struct {
  17530. // Key: [Output Only] A key that provides more detail on the warning
  17531. // being returned. For example, for warnings where there are no results
  17532. // in a list request for a particular zone, this key might be scope and
  17533. // the key value might be the zone name. Other examples might be a key
  17534. // indicating a deprecated resource and a suggested replacement, or a
  17535. // warning about invalid network settings (for example, if an instance
  17536. // attempts to perform IP forwarding but is not enabled for IP
  17537. // forwarding).
  17538. Key string `json:"key,omitempty"`
  17539. // Value: [Output Only] A warning data value corresponding to the key.
  17540. Value string `json:"value,omitempty"`
  17541. // ForceSendFields is a list of field names (e.g. "Key") to
  17542. // unconditionally include in API requests. By default, fields with
  17543. // empty values are omitted from API requests. However, any non-pointer,
  17544. // non-interface field appearing in ForceSendFields will be sent to the
  17545. // server regardless of whether the field is empty or not. This may be
  17546. // used to include empty fields in Patch requests.
  17547. ForceSendFields []string `json:"-"`
  17548. // NullFields is a list of field names (e.g. "Key") to include in API
  17549. // requests with the JSON null value. By default, fields with empty
  17550. // values are omitted from API requests. However, any field with an
  17551. // empty value appearing in NullFields will be sent to the server as
  17552. // null. It is an error if a field in this list has a non-empty value.
  17553. // This may be used to include null fields in Patch requests.
  17554. NullFields []string `json:"-"`
  17555. }
  17556. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  17557. type NoMethod RegionListWarningData
  17558. raw := NoMethod(*s)
  17559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17560. }
  17561. type RegionSetLabelsRequest struct {
  17562. // LabelFingerprint: The fingerprint of the previous set of labels for
  17563. // this resource, used to detect conflicts. The fingerprint is initially
  17564. // generated by Compute Engine and changes after every request to modify
  17565. // or update labels. You must always provide an up-to-date fingerprint
  17566. // hash in order to update or change labels. Make a get() request to the
  17567. // resource to get the latest fingerprint.
  17568. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  17569. // Labels: The labels to set for this resource.
  17570. Labels map[string]string `json:"labels,omitempty"`
  17571. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  17572. // unconditionally include in API requests. By default, fields with
  17573. // empty values are omitted from API requests. However, any non-pointer,
  17574. // non-interface field appearing in ForceSendFields will be sent to the
  17575. // server regardless of whether the field is empty or not. This may be
  17576. // used to include empty fields in Patch requests.
  17577. ForceSendFields []string `json:"-"`
  17578. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  17579. // include in API requests with the JSON null value. By default, fields
  17580. // with empty values are omitted from API requests. However, any field
  17581. // with an empty value appearing in NullFields will be sent to the
  17582. // server as null. It is an error if a field in this list has a
  17583. // non-empty value. This may be used to include null fields in Patch
  17584. // requests.
  17585. NullFields []string `json:"-"`
  17586. }
  17587. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  17588. type NoMethod RegionSetLabelsRequest
  17589. raw := NoMethod(*s)
  17590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17591. }
  17592. type RegionSetPolicyRequest struct {
  17593. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  17594. // Deprecated. Use 'policy' to specify bindings.
  17595. Bindings []*Binding `json:"bindings,omitempty"`
  17596. // Etag: Flatten Policy to create a backward compatible wire-format.
  17597. // Deprecated. Use 'policy' to specify the etag.
  17598. Etag string `json:"etag,omitempty"`
  17599. // Policy: REQUIRED: The complete policy to be applied to the
  17600. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  17601. // empty policy is in general a valid policy but certain services (like
  17602. // Projects) might reject them.
  17603. Policy *Policy `json:"policy,omitempty"`
  17604. // ForceSendFields is a list of field names (e.g. "Bindings") to
  17605. // unconditionally include in API requests. By default, fields with
  17606. // empty values are omitted from API requests. However, any non-pointer,
  17607. // non-interface field appearing in ForceSendFields will be sent to the
  17608. // server regardless of whether the field is empty or not. This may be
  17609. // used to include empty fields in Patch requests.
  17610. ForceSendFields []string `json:"-"`
  17611. // NullFields is a list of field names (e.g. "Bindings") to include in
  17612. // API requests with the JSON null value. By default, fields with empty
  17613. // values are omitted from API requests. However, any field with an
  17614. // empty value appearing in NullFields will be sent to the server as
  17615. // null. It is an error if a field in this list has a non-empty value.
  17616. // This may be used to include null fields in Patch requests.
  17617. NullFields []string `json:"-"`
  17618. }
  17619. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  17620. type NoMethod RegionSetPolicyRequest
  17621. raw := NoMethod(*s)
  17622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17623. }
  17624. // ResourceCommitment: Commitment for a particular resource (a
  17625. // Commitment is composed of one or more of these).
  17626. type ResourceCommitment struct {
  17627. // Amount: The amount of the resource purchased (in a type-dependent
  17628. // unit, such as bytes). For vCPUs, this can just be an integer. For
  17629. // memory, this must be provided in MB. Memory must be a multiple of 256
  17630. // MB, with up to 6.5GB of memory per every vCPU.
  17631. Amount int64 `json:"amount,omitempty,string"`
  17632. // Type: Type of resource for which this commitment applies. Possible
  17633. // values are VCPU and MEMORY
  17634. //
  17635. // Possible values:
  17636. // "MEMORY"
  17637. // "UNSPECIFIED"
  17638. // "VCPU"
  17639. Type string `json:"type,omitempty"`
  17640. // ForceSendFields is a list of field names (e.g. "Amount") to
  17641. // unconditionally include in API requests. By default, fields with
  17642. // empty values are omitted from API requests. However, any non-pointer,
  17643. // non-interface field appearing in ForceSendFields will be sent to the
  17644. // server regardless of whether the field is empty or not. This may be
  17645. // used to include empty fields in Patch requests.
  17646. ForceSendFields []string `json:"-"`
  17647. // NullFields is a list of field names (e.g. "Amount") to include in API
  17648. // requests with the JSON null value. By default, fields with empty
  17649. // values are omitted from API requests. However, any field with an
  17650. // empty value appearing in NullFields will be sent to the server as
  17651. // null. It is an error if a field in this list has a non-empty value.
  17652. // This may be used to include null fields in Patch requests.
  17653. NullFields []string `json:"-"`
  17654. }
  17655. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  17656. type NoMethod ResourceCommitment
  17657. raw := NoMethod(*s)
  17658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17659. }
  17660. type ResourceGroupReference struct {
  17661. // Group: A URI referencing one of the instance groups or network
  17662. // endpoint groups listed in the backend service.
  17663. Group string `json:"group,omitempty"`
  17664. // ForceSendFields is a list of field names (e.g. "Group") to
  17665. // unconditionally include in API requests. By default, fields with
  17666. // empty values are omitted from API requests. However, any non-pointer,
  17667. // non-interface field appearing in ForceSendFields will be sent to the
  17668. // server regardless of whether the field is empty or not. This may be
  17669. // used to include empty fields in Patch requests.
  17670. ForceSendFields []string `json:"-"`
  17671. // NullFields is a list of field names (e.g. "Group") to include in API
  17672. // requests with the JSON null value. By default, fields with empty
  17673. // values are omitted from API requests. However, any field with an
  17674. // empty value appearing in NullFields will be sent to the server as
  17675. // null. It is an error if a field in this list has a non-empty value.
  17676. // This may be used to include null fields in Patch requests.
  17677. NullFields []string `json:"-"`
  17678. }
  17679. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  17680. type NoMethod ResourceGroupReference
  17681. raw := NoMethod(*s)
  17682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17683. }
  17684. // Route: Represents a Route resource. A route specifies how certain
  17685. // packets should be handled by the network. Routes are associated with
  17686. // instances by tags and the set of routes for a particular instance is
  17687. // called its routing table.
  17688. //
  17689. // For each packet leaving an instance, the system searches that
  17690. // instance's routing table for a single best matching route. Routes
  17691. // match packets by destination IP address, preferring smaller or more
  17692. // specific ranges over larger ones. If there is a tie, the system
  17693. // selects the route with the smallest priority value. If there is still
  17694. // a tie, it uses the layer three and four packet headers to select just
  17695. // one of the remaining matching routes. The packet is then forwarded as
  17696. // specified by the nextHop field of the winning route - either to
  17697. // another instance destination, an instance gateway, or a Google
  17698. // Compute Engine-operated gateway.
  17699. //
  17700. // Packets that do not match any route in the sending instance's routing
  17701. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  17702. // v1.routes ==)
  17703. type Route struct {
  17704. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17705. // format.
  17706. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17707. // Description: An optional description of this resource. Provide this
  17708. // property when you create the resource.
  17709. Description string `json:"description,omitempty"`
  17710. // DestRange: The destination range of outgoing packets that this route
  17711. // applies to. Only IPv4 is supported.
  17712. DestRange string `json:"destRange,omitempty"`
  17713. // Id: [Output Only] The unique identifier for the resource. This
  17714. // identifier is defined by the server.
  17715. Id uint64 `json:"id,omitempty,string"`
  17716. // Kind: [Output Only] Type of this resource. Always compute#routes for
  17717. // Route resources.
  17718. Kind string `json:"kind,omitempty"`
  17719. // Name: Name of the resource. Provided by the client when the resource
  17720. // is created. The name must be 1-63 characters long, and comply with
  17721. // RFC1035. Specifically, the name must be 1-63 characters long and
  17722. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  17723. // the first character must be a lowercase letter, and all following
  17724. // characters must be a dash, lowercase letter, or digit, except the
  17725. // last character, which cannot be a dash.
  17726. Name string `json:"name,omitempty"`
  17727. // Network: Fully-qualified URL of the network that this route applies
  17728. // to.
  17729. Network string `json:"network,omitempty"`
  17730. // NextHopGateway: The URL to a gateway that should handle matching
  17731. // packets. You can only specify the internet gateway using a full or
  17732. // partial valid URL:
  17733. // projects/<project-id>/global/gateways/default-internet-gateway
  17734. NextHopGateway string `json:"nextHopGateway,omitempty"`
  17735. // NextHopInstance: The URL to an instance that should handle matching
  17736. // packets. You can specify this as a full or partial URL. For
  17737. // example:
  17738. // https://www.googleapis.com/compute/v1/projects/project/zones/
  17739. // zone/instances/
  17740. NextHopInstance string `json:"nextHopInstance,omitempty"`
  17741. // NextHopIp: The network IP address of an instance that should handle
  17742. // matching packets. Only IPv4 is supported.
  17743. NextHopIp string `json:"nextHopIp,omitempty"`
  17744. // NextHopNetwork: The URL of the local network if it should handle
  17745. // matching packets.
  17746. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  17747. // NextHopPeering: [Output Only] The network peering name that should
  17748. // handle matching packets, which should conform to RFC1035.
  17749. NextHopPeering string `json:"nextHopPeering,omitempty"`
  17750. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  17751. // packets.
  17752. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  17753. // Priority: The priority of this route. Priority is used to break ties
  17754. // in cases where there is more than one matching route of equal prefix
  17755. // length. In the case of two routes with equal prefix length, the one
  17756. // with the lowest-numbered priority value wins. Default value is 1000.
  17757. // Valid range is 0 through 65535.
  17758. Priority int64 `json:"priority,omitempty"`
  17759. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  17760. // resource.
  17761. SelfLink string `json:"selfLink,omitempty"`
  17762. // Tags: A list of instance tags to which this route applies.
  17763. Tags []string `json:"tags,omitempty"`
  17764. // Warnings: [Output Only] If potential misconfigurations are detected
  17765. // for this route, this field will be populated with warning messages.
  17766. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  17767. // ServerResponse contains the HTTP response code and headers from the
  17768. // server.
  17769. googleapi.ServerResponse `json:"-"`
  17770. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17771. // to unconditionally include in API requests. By default, fields with
  17772. // empty values are omitted from API requests. However, any non-pointer,
  17773. // non-interface field appearing in ForceSendFields will be sent to the
  17774. // server regardless of whether the field is empty or not. This may be
  17775. // used to include empty fields in Patch requests.
  17776. ForceSendFields []string `json:"-"`
  17777. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17778. // include in API requests with the JSON null value. By default, fields
  17779. // with empty values are omitted from API requests. However, any field
  17780. // with an empty value appearing in NullFields will be sent to the
  17781. // server as null. It is an error if a field in this list has a
  17782. // non-empty value. This may be used to include null fields in Patch
  17783. // requests.
  17784. NullFields []string `json:"-"`
  17785. }
  17786. func (s *Route) MarshalJSON() ([]byte, error) {
  17787. type NoMethod Route
  17788. raw := NoMethod(*s)
  17789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17790. }
  17791. type RouteWarnings struct {
  17792. // Code: [Output Only] A warning code, if applicable. For example,
  17793. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17794. // the response.
  17795. //
  17796. // Possible values:
  17797. // "CLEANUP_FAILED"
  17798. // "DEPRECATED_RESOURCE_USED"
  17799. // "DEPRECATED_TYPE_USED"
  17800. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17801. // "EXPERIMENTAL_TYPE_USED"
  17802. // "EXTERNAL_API_WARNING"
  17803. // "FIELD_VALUE_OVERRIDEN"
  17804. // "INJECTED_KERNELS_DEPRECATED"
  17805. // "MISSING_TYPE_DEPENDENCY"
  17806. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17807. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17808. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17809. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17810. // "NEXT_HOP_NOT_RUNNING"
  17811. // "NOT_CRITICAL_ERROR"
  17812. // "NO_RESULTS_ON_PAGE"
  17813. // "REQUIRED_TOS_AGREEMENT"
  17814. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17815. // "RESOURCE_NOT_DELETED"
  17816. // "SCHEMA_VALIDATION_IGNORED"
  17817. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17818. // "UNDECLARED_PROPERTIES"
  17819. // "UNREACHABLE"
  17820. Code string `json:"code,omitempty"`
  17821. // Data: [Output Only] Metadata about this warning in key: value format.
  17822. // For example:
  17823. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17824. Data []*RouteWarningsData `json:"data,omitempty"`
  17825. // Message: [Output Only] A human-readable description of the warning
  17826. // code.
  17827. Message string `json:"message,omitempty"`
  17828. // ForceSendFields is a list of field names (e.g. "Code") to
  17829. // unconditionally include in API requests. By default, fields with
  17830. // empty values are omitted from API requests. However, any non-pointer,
  17831. // non-interface field appearing in ForceSendFields will be sent to the
  17832. // server regardless of whether the field is empty or not. This may be
  17833. // used to include empty fields in Patch requests.
  17834. ForceSendFields []string `json:"-"`
  17835. // NullFields is a list of field names (e.g. "Code") to include in API
  17836. // requests with the JSON null value. By default, fields with empty
  17837. // values are omitted from API requests. However, any field with an
  17838. // empty value appearing in NullFields will be sent to the server as
  17839. // null. It is an error if a field in this list has a non-empty value.
  17840. // This may be used to include null fields in Patch requests.
  17841. NullFields []string `json:"-"`
  17842. }
  17843. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  17844. type NoMethod RouteWarnings
  17845. raw := NoMethod(*s)
  17846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17847. }
  17848. type RouteWarningsData struct {
  17849. // Key: [Output Only] A key that provides more detail on the warning
  17850. // being returned. For example, for warnings where there are no results
  17851. // in a list request for a particular zone, this key might be scope and
  17852. // the key value might be the zone name. Other examples might be a key
  17853. // indicating a deprecated resource and a suggested replacement, or a
  17854. // warning about invalid network settings (for example, if an instance
  17855. // attempts to perform IP forwarding but is not enabled for IP
  17856. // forwarding).
  17857. Key string `json:"key,omitempty"`
  17858. // Value: [Output Only] A warning data value corresponding to the key.
  17859. Value string `json:"value,omitempty"`
  17860. // ForceSendFields is a list of field names (e.g. "Key") to
  17861. // unconditionally include in API requests. By default, fields with
  17862. // empty values are omitted from API requests. However, any non-pointer,
  17863. // non-interface field appearing in ForceSendFields will be sent to the
  17864. // server regardless of whether the field is empty or not. This may be
  17865. // used to include empty fields in Patch requests.
  17866. ForceSendFields []string `json:"-"`
  17867. // NullFields is a list of field names (e.g. "Key") to include in API
  17868. // requests with the JSON null value. By default, fields with empty
  17869. // values are omitted from API requests. However, any field with an
  17870. // empty value appearing in NullFields will be sent to the server as
  17871. // null. It is an error if a field in this list has a non-empty value.
  17872. // This may be used to include null fields in Patch requests.
  17873. NullFields []string `json:"-"`
  17874. }
  17875. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  17876. type NoMethod RouteWarningsData
  17877. raw := NoMethod(*s)
  17878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17879. }
  17880. // RouteList: Contains a list of Route resources.
  17881. type RouteList struct {
  17882. // Id: [Output Only] Unique identifier for the resource; defined by the
  17883. // server.
  17884. Id string `json:"id,omitempty"`
  17885. // Items: A list of Route resources.
  17886. Items []*Route `json:"items,omitempty"`
  17887. // Kind: Type of resource.
  17888. Kind string `json:"kind,omitempty"`
  17889. // NextPageToken: [Output Only] This token allows you to get the next
  17890. // page of results for list requests. If the number of results is larger
  17891. // than maxResults, use the nextPageToken as a value for the query
  17892. // parameter pageToken in the next list request. Subsequent list
  17893. // requests will have their own nextPageToken to continue paging through
  17894. // the results.
  17895. NextPageToken string `json:"nextPageToken,omitempty"`
  17896. // SelfLink: [Output Only] Server-defined URL for this resource.
  17897. SelfLink string `json:"selfLink,omitempty"`
  17898. // Warning: [Output Only] Informational warning message.
  17899. Warning *RouteListWarning `json:"warning,omitempty"`
  17900. // ServerResponse contains the HTTP response code and headers from the
  17901. // server.
  17902. googleapi.ServerResponse `json:"-"`
  17903. // ForceSendFields is a list of field names (e.g. "Id") to
  17904. // unconditionally include in API requests. By default, fields with
  17905. // empty values are omitted from API requests. However, any non-pointer,
  17906. // non-interface field appearing in ForceSendFields will be sent to the
  17907. // server regardless of whether the field is empty or not. This may be
  17908. // used to include empty fields in Patch requests.
  17909. ForceSendFields []string `json:"-"`
  17910. // NullFields is a list of field names (e.g. "Id") to include in API
  17911. // requests with the JSON null value. By default, fields with empty
  17912. // values are omitted from API requests. However, any field with an
  17913. // empty value appearing in NullFields will be sent to the server as
  17914. // null. It is an error if a field in this list has a non-empty value.
  17915. // This may be used to include null fields in Patch requests.
  17916. NullFields []string `json:"-"`
  17917. }
  17918. func (s *RouteList) MarshalJSON() ([]byte, error) {
  17919. type NoMethod RouteList
  17920. raw := NoMethod(*s)
  17921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17922. }
  17923. // RouteListWarning: [Output Only] Informational warning message.
  17924. type RouteListWarning struct {
  17925. // Code: [Output Only] A warning code, if applicable. For example,
  17926. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17927. // the response.
  17928. //
  17929. // Possible values:
  17930. // "CLEANUP_FAILED"
  17931. // "DEPRECATED_RESOURCE_USED"
  17932. // "DEPRECATED_TYPE_USED"
  17933. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17934. // "EXPERIMENTAL_TYPE_USED"
  17935. // "EXTERNAL_API_WARNING"
  17936. // "FIELD_VALUE_OVERRIDEN"
  17937. // "INJECTED_KERNELS_DEPRECATED"
  17938. // "MISSING_TYPE_DEPENDENCY"
  17939. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17940. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17941. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17942. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17943. // "NEXT_HOP_NOT_RUNNING"
  17944. // "NOT_CRITICAL_ERROR"
  17945. // "NO_RESULTS_ON_PAGE"
  17946. // "REQUIRED_TOS_AGREEMENT"
  17947. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17948. // "RESOURCE_NOT_DELETED"
  17949. // "SCHEMA_VALIDATION_IGNORED"
  17950. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17951. // "UNDECLARED_PROPERTIES"
  17952. // "UNREACHABLE"
  17953. Code string `json:"code,omitempty"`
  17954. // Data: [Output Only] Metadata about this warning in key: value format.
  17955. // For example:
  17956. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17957. Data []*RouteListWarningData `json:"data,omitempty"`
  17958. // Message: [Output Only] A human-readable description of the warning
  17959. // code.
  17960. Message string `json:"message,omitempty"`
  17961. // ForceSendFields is a list of field names (e.g. "Code") to
  17962. // unconditionally include in API requests. By default, fields with
  17963. // empty values are omitted from API requests. However, any non-pointer,
  17964. // non-interface field appearing in ForceSendFields will be sent to the
  17965. // server regardless of whether the field is empty or not. This may be
  17966. // used to include empty fields in Patch requests.
  17967. ForceSendFields []string `json:"-"`
  17968. // NullFields is a list of field names (e.g. "Code") to include in API
  17969. // requests with the JSON null value. By default, fields with empty
  17970. // values are omitted from API requests. However, any field with an
  17971. // empty value appearing in NullFields will be sent to the server as
  17972. // null. It is an error if a field in this list has a non-empty value.
  17973. // This may be used to include null fields in Patch requests.
  17974. NullFields []string `json:"-"`
  17975. }
  17976. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  17977. type NoMethod RouteListWarning
  17978. raw := NoMethod(*s)
  17979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17980. }
  17981. type RouteListWarningData struct {
  17982. // Key: [Output Only] A key that provides more detail on the warning
  17983. // being returned. For example, for warnings where there are no results
  17984. // in a list request for a particular zone, this key might be scope and
  17985. // the key value might be the zone name. Other examples might be a key
  17986. // indicating a deprecated resource and a suggested replacement, or a
  17987. // warning about invalid network settings (for example, if an instance
  17988. // attempts to perform IP forwarding but is not enabled for IP
  17989. // forwarding).
  17990. Key string `json:"key,omitempty"`
  17991. // Value: [Output Only] A warning data value corresponding to the key.
  17992. Value string `json:"value,omitempty"`
  17993. // ForceSendFields is a list of field names (e.g. "Key") to
  17994. // unconditionally include in API requests. By default, fields with
  17995. // empty values are omitted from API requests. However, any non-pointer,
  17996. // non-interface field appearing in ForceSendFields will be sent to the
  17997. // server regardless of whether the field is empty or not. This may be
  17998. // used to include empty fields in Patch requests.
  17999. ForceSendFields []string `json:"-"`
  18000. // NullFields is a list of field names (e.g. "Key") to include in API
  18001. // requests with the JSON null value. By default, fields with empty
  18002. // values are omitted from API requests. However, any field with an
  18003. // empty value appearing in NullFields will be sent to the server as
  18004. // null. It is an error if a field in this list has a non-empty value.
  18005. // This may be used to include null fields in Patch requests.
  18006. NullFields []string `json:"-"`
  18007. }
  18008. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  18009. type NoMethod RouteListWarningData
  18010. raw := NoMethod(*s)
  18011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18012. }
  18013. // Router: Router resource.
  18014. type Router struct {
  18015. // Bgp: BGP information specific to this router.
  18016. Bgp *RouterBgp `json:"bgp,omitempty"`
  18017. // BgpPeers: BGP information that needs to be configured into the
  18018. // routing stack to establish the BGP peering. It must specify peer ASN
  18019. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  18020. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  18021. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18022. // format.
  18023. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18024. // Description: An optional description of this resource. Provide this
  18025. // property when you create the resource.
  18026. Description string `json:"description,omitempty"`
  18027. // Id: [Output Only] The unique identifier for the resource. This
  18028. // identifier is defined by the server.
  18029. Id uint64 `json:"id,omitempty,string"`
  18030. // Interfaces: Router interfaces. Each interface requires either one
  18031. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  18032. // range (e.g. ipRange), or both.
  18033. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  18034. // Kind: [Output Only] Type of resource. Always compute#router for
  18035. // routers.
  18036. Kind string `json:"kind,omitempty"`
  18037. // Name: Name of the resource. Provided by the client when the resource
  18038. // is created. The name must be 1-63 characters long, and comply with
  18039. // RFC1035. Specifically, the name must be 1-63 characters long and
  18040. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18041. // the first character must be a lowercase letter, and all following
  18042. // characters must be a dash, lowercase letter, or digit, except the
  18043. // last character, which cannot be a dash.
  18044. Name string `json:"name,omitempty"`
  18045. // Nats: A list of Nat services created in this router.
  18046. Nats []*RouterNat `json:"nats,omitempty"`
  18047. // Network: URI of the network to which this router belongs.
  18048. Network string `json:"network,omitempty"`
  18049. // Region: [Output Only] URI of the region where the router resides. You
  18050. // must specify this field as part of the HTTP request URL. It is not
  18051. // settable as a field in the request body.
  18052. Region string `json:"region,omitempty"`
  18053. // SelfLink: [Output Only] Server-defined URL for the resource.
  18054. SelfLink string `json:"selfLink,omitempty"`
  18055. // ServerResponse contains the HTTP response code and headers from the
  18056. // server.
  18057. googleapi.ServerResponse `json:"-"`
  18058. // ForceSendFields is a list of field names (e.g. "Bgp") to
  18059. // unconditionally include in API requests. By default, fields with
  18060. // empty values are omitted from API requests. However, any non-pointer,
  18061. // non-interface field appearing in ForceSendFields will be sent to the
  18062. // server regardless of whether the field is empty or not. This may be
  18063. // used to include empty fields in Patch requests.
  18064. ForceSendFields []string `json:"-"`
  18065. // NullFields is a list of field names (e.g. "Bgp") to include in API
  18066. // requests with the JSON null value. By default, fields with empty
  18067. // values are omitted from API requests. However, any field with an
  18068. // empty value appearing in NullFields will be sent to the server as
  18069. // null. It is an error if a field in this list has a non-empty value.
  18070. // This may be used to include null fields in Patch requests.
  18071. NullFields []string `json:"-"`
  18072. }
  18073. func (s *Router) MarshalJSON() ([]byte, error) {
  18074. type NoMethod Router
  18075. raw := NoMethod(*s)
  18076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18077. }
  18078. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  18079. // to advertise.
  18080. type RouterAdvertisedIpRange struct {
  18081. // Description: User-specified description for the IP range.
  18082. Description string `json:"description,omitempty"`
  18083. // Range: The IP range to advertise. The value must be a CIDR-formatted
  18084. // string.
  18085. Range string `json:"range,omitempty"`
  18086. // ForceSendFields is a list of field names (e.g. "Description") to
  18087. // unconditionally include in API requests. By default, fields with
  18088. // empty values are omitted from API requests. However, any non-pointer,
  18089. // non-interface field appearing in ForceSendFields will be sent to the
  18090. // server regardless of whether the field is empty or not. This may be
  18091. // used to include empty fields in Patch requests.
  18092. ForceSendFields []string `json:"-"`
  18093. // NullFields is a list of field names (e.g. "Description") to include
  18094. // in API requests with the JSON null value. By default, fields with
  18095. // empty values are omitted from API requests. However, any field with
  18096. // an empty value appearing in NullFields will be sent to the server as
  18097. // null. It is an error if a field in this list has a non-empty value.
  18098. // This may be used to include null fields in Patch requests.
  18099. NullFields []string `json:"-"`
  18100. }
  18101. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  18102. type NoMethod RouterAdvertisedIpRange
  18103. raw := NoMethod(*s)
  18104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18105. }
  18106. // RouterAggregatedList: Contains a list of routers.
  18107. type RouterAggregatedList struct {
  18108. // Id: [Output Only] Unique identifier for the resource; defined by the
  18109. // server.
  18110. Id string `json:"id,omitempty"`
  18111. // Items: A list of Router resources.
  18112. Items map[string]RoutersScopedList `json:"items,omitempty"`
  18113. // Kind: Type of resource.
  18114. Kind string `json:"kind,omitempty"`
  18115. // NextPageToken: [Output Only] This token allows you to get the next
  18116. // page of results for list requests. If the number of results is larger
  18117. // than maxResults, use the nextPageToken as a value for the query
  18118. // parameter pageToken in the next list request. Subsequent list
  18119. // requests will have their own nextPageToken to continue paging through
  18120. // the results.
  18121. NextPageToken string `json:"nextPageToken,omitempty"`
  18122. // SelfLink: [Output Only] Server-defined URL for this resource.
  18123. SelfLink string `json:"selfLink,omitempty"`
  18124. // Warning: [Output Only] Informational warning message.
  18125. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  18126. // ServerResponse contains the HTTP response code and headers from the
  18127. // server.
  18128. googleapi.ServerResponse `json:"-"`
  18129. // ForceSendFields is a list of field names (e.g. "Id") to
  18130. // unconditionally include in API requests. By default, fields with
  18131. // empty values are omitted from API requests. However, any non-pointer,
  18132. // non-interface field appearing in ForceSendFields will be sent to the
  18133. // server regardless of whether the field is empty or not. This may be
  18134. // used to include empty fields in Patch requests.
  18135. ForceSendFields []string `json:"-"`
  18136. // NullFields is a list of field names (e.g. "Id") to include in API
  18137. // requests with the JSON null value. By default, fields with empty
  18138. // values are omitted from API requests. However, any field with an
  18139. // empty value appearing in NullFields will be sent to the server as
  18140. // null. It is an error if a field in this list has a non-empty value.
  18141. // This may be used to include null fields in Patch requests.
  18142. NullFields []string `json:"-"`
  18143. }
  18144. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  18145. type NoMethod RouterAggregatedList
  18146. raw := NoMethod(*s)
  18147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18148. }
  18149. // RouterAggregatedListWarning: [Output Only] Informational warning
  18150. // message.
  18151. type RouterAggregatedListWarning struct {
  18152. // Code: [Output Only] A warning code, if applicable. For example,
  18153. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18154. // the response.
  18155. //
  18156. // Possible values:
  18157. // "CLEANUP_FAILED"
  18158. // "DEPRECATED_RESOURCE_USED"
  18159. // "DEPRECATED_TYPE_USED"
  18160. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18161. // "EXPERIMENTAL_TYPE_USED"
  18162. // "EXTERNAL_API_WARNING"
  18163. // "FIELD_VALUE_OVERRIDEN"
  18164. // "INJECTED_KERNELS_DEPRECATED"
  18165. // "MISSING_TYPE_DEPENDENCY"
  18166. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18167. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18168. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18169. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18170. // "NEXT_HOP_NOT_RUNNING"
  18171. // "NOT_CRITICAL_ERROR"
  18172. // "NO_RESULTS_ON_PAGE"
  18173. // "REQUIRED_TOS_AGREEMENT"
  18174. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18175. // "RESOURCE_NOT_DELETED"
  18176. // "SCHEMA_VALIDATION_IGNORED"
  18177. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18178. // "UNDECLARED_PROPERTIES"
  18179. // "UNREACHABLE"
  18180. Code string `json:"code,omitempty"`
  18181. // Data: [Output Only] Metadata about this warning in key: value format.
  18182. // For example:
  18183. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18184. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  18185. // Message: [Output Only] A human-readable description of the warning
  18186. // code.
  18187. Message string `json:"message,omitempty"`
  18188. // ForceSendFields is a list of field names (e.g. "Code") to
  18189. // unconditionally include in API requests. By default, fields with
  18190. // empty values are omitted from API requests. However, any non-pointer,
  18191. // non-interface field appearing in ForceSendFields will be sent to the
  18192. // server regardless of whether the field is empty or not. This may be
  18193. // used to include empty fields in Patch requests.
  18194. ForceSendFields []string `json:"-"`
  18195. // NullFields is a list of field names (e.g. "Code") to include in API
  18196. // requests with the JSON null value. By default, fields with empty
  18197. // values are omitted from API requests. However, any field with an
  18198. // empty value appearing in NullFields will be sent to the server as
  18199. // null. It is an error if a field in this list has a non-empty value.
  18200. // This may be used to include null fields in Patch requests.
  18201. NullFields []string `json:"-"`
  18202. }
  18203. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18204. type NoMethod RouterAggregatedListWarning
  18205. raw := NoMethod(*s)
  18206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18207. }
  18208. type RouterAggregatedListWarningData struct {
  18209. // Key: [Output Only] A key that provides more detail on the warning
  18210. // being returned. For example, for warnings where there are no results
  18211. // in a list request for a particular zone, this key might be scope and
  18212. // the key value might be the zone name. Other examples might be a key
  18213. // indicating a deprecated resource and a suggested replacement, or a
  18214. // warning about invalid network settings (for example, if an instance
  18215. // attempts to perform IP forwarding but is not enabled for IP
  18216. // forwarding).
  18217. Key string `json:"key,omitempty"`
  18218. // Value: [Output Only] A warning data value corresponding to the key.
  18219. Value string `json:"value,omitempty"`
  18220. // ForceSendFields is a list of field names (e.g. "Key") to
  18221. // unconditionally include in API requests. By default, fields with
  18222. // empty values are omitted from API requests. However, any non-pointer,
  18223. // non-interface field appearing in ForceSendFields will be sent to the
  18224. // server regardless of whether the field is empty or not. This may be
  18225. // used to include empty fields in Patch requests.
  18226. ForceSendFields []string `json:"-"`
  18227. // NullFields is a list of field names (e.g. "Key") to include in API
  18228. // requests with the JSON null value. By default, fields with empty
  18229. // values are omitted from API requests. However, any field with an
  18230. // empty value appearing in NullFields will be sent to the server as
  18231. // null. It is an error if a field in this list has a non-empty value.
  18232. // This may be used to include null fields in Patch requests.
  18233. NullFields []string `json:"-"`
  18234. }
  18235. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18236. type NoMethod RouterAggregatedListWarningData
  18237. raw := NoMethod(*s)
  18238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18239. }
  18240. type RouterBgp struct {
  18241. // AdvertiseMode: User-specified flag to indicate which mode to use for
  18242. // advertisement.
  18243. //
  18244. // Possible values:
  18245. // "CUSTOM"
  18246. // "DEFAULT"
  18247. AdvertiseMode string `json:"advertiseMode,omitempty"`
  18248. // AdvertisedGroups: User-specified list of prefix groups to advertise
  18249. // in custom mode. This field can only be populated if advertise_mode is
  18250. // CUSTOM and is advertised to all peers of the router. These groups
  18251. // will be advertised in addition to any specified prefixes. Leave this
  18252. // field blank to advertise no custom groups.
  18253. //
  18254. // Possible values:
  18255. // "ALL_SUBNETS"
  18256. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  18257. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  18258. // advertise in custom mode. This field can only be populated if
  18259. // advertise_mode is CUSTOM and is advertised to all peers of the
  18260. // router. These IP ranges will be advertised in addition to any
  18261. // specified groups. Leave this field blank to advertise no custom IP
  18262. // ranges.
  18263. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  18264. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  18265. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  18266. // this router resource. All VPN tunnels that link to this router will
  18267. // have the same local ASN.
  18268. Asn int64 `json:"asn,omitempty"`
  18269. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  18270. // unconditionally include in API requests. By default, fields with
  18271. // empty values are omitted from API requests. However, any non-pointer,
  18272. // non-interface field appearing in ForceSendFields will be sent to the
  18273. // server regardless of whether the field is empty or not. This may be
  18274. // used to include empty fields in Patch requests.
  18275. ForceSendFields []string `json:"-"`
  18276. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  18277. // in API requests with the JSON null value. By default, fields with
  18278. // empty values are omitted from API requests. However, any field with
  18279. // an empty value appearing in NullFields will be sent to the server as
  18280. // null. It is an error if a field in this list has a non-empty value.
  18281. // This may be used to include null fields in Patch requests.
  18282. NullFields []string `json:"-"`
  18283. }
  18284. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  18285. type NoMethod RouterBgp
  18286. raw := NoMethod(*s)
  18287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18288. }
  18289. type RouterBgpPeer struct {
  18290. // AdvertiseMode: User-specified flag to indicate which mode to use for
  18291. // advertisement.
  18292. //
  18293. // Possible values:
  18294. // "CUSTOM"
  18295. // "DEFAULT"
  18296. AdvertiseMode string `json:"advertiseMode,omitempty"`
  18297. // AdvertisedGroups: User-specified list of prefix groups to advertise
  18298. // in custom mode. This field can only be populated if advertise_mode is
  18299. // CUSTOM and overrides the list defined for the router (in Bgp
  18300. // message). These groups will be advertised in addition to any
  18301. // specified prefixes. Leave this field blank to advertise no custom
  18302. // groups.
  18303. //
  18304. // Possible values:
  18305. // "ALL_SUBNETS"
  18306. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  18307. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  18308. // advertise in custom mode. This field can only be populated if
  18309. // advertise_mode is CUSTOM and overrides the list defined for the
  18310. // router (in Bgp message). These IP ranges will be advertised in
  18311. // addition to any specified groups. Leave this field blank to advertise
  18312. // no custom IP ranges.
  18313. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  18314. // AdvertisedRoutePriority: The priority of routes advertised to this
  18315. // BGP peer. In the case where there is more than one matching route of
  18316. // maximum length, the routes with lowest priority value win.
  18317. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  18318. // InterfaceName: Name of the interface the BGP peer is associated with.
  18319. InterfaceName string `json:"interfaceName,omitempty"`
  18320. // IpAddress: IP address of the interface inside Google Cloud Platform.
  18321. // Only IPv4 is supported.
  18322. IpAddress string `json:"ipAddress,omitempty"`
  18323. // ManagementType: [Output Only] The resource that configures and
  18324. // manages this BGP peer. MANAGED_BY_USER is the default value and can
  18325. // be managed by you or other users; MANAGED_BY_ATTACHMENT is a BGP peer
  18326. // that is configured and managed by Cloud Interconnect, specifically by
  18327. // an InterconnectAttachment of type PARTNER. Google will automatically
  18328. // create, update, and delete this type of BGP peer when the PARTNER
  18329. // InterconnectAttachment is created, updated, or deleted.
  18330. //
  18331. // Possible values:
  18332. // "MANAGED_BY_ATTACHMENT"
  18333. // "MANAGED_BY_USER"
  18334. ManagementType string `json:"managementType,omitempty"`
  18335. // Name: Name of this BGP peer. The name must be 1-63 characters long
  18336. // and comply with RFC1035.
  18337. Name string `json:"name,omitempty"`
  18338. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  18339. // this value can be different for every tunnel.
  18340. PeerAsn int64 `json:"peerAsn,omitempty"`
  18341. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  18342. // Only IPv4 is supported.
  18343. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  18344. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  18345. // unconditionally include in API requests. By default, fields with
  18346. // empty values are omitted from API requests. However, any non-pointer,
  18347. // non-interface field appearing in ForceSendFields will be sent to the
  18348. // server regardless of whether the field is empty or not. This may be
  18349. // used to include empty fields in Patch requests.
  18350. ForceSendFields []string `json:"-"`
  18351. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  18352. // in API requests with the JSON null value. By default, fields with
  18353. // empty values are omitted from API requests. However, any field with
  18354. // an empty value appearing in NullFields will be sent to the server as
  18355. // null. It is an error if a field in this list has a non-empty value.
  18356. // This may be used to include null fields in Patch requests.
  18357. NullFields []string `json:"-"`
  18358. }
  18359. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  18360. type NoMethod RouterBgpPeer
  18361. raw := NoMethod(*s)
  18362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18363. }
  18364. type RouterInterface struct {
  18365. // IpRange: IP address and range of the interface. The IP range must be
  18366. // in the RFC3927 link-local IP space. The value must be a
  18367. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  18368. // truncate the address as it represents the IP address of the
  18369. // interface.
  18370. IpRange string `json:"ipRange,omitempty"`
  18371. // LinkedInterconnectAttachment: URI of the linked interconnect
  18372. // attachment. It must be in the same region as the router. Each
  18373. // interface can have at most one linked resource and it could either be
  18374. // a VPN Tunnel or an interconnect attachment.
  18375. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  18376. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  18377. // region as the router. Each interface can have at most one linked
  18378. // resource and it could either be a VPN Tunnel or an interconnect
  18379. // attachment.
  18380. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  18381. // ManagementType: [Output Only] The resource that configures and
  18382. // manages this interface. MANAGED_BY_USER is the default value and can
  18383. // be managed by you or other users; MANAGED_BY_ATTACHMENT is an
  18384. // interface that is configured and managed by Cloud Interconnect,
  18385. // specifically by an InterconnectAttachment of type PARTNER. Google
  18386. // will automatically create, update, and delete this type of interface
  18387. // when the PARTNER InterconnectAttachment is created, updated, or
  18388. // deleted.
  18389. //
  18390. // Possible values:
  18391. // "MANAGED_BY_ATTACHMENT"
  18392. // "MANAGED_BY_USER"
  18393. ManagementType string `json:"managementType,omitempty"`
  18394. // Name: Name of this interface entry. The name must be 1-63 characters
  18395. // long and comply with RFC1035.
  18396. Name string `json:"name,omitempty"`
  18397. // ForceSendFields is a list of field names (e.g. "IpRange") to
  18398. // unconditionally include in API requests. By default, fields with
  18399. // empty values are omitted from API requests. However, any non-pointer,
  18400. // non-interface field appearing in ForceSendFields will be sent to the
  18401. // server regardless of whether the field is empty or not. This may be
  18402. // used to include empty fields in Patch requests.
  18403. ForceSendFields []string `json:"-"`
  18404. // NullFields is a list of field names (e.g. "IpRange") to include in
  18405. // API requests with the JSON null value. By default, fields with empty
  18406. // values are omitted from API requests. However, any field with an
  18407. // empty value appearing in NullFields will be sent to the server as
  18408. // null. It is an error if a field in this list has a non-empty value.
  18409. // This may be used to include null fields in Patch requests.
  18410. NullFields []string `json:"-"`
  18411. }
  18412. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  18413. type NoMethod RouterInterface
  18414. raw := NoMethod(*s)
  18415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18416. }
  18417. // RouterList: Contains a list of Router resources.
  18418. type RouterList struct {
  18419. // Id: [Output Only] Unique identifier for the resource; defined by the
  18420. // server.
  18421. Id string `json:"id,omitempty"`
  18422. // Items: A list of Router resources.
  18423. Items []*Router `json:"items,omitempty"`
  18424. // Kind: [Output Only] Type of resource. Always compute#router for
  18425. // routers.
  18426. Kind string `json:"kind,omitempty"`
  18427. // NextPageToken: [Output Only] This token allows you to get the next
  18428. // page of results for list requests. If the number of results is larger
  18429. // than maxResults, use the nextPageToken as a value for the query
  18430. // parameter pageToken in the next list request. Subsequent list
  18431. // requests will have their own nextPageToken to continue paging through
  18432. // the results.
  18433. NextPageToken string `json:"nextPageToken,omitempty"`
  18434. // SelfLink: [Output Only] Server-defined URL for this resource.
  18435. SelfLink string `json:"selfLink,omitempty"`
  18436. // Warning: [Output Only] Informational warning message.
  18437. Warning *RouterListWarning `json:"warning,omitempty"`
  18438. // ServerResponse contains the HTTP response code and headers from the
  18439. // server.
  18440. googleapi.ServerResponse `json:"-"`
  18441. // ForceSendFields is a list of field names (e.g. "Id") to
  18442. // unconditionally include in API requests. By default, fields with
  18443. // empty values are omitted from API requests. However, any non-pointer,
  18444. // non-interface field appearing in ForceSendFields will be sent to the
  18445. // server regardless of whether the field is empty or not. This may be
  18446. // used to include empty fields in Patch requests.
  18447. ForceSendFields []string `json:"-"`
  18448. // NullFields is a list of field names (e.g. "Id") to include in API
  18449. // requests with the JSON null value. By default, fields with empty
  18450. // values are omitted from API requests. However, any field with an
  18451. // empty value appearing in NullFields will be sent to the server as
  18452. // null. It is an error if a field in this list has a non-empty value.
  18453. // This may be used to include null fields in Patch requests.
  18454. NullFields []string `json:"-"`
  18455. }
  18456. func (s *RouterList) MarshalJSON() ([]byte, error) {
  18457. type NoMethod RouterList
  18458. raw := NoMethod(*s)
  18459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18460. }
  18461. // RouterListWarning: [Output Only] Informational warning message.
  18462. type RouterListWarning struct {
  18463. // Code: [Output Only] A warning code, if applicable. For example,
  18464. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18465. // the response.
  18466. //
  18467. // Possible values:
  18468. // "CLEANUP_FAILED"
  18469. // "DEPRECATED_RESOURCE_USED"
  18470. // "DEPRECATED_TYPE_USED"
  18471. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18472. // "EXPERIMENTAL_TYPE_USED"
  18473. // "EXTERNAL_API_WARNING"
  18474. // "FIELD_VALUE_OVERRIDEN"
  18475. // "INJECTED_KERNELS_DEPRECATED"
  18476. // "MISSING_TYPE_DEPENDENCY"
  18477. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18478. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18479. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18480. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18481. // "NEXT_HOP_NOT_RUNNING"
  18482. // "NOT_CRITICAL_ERROR"
  18483. // "NO_RESULTS_ON_PAGE"
  18484. // "REQUIRED_TOS_AGREEMENT"
  18485. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18486. // "RESOURCE_NOT_DELETED"
  18487. // "SCHEMA_VALIDATION_IGNORED"
  18488. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18489. // "UNDECLARED_PROPERTIES"
  18490. // "UNREACHABLE"
  18491. Code string `json:"code,omitempty"`
  18492. // Data: [Output Only] Metadata about this warning in key: value format.
  18493. // For example:
  18494. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18495. Data []*RouterListWarningData `json:"data,omitempty"`
  18496. // Message: [Output Only] A human-readable description of the warning
  18497. // code.
  18498. Message string `json:"message,omitempty"`
  18499. // ForceSendFields is a list of field names (e.g. "Code") to
  18500. // unconditionally include in API requests. By default, fields with
  18501. // empty values are omitted from API requests. However, any non-pointer,
  18502. // non-interface field appearing in ForceSendFields will be sent to the
  18503. // server regardless of whether the field is empty or not. This may be
  18504. // used to include empty fields in Patch requests.
  18505. ForceSendFields []string `json:"-"`
  18506. // NullFields is a list of field names (e.g. "Code") to include in API
  18507. // requests with the JSON null value. By default, fields with empty
  18508. // values are omitted from API requests. However, any field with an
  18509. // empty value appearing in NullFields will be sent to the server as
  18510. // null. It is an error if a field in this list has a non-empty value.
  18511. // This may be used to include null fields in Patch requests.
  18512. NullFields []string `json:"-"`
  18513. }
  18514. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  18515. type NoMethod RouterListWarning
  18516. raw := NoMethod(*s)
  18517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18518. }
  18519. type RouterListWarningData struct {
  18520. // Key: [Output Only] A key that provides more detail on the warning
  18521. // being returned. For example, for warnings where there are no results
  18522. // in a list request for a particular zone, this key might be scope and
  18523. // the key value might be the zone name. Other examples might be a key
  18524. // indicating a deprecated resource and a suggested replacement, or a
  18525. // warning about invalid network settings (for example, if an instance
  18526. // attempts to perform IP forwarding but is not enabled for IP
  18527. // forwarding).
  18528. Key string `json:"key,omitempty"`
  18529. // Value: [Output Only] A warning data value corresponding to the key.
  18530. Value string `json:"value,omitempty"`
  18531. // ForceSendFields is a list of field names (e.g. "Key") to
  18532. // unconditionally include in API requests. By default, fields with
  18533. // empty values are omitted from API requests. However, any non-pointer,
  18534. // non-interface field appearing in ForceSendFields will be sent to the
  18535. // server regardless of whether the field is empty or not. This may be
  18536. // used to include empty fields in Patch requests.
  18537. ForceSendFields []string `json:"-"`
  18538. // NullFields is a list of field names (e.g. "Key") to include in API
  18539. // requests with the JSON null value. By default, fields with empty
  18540. // values are omitted from API requests. However, any field with an
  18541. // empty value appearing in NullFields will be sent to the server as
  18542. // null. It is an error if a field in this list has a non-empty value.
  18543. // This may be used to include null fields in Patch requests.
  18544. NullFields []string `json:"-"`
  18545. }
  18546. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  18547. type NoMethod RouterListWarningData
  18548. raw := NoMethod(*s)
  18549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18550. }
  18551. // RouterNat: Represents a Nat resource. It enables the VMs within the
  18552. // specified subnetworks to access Internet without external IP
  18553. // addresses. It specifies a list of subnetworks (and the ranges within)
  18554. // that want to use NAT. Customers can also provide the external IPs
  18555. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  18556. // no external IPs are provided.
  18557. type RouterNat struct {
  18558. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  18559. // Defaults to 30s if not set.
  18560. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  18561. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  18562. // NAT config. If not set, a default number of ports is allocated to a
  18563. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  18564. // of this field is 50, at least 64 ports will be allocated to a VM.
  18565. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  18566. // Name: Unique name of this Nat service. The name must be 1-63
  18567. // characters long and comply with RFC1035.
  18568. Name string `json:"name,omitempty"`
  18569. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  18570. // AUTO_ONLY, then nat_ip should be empty.
  18571. //
  18572. // Possible values:
  18573. // "AUTO_ONLY"
  18574. // "MANUAL_ONLY"
  18575. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  18576. // NatIps: A list of URLs of the IP resources used for this Nat service.
  18577. // These IPs must be valid static external IP addresses assigned to the
  18578. // project. max_length is subject to change post alpha.
  18579. NatIps []string `json:"natIps,omitempty"`
  18580. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  18581. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  18582. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  18583. // other Router.Nat section in any Router for this network in this
  18584. // region.
  18585. //
  18586. // Possible values:
  18587. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  18588. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  18589. // "LIST_OF_SUBNETWORKS"
  18590. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  18591. // Subnetworks: A list of Subnetwork resources whose traffic should be
  18592. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  18593. // is selected for the SubnetworkIpRangeToNatOption above.
  18594. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  18595. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  18596. // established connections. Defaults to 1200s if not set.
  18597. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  18598. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  18599. // connections. Defaults to 30s if not set.
  18600. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  18601. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  18602. // to 30s if not set.
  18603. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  18604. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  18605. // to unconditionally include in API requests. By default, fields with
  18606. // empty values are omitted from API requests. However, any non-pointer,
  18607. // non-interface field appearing in ForceSendFields will be sent to the
  18608. // server regardless of whether the field is empty or not. This may be
  18609. // used to include empty fields in Patch requests.
  18610. ForceSendFields []string `json:"-"`
  18611. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  18612. // include in API requests with the JSON null value. By default, fields
  18613. // with empty values are omitted from API requests. However, any field
  18614. // with an empty value appearing in NullFields will be sent to the
  18615. // server as null. It is an error if a field in this list has a
  18616. // non-empty value. This may be used to include null fields in Patch
  18617. // requests.
  18618. NullFields []string `json:"-"`
  18619. }
  18620. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  18621. type NoMethod RouterNat
  18622. raw := NoMethod(*s)
  18623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18624. }
  18625. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  18626. // for a subnetwork.
  18627. type RouterNatSubnetworkToNat struct {
  18628. // Name: URL for the subnetwork resource to use NAT.
  18629. Name string `json:"name,omitempty"`
  18630. // SecondaryIpRangeNames: A list of the secondary ranges of the
  18631. // Subnetwork that are allowed to use NAT. This can be populated only if
  18632. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  18633. // source_ip_ranges_to_nat.
  18634. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  18635. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  18636. // Subnetwork. All usages of single value are valid except
  18637. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  18638. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  18639. // Default: [ALL_IP_RANGES]
  18640. //
  18641. // Possible values:
  18642. // "ALL_IP_RANGES"
  18643. // "LIST_OF_SECONDARY_IP_RANGES"
  18644. // "PRIMARY_IP_RANGE"
  18645. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  18646. // ForceSendFields is a list of field names (e.g. "Name") to
  18647. // unconditionally include in API requests. By default, fields with
  18648. // empty values are omitted from API requests. However, any non-pointer,
  18649. // non-interface field appearing in ForceSendFields will be sent to the
  18650. // server regardless of whether the field is empty or not. This may be
  18651. // used to include empty fields in Patch requests.
  18652. ForceSendFields []string `json:"-"`
  18653. // NullFields is a list of field names (e.g. "Name") to include in API
  18654. // requests with the JSON null value. By default, fields with empty
  18655. // values are omitted from API requests. However, any field with an
  18656. // empty value appearing in NullFields will be sent to the server as
  18657. // null. It is an error if a field in this list has a non-empty value.
  18658. // This may be used to include null fields in Patch requests.
  18659. NullFields []string `json:"-"`
  18660. }
  18661. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  18662. type NoMethod RouterNatSubnetworkToNat
  18663. raw := NoMethod(*s)
  18664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18665. }
  18666. type RouterStatus struct {
  18667. // BestRoutes: Best routes for this router's network.
  18668. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  18669. // BestRoutesForRouter: Best routes learned by this router.
  18670. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  18671. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  18672. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  18673. // Network: URI of the network to which this router belongs.
  18674. Network string `json:"network,omitempty"`
  18675. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  18676. // unconditionally include in API requests. By default, fields with
  18677. // empty values are omitted from API requests. However, any non-pointer,
  18678. // non-interface field appearing in ForceSendFields will be sent to the
  18679. // server regardless of whether the field is empty or not. This may be
  18680. // used to include empty fields in Patch requests.
  18681. ForceSendFields []string `json:"-"`
  18682. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  18683. // API requests with the JSON null value. By default, fields with empty
  18684. // values are omitted from API requests. However, any field with an
  18685. // empty value appearing in NullFields will be sent to the server as
  18686. // null. It is an error if a field in this list has a non-empty value.
  18687. // This may be used to include null fields in Patch requests.
  18688. NullFields []string `json:"-"`
  18689. }
  18690. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  18691. type NoMethod RouterStatus
  18692. raw := NoMethod(*s)
  18693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18694. }
  18695. type RouterStatusBgpPeerStatus struct {
  18696. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  18697. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  18698. // IpAddress: IP address of the local BGP interface.
  18699. IpAddress string `json:"ipAddress,omitempty"`
  18700. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  18701. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  18702. // Name: Name of this BGP peer. Unique within the Routers resource.
  18703. Name string `json:"name,omitempty"`
  18704. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  18705. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  18706. // PeerIpAddress: IP address of the remote BGP interface.
  18707. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  18708. // State: BGP state as specified in RFC1771.
  18709. State string `json:"state,omitempty"`
  18710. // Status: Status of the BGP peer: {UP, DOWN}
  18711. //
  18712. // Possible values:
  18713. // "DOWN"
  18714. // "UNKNOWN"
  18715. // "UP"
  18716. Status string `json:"status,omitempty"`
  18717. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  18718. // days, 23 hours, 59 minutes, 59 seconds
  18719. Uptime string `json:"uptime,omitempty"`
  18720. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  18721. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  18722. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  18723. // unconditionally include in API requests. By default, fields with
  18724. // empty values are omitted from API requests. However, any non-pointer,
  18725. // non-interface field appearing in ForceSendFields will be sent to the
  18726. // server regardless of whether the field is empty or not. This may be
  18727. // used to include empty fields in Patch requests.
  18728. ForceSendFields []string `json:"-"`
  18729. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  18730. // include in API requests with the JSON null value. By default, fields
  18731. // with empty values are omitted from API requests. However, any field
  18732. // with an empty value appearing in NullFields will be sent to the
  18733. // server as null. It is an error if a field in this list has a
  18734. // non-empty value. This may be used to include null fields in Patch
  18735. // requests.
  18736. NullFields []string `json:"-"`
  18737. }
  18738. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  18739. type NoMethod RouterStatusBgpPeerStatus
  18740. raw := NoMethod(*s)
  18741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18742. }
  18743. // RouterStatusNatStatus: Status of a NAT contained in this router.
  18744. type RouterStatusNatStatus struct {
  18745. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  18746. // ["1.1.1.1", "129.2.16.89"]
  18747. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  18748. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  18749. // be greater than 0 only if user-specified IPs are NOT enough to allow
  18750. // all configured VMs to use NAT. This value is meaningful only when
  18751. // auto-allocation of NAT IPs is *not* used.
  18752. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  18753. // Name: Unique name of this NAT.
  18754. Name string `json:"name,omitempty"`
  18755. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  18756. // that can use NAT.
  18757. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  18758. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  18759. // reserved IP address resources.
  18760. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  18761. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  18762. // be raw IP strings like "179.12.26.133".
  18763. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  18764. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  18765. // to unconditionally include in API requests. By default, fields with
  18766. // empty values are omitted from API requests. However, any non-pointer,
  18767. // non-interface field appearing in ForceSendFields will be sent to the
  18768. // server regardless of whether the field is empty or not. This may be
  18769. // used to include empty fields in Patch requests.
  18770. ForceSendFields []string `json:"-"`
  18771. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  18772. // include in API requests with the JSON null value. By default, fields
  18773. // with empty values are omitted from API requests. However, any field
  18774. // with an empty value appearing in NullFields will be sent to the
  18775. // server as null. It is an error if a field in this list has a
  18776. // non-empty value. This may be used to include null fields in Patch
  18777. // requests.
  18778. NullFields []string `json:"-"`
  18779. }
  18780. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  18781. type NoMethod RouterStatusNatStatus
  18782. raw := NoMethod(*s)
  18783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18784. }
  18785. type RouterStatusResponse struct {
  18786. // Kind: Type of resource.
  18787. Kind string `json:"kind,omitempty"`
  18788. Result *RouterStatus `json:"result,omitempty"`
  18789. // ServerResponse contains the HTTP response code and headers from the
  18790. // server.
  18791. googleapi.ServerResponse `json:"-"`
  18792. // ForceSendFields is a list of field names (e.g. "Kind") to
  18793. // unconditionally include in API requests. By default, fields with
  18794. // empty values are omitted from API requests. However, any non-pointer,
  18795. // non-interface field appearing in ForceSendFields will be sent to the
  18796. // server regardless of whether the field is empty or not. This may be
  18797. // used to include empty fields in Patch requests.
  18798. ForceSendFields []string `json:"-"`
  18799. // NullFields is a list of field names (e.g. "Kind") to include in API
  18800. // requests with the JSON null value. By default, fields with empty
  18801. // values are omitted from API requests. However, any field with an
  18802. // empty value appearing in NullFields will be sent to the server as
  18803. // null. It is an error if a field in this list has a non-empty value.
  18804. // This may be used to include null fields in Patch requests.
  18805. NullFields []string `json:"-"`
  18806. }
  18807. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  18808. type NoMethod RouterStatusResponse
  18809. raw := NoMethod(*s)
  18810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18811. }
  18812. type RoutersPreviewResponse struct {
  18813. // Resource: Preview of given router.
  18814. Resource *Router `json:"resource,omitempty"`
  18815. // ServerResponse contains the HTTP response code and headers from the
  18816. // server.
  18817. googleapi.ServerResponse `json:"-"`
  18818. // ForceSendFields is a list of field names (e.g. "Resource") to
  18819. // unconditionally include in API requests. By default, fields with
  18820. // empty values are omitted from API requests. However, any non-pointer,
  18821. // non-interface field appearing in ForceSendFields will be sent to the
  18822. // server regardless of whether the field is empty or not. This may be
  18823. // used to include empty fields in Patch requests.
  18824. ForceSendFields []string `json:"-"`
  18825. // NullFields is a list of field names (e.g. "Resource") to include in
  18826. // API requests with the JSON null value. By default, fields with empty
  18827. // values are omitted from API requests. However, any field with an
  18828. // empty value appearing in NullFields will be sent to the server as
  18829. // null. It is an error if a field in this list has a non-empty value.
  18830. // This may be used to include null fields in Patch requests.
  18831. NullFields []string `json:"-"`
  18832. }
  18833. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  18834. type NoMethod RoutersPreviewResponse
  18835. raw := NoMethod(*s)
  18836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18837. }
  18838. type RoutersScopedList struct {
  18839. // Routers: A list of routers contained in this scope.
  18840. Routers []*Router `json:"routers,omitempty"`
  18841. // Warning: Informational warning which replaces the list of routers
  18842. // when the list is empty.
  18843. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  18844. // ForceSendFields is a list of field names (e.g. "Routers") to
  18845. // unconditionally include in API requests. By default, fields with
  18846. // empty values are omitted from API requests. However, any non-pointer,
  18847. // non-interface field appearing in ForceSendFields will be sent to the
  18848. // server regardless of whether the field is empty or not. This may be
  18849. // used to include empty fields in Patch requests.
  18850. ForceSendFields []string `json:"-"`
  18851. // NullFields is a list of field names (e.g. "Routers") to include in
  18852. // API requests with the JSON null value. By default, fields with empty
  18853. // values are omitted from API requests. However, any field with an
  18854. // empty value appearing in NullFields will be sent to the server as
  18855. // null. It is an error if a field in this list has a non-empty value.
  18856. // This may be used to include null fields in Patch requests.
  18857. NullFields []string `json:"-"`
  18858. }
  18859. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  18860. type NoMethod RoutersScopedList
  18861. raw := NoMethod(*s)
  18862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18863. }
  18864. // RoutersScopedListWarning: Informational warning which replaces the
  18865. // list of routers when the list is empty.
  18866. type RoutersScopedListWarning struct {
  18867. // Code: [Output Only] A warning code, if applicable. For example,
  18868. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18869. // the response.
  18870. //
  18871. // Possible values:
  18872. // "CLEANUP_FAILED"
  18873. // "DEPRECATED_RESOURCE_USED"
  18874. // "DEPRECATED_TYPE_USED"
  18875. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18876. // "EXPERIMENTAL_TYPE_USED"
  18877. // "EXTERNAL_API_WARNING"
  18878. // "FIELD_VALUE_OVERRIDEN"
  18879. // "INJECTED_KERNELS_DEPRECATED"
  18880. // "MISSING_TYPE_DEPENDENCY"
  18881. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18882. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18883. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18884. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18885. // "NEXT_HOP_NOT_RUNNING"
  18886. // "NOT_CRITICAL_ERROR"
  18887. // "NO_RESULTS_ON_PAGE"
  18888. // "REQUIRED_TOS_AGREEMENT"
  18889. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18890. // "RESOURCE_NOT_DELETED"
  18891. // "SCHEMA_VALIDATION_IGNORED"
  18892. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18893. // "UNDECLARED_PROPERTIES"
  18894. // "UNREACHABLE"
  18895. Code string `json:"code,omitempty"`
  18896. // Data: [Output Only] Metadata about this warning in key: value format.
  18897. // For example:
  18898. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18899. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  18900. // Message: [Output Only] A human-readable description of the warning
  18901. // code.
  18902. Message string `json:"message,omitempty"`
  18903. // ForceSendFields is a list of field names (e.g. "Code") to
  18904. // unconditionally include in API requests. By default, fields with
  18905. // empty values are omitted from API requests. However, any non-pointer,
  18906. // non-interface field appearing in ForceSendFields will be sent to the
  18907. // server regardless of whether the field is empty or not. This may be
  18908. // used to include empty fields in Patch requests.
  18909. ForceSendFields []string `json:"-"`
  18910. // NullFields is a list of field names (e.g. "Code") to include in API
  18911. // requests with the JSON null value. By default, fields with empty
  18912. // values are omitted from API requests. However, any field with an
  18913. // empty value appearing in NullFields will be sent to the server as
  18914. // null. It is an error if a field in this list has a non-empty value.
  18915. // This may be used to include null fields in Patch requests.
  18916. NullFields []string `json:"-"`
  18917. }
  18918. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  18919. type NoMethod RoutersScopedListWarning
  18920. raw := NoMethod(*s)
  18921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18922. }
  18923. type RoutersScopedListWarningData struct {
  18924. // Key: [Output Only] A key that provides more detail on the warning
  18925. // being returned. For example, for warnings where there are no results
  18926. // in a list request for a particular zone, this key might be scope and
  18927. // the key value might be the zone name. Other examples might be a key
  18928. // indicating a deprecated resource and a suggested replacement, or a
  18929. // warning about invalid network settings (for example, if an instance
  18930. // attempts to perform IP forwarding but is not enabled for IP
  18931. // forwarding).
  18932. Key string `json:"key,omitempty"`
  18933. // Value: [Output Only] A warning data value corresponding to the key.
  18934. Value string `json:"value,omitempty"`
  18935. // ForceSendFields is a list of field names (e.g. "Key") to
  18936. // unconditionally include in API requests. By default, fields with
  18937. // empty values are omitted from API requests. However, any non-pointer,
  18938. // non-interface field appearing in ForceSendFields will be sent to the
  18939. // server regardless of whether the field is empty or not. This may be
  18940. // used to include empty fields in Patch requests.
  18941. ForceSendFields []string `json:"-"`
  18942. // NullFields is a list of field names (e.g. "Key") to include in API
  18943. // requests with the JSON null value. By default, fields with empty
  18944. // values are omitted from API requests. However, any field with an
  18945. // empty value appearing in NullFields will be sent to the server as
  18946. // null. It is an error if a field in this list has a non-empty value.
  18947. // This may be used to include null fields in Patch requests.
  18948. NullFields []string `json:"-"`
  18949. }
  18950. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  18951. type NoMethod RoutersScopedListWarningData
  18952. raw := NoMethod(*s)
  18953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18954. }
  18955. // Rule: A rule to be applied in a Policy.
  18956. type Rule struct {
  18957. // Action: Required
  18958. //
  18959. // Possible values:
  18960. // "ALLOW"
  18961. // "ALLOW_WITH_LOG"
  18962. // "DENY"
  18963. // "DENY_WITH_LOG"
  18964. // "LOG"
  18965. // "NO_ACTION"
  18966. Action string `json:"action,omitempty"`
  18967. // Conditions: Additional restrictions that must be met. All conditions
  18968. // must pass for the rule to match.
  18969. Conditions []*Condition `json:"conditions,omitempty"`
  18970. // Description: Human-readable description of the rule.
  18971. Description string `json:"description,omitempty"`
  18972. // Ins: If one or more 'in' clauses are specified, the rule matches if
  18973. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  18974. Ins []string `json:"ins,omitempty"`
  18975. // LogConfigs: The config returned to callers of
  18976. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  18977. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  18978. // NotIns: If one or more 'not_in' clauses are specified, the rule
  18979. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  18980. // entries.
  18981. NotIns []string `json:"notIns,omitempty"`
  18982. // Permissions: A permission is a string of form '..' (e.g.,
  18983. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  18984. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  18985. Permissions []string `json:"permissions,omitempty"`
  18986. // ForceSendFields is a list of field names (e.g. "Action") to
  18987. // unconditionally include in API requests. By default, fields with
  18988. // empty values are omitted from API requests. However, any non-pointer,
  18989. // non-interface field appearing in ForceSendFields will be sent to the
  18990. // server regardless of whether the field is empty or not. This may be
  18991. // used to include empty fields in Patch requests.
  18992. ForceSendFields []string `json:"-"`
  18993. // NullFields is a list of field names (e.g. "Action") to include in API
  18994. // requests with the JSON null value. By default, fields with empty
  18995. // values are omitted from API requests. However, any field with an
  18996. // empty value appearing in NullFields will be sent to the server as
  18997. // null. It is an error if a field in this list has a non-empty value.
  18998. // This may be used to include null fields in Patch requests.
  18999. NullFields []string `json:"-"`
  19000. }
  19001. func (s *Rule) MarshalJSON() ([]byte, error) {
  19002. type NoMethod Rule
  19003. raw := NoMethod(*s)
  19004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19005. }
  19006. type SSLHealthCheck struct {
  19007. // Port: The TCP port number for the health check request. The default
  19008. // value is 443. Valid values are 1 through 65535.
  19009. Port int64 `json:"port,omitempty"`
  19010. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  19011. // both port and port_name are defined, port takes precedence.
  19012. PortName string `json:"portName,omitempty"`
  19013. // ProxyHeader: Specifies the type of proxy header to append before
  19014. // sending data to the backend, either NONE or PROXY_V1. The default is
  19015. // NONE.
  19016. //
  19017. // Possible values:
  19018. // "NONE"
  19019. // "PROXY_V1"
  19020. ProxyHeader string `json:"proxyHeader,omitempty"`
  19021. // Request: The application data to send once the SSL connection has
  19022. // been established (default value is empty). If both request and
  19023. // response are empty, the connection establishment alone will indicate
  19024. // health. The request data can only be ASCII.
  19025. Request string `json:"request,omitempty"`
  19026. // Response: The bytes to match against the beginning of the response
  19027. // data. If left empty (the default value), any response will indicate
  19028. // health. The response data can only be ASCII.
  19029. Response string `json:"response,omitempty"`
  19030. // ForceSendFields is a list of field names (e.g. "Port") to
  19031. // unconditionally include in API requests. By default, fields with
  19032. // empty values are omitted from API requests. However, any non-pointer,
  19033. // non-interface field appearing in ForceSendFields will be sent to the
  19034. // server regardless of whether the field is empty or not. This may be
  19035. // used to include empty fields in Patch requests.
  19036. ForceSendFields []string `json:"-"`
  19037. // NullFields is a list of field names (e.g. "Port") to include in API
  19038. // requests with the JSON null value. By default, fields with empty
  19039. // values are omitted from API requests. However, any field with an
  19040. // empty value appearing in NullFields will be sent to the server as
  19041. // null. It is an error if a field in this list has a non-empty value.
  19042. // This may be used to include null fields in Patch requests.
  19043. NullFields []string `json:"-"`
  19044. }
  19045. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  19046. type NoMethod SSLHealthCheck
  19047. raw := NoMethod(*s)
  19048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19049. }
  19050. // Scheduling: Sets the scheduling options for an Instance.
  19051. type Scheduling struct {
  19052. // AutomaticRestart: Specifies whether the instance should be
  19053. // automatically restarted if it is terminated by Compute Engine (not
  19054. // terminated by a user). You can only set the automatic restart option
  19055. // for standard instances. Preemptible instances cannot be automatically
  19056. // restarted.
  19057. //
  19058. // By default, this is set to true so an instance is automatically
  19059. // restarted if it is terminated by Compute Engine.
  19060. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  19061. // NodeAffinities: A set of node affinity and anti-affinity.
  19062. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  19063. // OnHostMaintenance: Defines the maintenance behavior for this
  19064. // instance. For standard instances, the default behavior is MIGRATE.
  19065. // For preemptible instances, the default and only possible behavior is
  19066. // TERMINATE. For more information, see Setting Instance Scheduling
  19067. // Options.
  19068. //
  19069. // Possible values:
  19070. // "MIGRATE"
  19071. // "TERMINATE"
  19072. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  19073. // Preemptible: Defines whether the instance is preemptible. This can
  19074. // only be set during instance creation, it cannot be set or changed
  19075. // after the instance has been created.
  19076. Preemptible bool `json:"preemptible,omitempty"`
  19077. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  19078. // unconditionally include in API requests. By default, fields with
  19079. // empty values are omitted from API requests. However, any non-pointer,
  19080. // non-interface field appearing in ForceSendFields will be sent to the
  19081. // server regardless of whether the field is empty or not. This may be
  19082. // used to include empty fields in Patch requests.
  19083. ForceSendFields []string `json:"-"`
  19084. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  19085. // include in API requests with the JSON null value. By default, fields
  19086. // with empty values are omitted from API requests. However, any field
  19087. // with an empty value appearing in NullFields will be sent to the
  19088. // server as null. It is an error if a field in this list has a
  19089. // non-empty value. This may be used to include null fields in Patch
  19090. // requests.
  19091. NullFields []string `json:"-"`
  19092. }
  19093. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  19094. type NoMethod Scheduling
  19095. raw := NoMethod(*s)
  19096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19097. }
  19098. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  19099. // nodes onto which this Instance could be scheduled.
  19100. type SchedulingNodeAffinity struct {
  19101. // Key: Corresponds to the label key of Node resource.
  19102. Key string `json:"key,omitempty"`
  19103. // Operator: Defines the operation of node selection.
  19104. //
  19105. // Possible values:
  19106. // "IN"
  19107. // "NOT_IN"
  19108. // "OPERATOR_UNSPECIFIED"
  19109. Operator string `json:"operator,omitempty"`
  19110. // Values: Corresponds to the label values of Node resource.
  19111. Values []string `json:"values,omitempty"`
  19112. // ForceSendFields is a list of field names (e.g. "Key") to
  19113. // unconditionally include in API requests. By default, fields with
  19114. // empty values are omitted from API requests. However, any non-pointer,
  19115. // non-interface field appearing in ForceSendFields will be sent to the
  19116. // server regardless of whether the field is empty or not. This may be
  19117. // used to include empty fields in Patch requests.
  19118. ForceSendFields []string `json:"-"`
  19119. // NullFields is a list of field names (e.g. "Key") to include in API
  19120. // requests with the JSON null value. By default, fields with empty
  19121. // values are omitted from API requests. However, any field with an
  19122. // empty value appearing in NullFields will be sent to the server as
  19123. // null. It is an error if a field in this list has a non-empty value.
  19124. // This may be used to include null fields in Patch requests.
  19125. NullFields []string `json:"-"`
  19126. }
  19127. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  19128. type NoMethod SchedulingNodeAffinity
  19129. raw := NoMethod(*s)
  19130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19131. }
  19132. // SecurityPolicy: A security policy is comprised of one or more rules.
  19133. // It can also be associated with one or more 'targets'. (==
  19134. // resource_for v1.securityPolicies ==) (== resource_for
  19135. // beta.securityPolicies ==)
  19136. type SecurityPolicy struct {
  19137. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19138. // format.
  19139. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19140. // Description: An optional description of this resource. Provide this
  19141. // property when you create the resource.
  19142. Description string `json:"description,omitempty"`
  19143. // Fingerprint: Specifies a fingerprint for this resource, which is
  19144. // essentially a hash of the metadata's contents and used for optimistic
  19145. // locking. The fingerprint is initially generated by Compute Engine and
  19146. // changes after every request to modify or update metadata. You must
  19147. // always provide an up-to-date fingerprint hash in order to update or
  19148. // change metadata, otherwise the request will fail with error 412
  19149. // conditionNotMet.
  19150. //
  19151. // To see the latest fingerprint, make get() request to the security
  19152. // policy.
  19153. Fingerprint string `json:"fingerprint,omitempty"`
  19154. // Id: [Output Only] The unique identifier for the resource. This
  19155. // identifier is defined by the server.
  19156. Id uint64 `json:"id,omitempty,string"`
  19157. // Kind: [Output only] Type of the resource. Always
  19158. // compute#securityPolicyfor security policies
  19159. Kind string `json:"kind,omitempty"`
  19160. // Name: Name of the resource. Provided by the client when the resource
  19161. // is created. The name must be 1-63 characters long, and comply with
  19162. // RFC1035. Specifically, the name must be 1-63 characters long and
  19163. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19164. // the first character must be a lowercase letter, and all following
  19165. // characters must be a dash, lowercase letter, or digit, except the
  19166. // last character, which cannot be a dash.
  19167. Name string `json:"name,omitempty"`
  19168. // Rules: A list of rules that belong to this policy. There must always
  19169. // be a default rule (rule with priority 2147483647 and match "*"). If
  19170. // no rules are provided when creating a security policy, a default rule
  19171. // with action "allow" will be added.
  19172. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  19173. // SelfLink: [Output Only] Server-defined URL for the resource.
  19174. SelfLink string `json:"selfLink,omitempty"`
  19175. // ServerResponse contains the HTTP response code and headers from the
  19176. // server.
  19177. googleapi.ServerResponse `json:"-"`
  19178. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19179. // to unconditionally include in API requests. By default, fields with
  19180. // empty values are omitted from API requests. However, any non-pointer,
  19181. // non-interface field appearing in ForceSendFields will be sent to the
  19182. // server regardless of whether the field is empty or not. This may be
  19183. // used to include empty fields in Patch requests.
  19184. ForceSendFields []string `json:"-"`
  19185. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19186. // include in API requests with the JSON null value. By default, fields
  19187. // with empty values are omitted from API requests. However, any field
  19188. // with an empty value appearing in NullFields will be sent to the
  19189. // server as null. It is an error if a field in this list has a
  19190. // non-empty value. This may be used to include null fields in Patch
  19191. // requests.
  19192. NullFields []string `json:"-"`
  19193. }
  19194. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  19195. type NoMethod SecurityPolicy
  19196. raw := NoMethod(*s)
  19197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19198. }
  19199. type SecurityPolicyList struct {
  19200. // Id: [Output Only] Unique identifier for the resource; defined by the
  19201. // server.
  19202. Id string `json:"id,omitempty"`
  19203. // Items: A list of SecurityPolicy resources.
  19204. Items []*SecurityPolicy `json:"items,omitempty"`
  19205. // Kind: [Output Only] Type of resource. Always
  19206. // compute#securityPolicyList for listsof securityPolicies
  19207. Kind string `json:"kind,omitempty"`
  19208. // NextPageToken: [Output Only] This token allows you to get the next
  19209. // page of results for list requests. If the number of results is larger
  19210. // than maxResults, use the nextPageToken as a value for the query
  19211. // parameter pageToken in the next list request. Subsequent list
  19212. // requests will have their own nextPageToken to continue paging through
  19213. // the results.
  19214. NextPageToken string `json:"nextPageToken,omitempty"`
  19215. // Warning: [Output Only] Informational warning message.
  19216. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  19217. // ServerResponse contains the HTTP response code and headers from the
  19218. // server.
  19219. googleapi.ServerResponse `json:"-"`
  19220. // ForceSendFields is a list of field names (e.g. "Id") to
  19221. // unconditionally include in API requests. By default, fields with
  19222. // empty values are omitted from API requests. However, any non-pointer,
  19223. // non-interface field appearing in ForceSendFields will be sent to the
  19224. // server regardless of whether the field is empty or not. This may be
  19225. // used to include empty fields in Patch requests.
  19226. ForceSendFields []string `json:"-"`
  19227. // NullFields is a list of field names (e.g. "Id") to include in API
  19228. // requests with the JSON null value. By default, fields with empty
  19229. // values are omitted from API requests. However, any field with an
  19230. // empty value appearing in NullFields will be sent to the server as
  19231. // null. It is an error if a field in this list has a non-empty value.
  19232. // This may be used to include null fields in Patch requests.
  19233. NullFields []string `json:"-"`
  19234. }
  19235. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  19236. type NoMethod SecurityPolicyList
  19237. raw := NoMethod(*s)
  19238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19239. }
  19240. // SecurityPolicyListWarning: [Output Only] Informational warning
  19241. // message.
  19242. type SecurityPolicyListWarning struct {
  19243. // Code: [Output Only] A warning code, if applicable. For example,
  19244. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19245. // the response.
  19246. //
  19247. // Possible values:
  19248. // "CLEANUP_FAILED"
  19249. // "DEPRECATED_RESOURCE_USED"
  19250. // "DEPRECATED_TYPE_USED"
  19251. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19252. // "EXPERIMENTAL_TYPE_USED"
  19253. // "EXTERNAL_API_WARNING"
  19254. // "FIELD_VALUE_OVERRIDEN"
  19255. // "INJECTED_KERNELS_DEPRECATED"
  19256. // "MISSING_TYPE_DEPENDENCY"
  19257. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19258. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19259. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19260. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19261. // "NEXT_HOP_NOT_RUNNING"
  19262. // "NOT_CRITICAL_ERROR"
  19263. // "NO_RESULTS_ON_PAGE"
  19264. // "REQUIRED_TOS_AGREEMENT"
  19265. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19266. // "RESOURCE_NOT_DELETED"
  19267. // "SCHEMA_VALIDATION_IGNORED"
  19268. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19269. // "UNDECLARED_PROPERTIES"
  19270. // "UNREACHABLE"
  19271. Code string `json:"code,omitempty"`
  19272. // Data: [Output Only] Metadata about this warning in key: value format.
  19273. // For example:
  19274. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19275. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  19276. // Message: [Output Only] A human-readable description of the warning
  19277. // code.
  19278. Message string `json:"message,omitempty"`
  19279. // ForceSendFields is a list of field names (e.g. "Code") to
  19280. // unconditionally include in API requests. By default, fields with
  19281. // empty values are omitted from API requests. However, any non-pointer,
  19282. // non-interface field appearing in ForceSendFields will be sent to the
  19283. // server regardless of whether the field is empty or not. This may be
  19284. // used to include empty fields in Patch requests.
  19285. ForceSendFields []string `json:"-"`
  19286. // NullFields is a list of field names (e.g. "Code") to include in API
  19287. // requests with the JSON null value. By default, fields with empty
  19288. // values are omitted from API requests. However, any field with an
  19289. // empty value appearing in NullFields will be sent to the server as
  19290. // null. It is an error if a field in this list has a non-empty value.
  19291. // This may be used to include null fields in Patch requests.
  19292. NullFields []string `json:"-"`
  19293. }
  19294. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  19295. type NoMethod SecurityPolicyListWarning
  19296. raw := NoMethod(*s)
  19297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19298. }
  19299. type SecurityPolicyListWarningData struct {
  19300. // Key: [Output Only] A key that provides more detail on the warning
  19301. // being returned. For example, for warnings where there are no results
  19302. // in a list request for a particular zone, this key might be scope and
  19303. // the key value might be the zone name. Other examples might be a key
  19304. // indicating a deprecated resource and a suggested replacement, or a
  19305. // warning about invalid network settings (for example, if an instance
  19306. // attempts to perform IP forwarding but is not enabled for IP
  19307. // forwarding).
  19308. Key string `json:"key,omitempty"`
  19309. // Value: [Output Only] A warning data value corresponding to the key.
  19310. Value string `json:"value,omitempty"`
  19311. // ForceSendFields is a list of field names (e.g. "Key") to
  19312. // unconditionally include in API requests. By default, fields with
  19313. // empty values are omitted from API requests. However, any non-pointer,
  19314. // non-interface field appearing in ForceSendFields will be sent to the
  19315. // server regardless of whether the field is empty or not. This may be
  19316. // used to include empty fields in Patch requests.
  19317. ForceSendFields []string `json:"-"`
  19318. // NullFields is a list of field names (e.g. "Key") to include in API
  19319. // requests with the JSON null value. By default, fields with empty
  19320. // values are omitted from API requests. However, any field with an
  19321. // empty value appearing in NullFields will be sent to the server as
  19322. // null. It is an error if a field in this list has a non-empty value.
  19323. // This may be used to include null fields in Patch requests.
  19324. NullFields []string `json:"-"`
  19325. }
  19326. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  19327. type NoMethod SecurityPolicyListWarningData
  19328. raw := NoMethod(*s)
  19329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19330. }
  19331. type SecurityPolicyReference struct {
  19332. SecurityPolicy string `json:"securityPolicy,omitempty"`
  19333. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  19334. // unconditionally include in API requests. By default, fields with
  19335. // empty values are omitted from API requests. However, any non-pointer,
  19336. // non-interface field appearing in ForceSendFields will be sent to the
  19337. // server regardless of whether the field is empty or not. This may be
  19338. // used to include empty fields in Patch requests.
  19339. ForceSendFields []string `json:"-"`
  19340. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  19341. // include in API requests with the JSON null value. By default, fields
  19342. // with empty values are omitted from API requests. However, any field
  19343. // with an empty value appearing in NullFields will be sent to the
  19344. // server as null. It is an error if a field in this list has a
  19345. // non-empty value. This may be used to include null fields in Patch
  19346. // requests.
  19347. NullFields []string `json:"-"`
  19348. }
  19349. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  19350. type NoMethod SecurityPolicyReference
  19351. raw := NoMethod(*s)
  19352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19353. }
  19354. // SecurityPolicyRule: Represents a rule that describes one or more
  19355. // match conditions along with the action to be taken when traffic
  19356. // matches this condition (allow or deny).
  19357. type SecurityPolicyRule struct {
  19358. // Action: The Action to preform when the client connection triggers the
  19359. // rule. Can currently be either "allow" or "deny()" where valid values
  19360. // for status are 403, 404, and 502.
  19361. Action string `json:"action,omitempty"`
  19362. // Description: An optional description of this resource. Provide this
  19363. // property when you create the resource.
  19364. Description string `json:"description,omitempty"`
  19365. // Kind: [Output only] Type of the resource. Always
  19366. // compute#securityPolicyRule for security policy rules
  19367. Kind string `json:"kind,omitempty"`
  19368. // Match: A match condition that incoming traffic is evaluated against.
  19369. // If it evaluates to true, the corresponding ?action? is enforced.
  19370. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  19371. // Preview: If set to true, the specified action is not enforced.
  19372. Preview bool `json:"preview,omitempty"`
  19373. // Priority: An integer indicating the priority of a rule in the list.
  19374. // The priority must be a positive value between 0 and 2147483647. Rules
  19375. // are evaluated from highest to lowest priority where 0 is the highest
  19376. // priority and 2147483647 is the lowest prority.
  19377. Priority int64 `json:"priority,omitempty"`
  19378. // ServerResponse contains the HTTP response code and headers from the
  19379. // server.
  19380. googleapi.ServerResponse `json:"-"`
  19381. // ForceSendFields is a list of field names (e.g. "Action") to
  19382. // unconditionally include in API requests. By default, fields with
  19383. // empty values are omitted from API requests. However, any non-pointer,
  19384. // non-interface field appearing in ForceSendFields will be sent to the
  19385. // server regardless of whether the field is empty or not. This may be
  19386. // used to include empty fields in Patch requests.
  19387. ForceSendFields []string `json:"-"`
  19388. // NullFields is a list of field names (e.g. "Action") to include in API
  19389. // requests with the JSON null value. By default, fields with empty
  19390. // values are omitted from API requests. However, any field with an
  19391. // empty value appearing in NullFields will be sent to the server as
  19392. // null. It is an error if a field in this list has a non-empty value.
  19393. // This may be used to include null fields in Patch requests.
  19394. NullFields []string `json:"-"`
  19395. }
  19396. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  19397. type NoMethod SecurityPolicyRule
  19398. raw := NoMethod(*s)
  19399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19400. }
  19401. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  19402. // traffic is evaluated against. Exactly one field must be specified.
  19403. type SecurityPolicyRuleMatcher struct {
  19404. // Config: The configuration options available when specifying
  19405. // versioned_expr. This field must be specified if versioned_expr is
  19406. // specified and cannot be specified if versioned_expr is not specified.
  19407. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  19408. // VersionedExpr: Preconfigured versioned expression. If this field is
  19409. // specified, config must also be specified. Available preconfigured
  19410. // expressions along with their requirements are: SRC_IPS_V1 - must
  19411. // specify the corresponding src_ip_range field in config.
  19412. //
  19413. // Possible values:
  19414. // "SRC_IPS_V1"
  19415. VersionedExpr string `json:"versionedExpr,omitempty"`
  19416. // ForceSendFields is a list of field names (e.g. "Config") to
  19417. // unconditionally include in API requests. By default, fields with
  19418. // empty values are omitted from API requests. However, any non-pointer,
  19419. // non-interface field appearing in ForceSendFields will be sent to the
  19420. // server regardless of whether the field is empty or not. This may be
  19421. // used to include empty fields in Patch requests.
  19422. ForceSendFields []string `json:"-"`
  19423. // NullFields is a list of field names (e.g. "Config") to include in API
  19424. // requests with the JSON null value. By default, fields with empty
  19425. // values are omitted from API requests. However, any field with an
  19426. // empty value appearing in NullFields will be sent to the server as
  19427. // null. It is an error if a field in this list has a non-empty value.
  19428. // This may be used to include null fields in Patch requests.
  19429. NullFields []string `json:"-"`
  19430. }
  19431. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  19432. type NoMethod SecurityPolicyRuleMatcher
  19433. raw := NoMethod(*s)
  19434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19435. }
  19436. type SecurityPolicyRuleMatcherConfig struct {
  19437. // SrcIpRanges: CIDR IP address range.
  19438. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  19439. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  19440. // unconditionally include in API requests. By default, fields with
  19441. // empty values are omitted from API requests. However, any non-pointer,
  19442. // non-interface field appearing in ForceSendFields will be sent to the
  19443. // server regardless of whether the field is empty or not. This may be
  19444. // used to include empty fields in Patch requests.
  19445. ForceSendFields []string `json:"-"`
  19446. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  19447. // in API requests with the JSON null value. By default, fields with
  19448. // empty values are omitted from API requests. However, any field with
  19449. // an empty value appearing in NullFields will be sent to the server as
  19450. // null. It is an error if a field in this list has a non-empty value.
  19451. // This may be used to include null fields in Patch requests.
  19452. NullFields []string `json:"-"`
  19453. }
  19454. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  19455. type NoMethod SecurityPolicyRuleMatcherConfig
  19456. raw := NoMethod(*s)
  19457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19458. }
  19459. // SerialPortOutput: An instance's serial console output.
  19460. type SerialPortOutput struct {
  19461. // Contents: [Output Only] The contents of the console output.
  19462. Contents string `json:"contents,omitempty"`
  19463. // Kind: [Output Only] Type of the resource. Always
  19464. // compute#serialPortOutput for serial port output.
  19465. Kind string `json:"kind,omitempty"`
  19466. // Next: [Output Only] The position of the next byte of content from the
  19467. // serial console output. Use this value in the next request as the
  19468. // start parameter.
  19469. Next int64 `json:"next,omitempty,string"`
  19470. // SelfLink: [Output Only] Server-defined URL for this resource.
  19471. SelfLink string `json:"selfLink,omitempty"`
  19472. // Start: The starting byte position of the output that was returned.
  19473. // This should match the start parameter sent with the request. If the
  19474. // serial console output exceeds the size of the buffer, older output
  19475. // will be overwritten by newer content and the start values will be
  19476. // mismatched.
  19477. Start int64 `json:"start,omitempty,string"`
  19478. // ServerResponse contains the HTTP response code and headers from the
  19479. // server.
  19480. googleapi.ServerResponse `json:"-"`
  19481. // ForceSendFields is a list of field names (e.g. "Contents") to
  19482. // unconditionally include in API requests. By default, fields with
  19483. // empty values are omitted from API requests. However, any non-pointer,
  19484. // non-interface field appearing in ForceSendFields will be sent to the
  19485. // server regardless of whether the field is empty or not. This may be
  19486. // used to include empty fields in Patch requests.
  19487. ForceSendFields []string `json:"-"`
  19488. // NullFields is a list of field names (e.g. "Contents") to include in
  19489. // API requests with the JSON null value. By default, fields with empty
  19490. // values are omitted from API requests. However, any field with an
  19491. // empty value appearing in NullFields will be sent to the server as
  19492. // null. It is an error if a field in this list has a non-empty value.
  19493. // This may be used to include null fields in Patch requests.
  19494. NullFields []string `json:"-"`
  19495. }
  19496. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  19497. type NoMethod SerialPortOutput
  19498. raw := NoMethod(*s)
  19499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19500. }
  19501. // ServiceAccount: A service account.
  19502. type ServiceAccount struct {
  19503. // Email: Email address of the service account.
  19504. Email string `json:"email,omitempty"`
  19505. // Scopes: The list of scopes to be made available for this service
  19506. // account.
  19507. Scopes []string `json:"scopes,omitempty"`
  19508. // ForceSendFields is a list of field names (e.g. "Email") to
  19509. // unconditionally include in API requests. By default, fields with
  19510. // empty values are omitted from API requests. However, any non-pointer,
  19511. // non-interface field appearing in ForceSendFields will be sent to the
  19512. // server regardless of whether the field is empty or not. This may be
  19513. // used to include empty fields in Patch requests.
  19514. ForceSendFields []string `json:"-"`
  19515. // NullFields is a list of field names (e.g. "Email") to include in API
  19516. // requests with the JSON null value. By default, fields with empty
  19517. // values are omitted from API requests. However, any field with an
  19518. // empty value appearing in NullFields will be sent to the server as
  19519. // null. It is an error if a field in this list has a non-empty value.
  19520. // This may be used to include null fields in Patch requests.
  19521. NullFields []string `json:"-"`
  19522. }
  19523. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  19524. type NoMethod ServiceAccount
  19525. raw := NoMethod(*s)
  19526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19527. }
  19528. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  19529. // Cloud CDN Signed URLs
  19530. type SignedUrlKey struct {
  19531. // KeyName: Name of the key. The name must be 1-63 characters long, and
  19532. // comply with RFC1035. Specifically, the name must be 1-63 characters
  19533. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  19534. // which means the first character must be a lowercase letter, and all
  19535. // following characters must be a dash, lowercase letter, or digit,
  19536. // except the last character, which cannot be a dash.
  19537. KeyName string `json:"keyName,omitempty"`
  19538. // KeyValue: 128-bit key value used for signing the URL. The key value
  19539. // must be a valid RFC 4648 Section 5 base64url encoded string.
  19540. KeyValue string `json:"keyValue,omitempty"`
  19541. // ForceSendFields is a list of field names (e.g. "KeyName") to
  19542. // unconditionally include in API requests. By default, fields with
  19543. // empty values are omitted from API requests. However, any non-pointer,
  19544. // non-interface field appearing in ForceSendFields will be sent to the
  19545. // server regardless of whether the field is empty or not. This may be
  19546. // used to include empty fields in Patch requests.
  19547. ForceSendFields []string `json:"-"`
  19548. // NullFields is a list of field names (e.g. "KeyName") to include in
  19549. // API requests with the JSON null value. By default, fields with empty
  19550. // values are omitted from API requests. However, any field with an
  19551. // empty value appearing in NullFields will be sent to the server as
  19552. // null. It is an error if a field in this list has a non-empty value.
  19553. // This may be used to include null fields in Patch requests.
  19554. NullFields []string `json:"-"`
  19555. }
  19556. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  19557. type NoMethod SignedUrlKey
  19558. raw := NoMethod(*s)
  19559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19560. }
  19561. // Snapshot: A persistent disk snapshot resource. (== resource_for
  19562. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  19563. type Snapshot struct {
  19564. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19565. // format.
  19566. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19567. // Description: An optional description of this resource. Provide this
  19568. // property when you create the resource.
  19569. Description string `json:"description,omitempty"`
  19570. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  19571. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  19572. // Id: [Output Only] The unique identifier for the resource. This
  19573. // identifier is defined by the server.
  19574. Id uint64 `json:"id,omitempty,string"`
  19575. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  19576. // Snapshot resources.
  19577. Kind string `json:"kind,omitempty"`
  19578. // LabelFingerprint: A fingerprint for the labels being applied to this
  19579. // snapshot, which is essentially a hash of the labels set used for
  19580. // optimistic locking. The fingerprint is initially generated by Compute
  19581. // Engine and changes after every request to modify or update labels.
  19582. // You must always provide an up-to-date fingerprint hash in order to
  19583. // update or change labels, otherwise the request will fail with error
  19584. // 412 conditionNotMet.
  19585. //
  19586. // To see the latest fingerprint, make a get() request to retrieve a
  19587. // snapshot.
  19588. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  19589. // Labels: Labels to apply to this snapshot. These can be later modified
  19590. // by the setLabels method. Label values may be empty.
  19591. Labels map[string]string `json:"labels,omitempty"`
  19592. // LicenseCodes: [Output Only] Integer license codes indicating which
  19593. // licenses are attached to this snapshot.
  19594. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  19595. // Licenses: [Output Only] A list of public visible licenses that apply
  19596. // to this snapshot. This can be because the original image had licenses
  19597. // attached (such as a Windows image).
  19598. Licenses []string `json:"licenses,omitempty"`
  19599. // Name: Name of the resource; provided by the client when the resource
  19600. // is created. The name must be 1-63 characters long, and comply with
  19601. // RFC1035. Specifically, the name must be 1-63 characters long and
  19602. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19603. // the first character must be a lowercase letter, and all following
  19604. // characters must be a dash, lowercase letter, or digit, except the
  19605. // last character, which cannot be a dash.
  19606. Name string `json:"name,omitempty"`
  19607. // SelfLink: [Output Only] Server-defined URL for the resource.
  19608. SelfLink string `json:"selfLink,omitempty"`
  19609. // SnapshotEncryptionKey: Encrypts the snapshot using a
  19610. // customer-supplied encryption key.
  19611. //
  19612. // After you encrypt a snapshot using a customer-supplied key, you must
  19613. // provide the same key if you use the image later For example, you must
  19614. // provide the encryption key when you create a disk from the encrypted
  19615. // snapshot in a future request.
  19616. //
  19617. // Customer-supplied encryption keys do not protect access to metadata
  19618. // of the disk.
  19619. //
  19620. // If you do not provide an encryption key when creating the snapshot,
  19621. // then the snapshot will be encrypted using an automatically generated
  19622. // key and you do not need to provide a key to use the snapshot later.
  19623. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  19624. // SourceDisk: [Output Only] The source disk used to create this
  19625. // snapshot.
  19626. SourceDisk string `json:"sourceDisk,omitempty"`
  19627. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  19628. // source disk. Required if the source disk is protected by a
  19629. // customer-supplied encryption key.
  19630. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  19631. // SourceDiskId: [Output Only] The ID value of the disk used to create
  19632. // this snapshot. This value may be used to determine whether the
  19633. // snapshot was taken from the current or a previous instance of a given
  19634. // disk name.
  19635. SourceDiskId string `json:"sourceDiskId,omitempty"`
  19636. // Status: [Output Only] The status of the snapshot. This can be
  19637. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  19638. //
  19639. // Possible values:
  19640. // "CREATING"
  19641. // "DELETING"
  19642. // "FAILED"
  19643. // "READY"
  19644. // "UPLOADING"
  19645. Status string `json:"status,omitempty"`
  19646. // StorageBytes: [Output Only] A size of the storage used by the
  19647. // snapshot. As snapshots share storage, this number is expected to
  19648. // change with snapshot creation/deletion.
  19649. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  19650. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  19651. // is in a stable state or it is being adjusted as a result of shared
  19652. // storage reallocation. This status can either be UPDATING, meaning the
  19653. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  19654. // size of the snapshot is up-to-date.
  19655. //
  19656. // Possible values:
  19657. // "UPDATING"
  19658. // "UP_TO_DATE"
  19659. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  19660. // ServerResponse contains the HTTP response code and headers from the
  19661. // server.
  19662. googleapi.ServerResponse `json:"-"`
  19663. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19664. // to unconditionally include in API requests. By default, fields with
  19665. // empty values are omitted from API requests. However, any non-pointer,
  19666. // non-interface field appearing in ForceSendFields will be sent to the
  19667. // server regardless of whether the field is empty or not. This may be
  19668. // used to include empty fields in Patch requests.
  19669. ForceSendFields []string `json:"-"`
  19670. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19671. // include in API requests with the JSON null value. By default, fields
  19672. // with empty values are omitted from API requests. However, any field
  19673. // with an empty value appearing in NullFields will be sent to the
  19674. // server as null. It is an error if a field in this list has a
  19675. // non-empty value. This may be used to include null fields in Patch
  19676. // requests.
  19677. NullFields []string `json:"-"`
  19678. }
  19679. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  19680. type NoMethod Snapshot
  19681. raw := NoMethod(*s)
  19682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19683. }
  19684. // SnapshotList: Contains a list of Snapshot resources.
  19685. type SnapshotList struct {
  19686. // Id: [Output Only] Unique identifier for the resource; defined by the
  19687. // server.
  19688. Id string `json:"id,omitempty"`
  19689. // Items: A list of Snapshot resources.
  19690. Items []*Snapshot `json:"items,omitempty"`
  19691. // Kind: Type of resource.
  19692. Kind string `json:"kind,omitempty"`
  19693. // NextPageToken: [Output Only] This token allows you to get the next
  19694. // page of results for list requests. If the number of results is larger
  19695. // than maxResults, use the nextPageToken as a value for the query
  19696. // parameter pageToken in the next list request. Subsequent list
  19697. // requests will have their own nextPageToken to continue paging through
  19698. // the results.
  19699. NextPageToken string `json:"nextPageToken,omitempty"`
  19700. // SelfLink: [Output Only] Server-defined URL for this resource.
  19701. SelfLink string `json:"selfLink,omitempty"`
  19702. // Warning: [Output Only] Informational warning message.
  19703. Warning *SnapshotListWarning `json:"warning,omitempty"`
  19704. // ServerResponse contains the HTTP response code and headers from the
  19705. // server.
  19706. googleapi.ServerResponse `json:"-"`
  19707. // ForceSendFields is a list of field names (e.g. "Id") to
  19708. // unconditionally include in API requests. By default, fields with
  19709. // empty values are omitted from API requests. However, any non-pointer,
  19710. // non-interface field appearing in ForceSendFields will be sent to the
  19711. // server regardless of whether the field is empty or not. This may be
  19712. // used to include empty fields in Patch requests.
  19713. ForceSendFields []string `json:"-"`
  19714. // NullFields is a list of field names (e.g. "Id") to include in API
  19715. // requests with the JSON null value. By default, fields with empty
  19716. // values are omitted from API requests. However, any field with an
  19717. // empty value appearing in NullFields will be sent to the server as
  19718. // null. It is an error if a field in this list has a non-empty value.
  19719. // This may be used to include null fields in Patch requests.
  19720. NullFields []string `json:"-"`
  19721. }
  19722. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  19723. type NoMethod SnapshotList
  19724. raw := NoMethod(*s)
  19725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19726. }
  19727. // SnapshotListWarning: [Output Only] Informational warning message.
  19728. type SnapshotListWarning struct {
  19729. // Code: [Output Only] A warning code, if applicable. For example,
  19730. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19731. // the response.
  19732. //
  19733. // Possible values:
  19734. // "CLEANUP_FAILED"
  19735. // "DEPRECATED_RESOURCE_USED"
  19736. // "DEPRECATED_TYPE_USED"
  19737. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19738. // "EXPERIMENTAL_TYPE_USED"
  19739. // "EXTERNAL_API_WARNING"
  19740. // "FIELD_VALUE_OVERRIDEN"
  19741. // "INJECTED_KERNELS_DEPRECATED"
  19742. // "MISSING_TYPE_DEPENDENCY"
  19743. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19744. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19745. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19746. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19747. // "NEXT_HOP_NOT_RUNNING"
  19748. // "NOT_CRITICAL_ERROR"
  19749. // "NO_RESULTS_ON_PAGE"
  19750. // "REQUIRED_TOS_AGREEMENT"
  19751. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19752. // "RESOURCE_NOT_DELETED"
  19753. // "SCHEMA_VALIDATION_IGNORED"
  19754. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19755. // "UNDECLARED_PROPERTIES"
  19756. // "UNREACHABLE"
  19757. Code string `json:"code,omitempty"`
  19758. // Data: [Output Only] Metadata about this warning in key: value format.
  19759. // For example:
  19760. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19761. Data []*SnapshotListWarningData `json:"data,omitempty"`
  19762. // Message: [Output Only] A human-readable description of the warning
  19763. // code.
  19764. Message string `json:"message,omitempty"`
  19765. // ForceSendFields is a list of field names (e.g. "Code") to
  19766. // unconditionally include in API requests. By default, fields with
  19767. // empty values are omitted from API requests. However, any non-pointer,
  19768. // non-interface field appearing in ForceSendFields will be sent to the
  19769. // server regardless of whether the field is empty or not. This may be
  19770. // used to include empty fields in Patch requests.
  19771. ForceSendFields []string `json:"-"`
  19772. // NullFields is a list of field names (e.g. "Code") to include in API
  19773. // requests with the JSON null value. By default, fields with empty
  19774. // values are omitted from API requests. However, any field with an
  19775. // empty value appearing in NullFields will be sent to the server as
  19776. // null. It is an error if a field in this list has a non-empty value.
  19777. // This may be used to include null fields in Patch requests.
  19778. NullFields []string `json:"-"`
  19779. }
  19780. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  19781. type NoMethod SnapshotListWarning
  19782. raw := NoMethod(*s)
  19783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19784. }
  19785. type SnapshotListWarningData struct {
  19786. // Key: [Output Only] A key that provides more detail on the warning
  19787. // being returned. For example, for warnings where there are no results
  19788. // in a list request for a particular zone, this key might be scope and
  19789. // the key value might be the zone name. Other examples might be a key
  19790. // indicating a deprecated resource and a suggested replacement, or a
  19791. // warning about invalid network settings (for example, if an instance
  19792. // attempts to perform IP forwarding but is not enabled for IP
  19793. // forwarding).
  19794. Key string `json:"key,omitempty"`
  19795. // Value: [Output Only] A warning data value corresponding to the key.
  19796. Value string `json:"value,omitempty"`
  19797. // ForceSendFields is a list of field names (e.g. "Key") to
  19798. // unconditionally include in API requests. By default, fields with
  19799. // empty values are omitted from API requests. However, any non-pointer,
  19800. // non-interface field appearing in ForceSendFields will be sent to the
  19801. // server regardless of whether the field is empty or not. This may be
  19802. // used to include empty fields in Patch requests.
  19803. ForceSendFields []string `json:"-"`
  19804. // NullFields is a list of field names (e.g. "Key") to include in API
  19805. // requests with the JSON null value. By default, fields with empty
  19806. // values are omitted from API requests. However, any field with an
  19807. // empty value appearing in NullFields will be sent to the server as
  19808. // null. It is an error if a field in this list has a non-empty value.
  19809. // This may be used to include null fields in Patch requests.
  19810. NullFields []string `json:"-"`
  19811. }
  19812. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  19813. type NoMethod SnapshotListWarningData
  19814. raw := NoMethod(*s)
  19815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19816. }
  19817. // SourceInstanceParams: A specification of the parameters to use when
  19818. // creating the instance template from a source instance.
  19819. type SourceInstanceParams struct {
  19820. // DiskConfigs: Attached disks configuration. If not provided, defaults
  19821. // are applied: For boot disk and any other R/W disks, new custom images
  19822. // will be created from each disk. For read-only disks, they will be
  19823. // attached in read-only mode. Local SSD disks will be created as blank
  19824. // volumes.
  19825. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  19826. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  19827. // unconditionally include in API requests. By default, fields with
  19828. // empty values are omitted from API requests. However, any non-pointer,
  19829. // non-interface field appearing in ForceSendFields will be sent to the
  19830. // server regardless of whether the field is empty or not. This may be
  19831. // used to include empty fields in Patch requests.
  19832. ForceSendFields []string `json:"-"`
  19833. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  19834. // in API requests with the JSON null value. By default, fields with
  19835. // empty values are omitted from API requests. However, any field with
  19836. // an empty value appearing in NullFields will be sent to the server as
  19837. // null. It is an error if a field in this list has a non-empty value.
  19838. // This may be used to include null fields in Patch requests.
  19839. NullFields []string `json:"-"`
  19840. }
  19841. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  19842. type NoMethod SourceInstanceParams
  19843. raw := NoMethod(*s)
  19844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19845. }
  19846. // SslCertificate: An SslCertificate resource. This resource provides a
  19847. // mechanism to upload an SSL key and certificate to the load balancer
  19848. // to serve secure connections from the user. (== resource_for
  19849. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  19850. type SslCertificate struct {
  19851. // Certificate: A local certificate file. The certificate must be in PEM
  19852. // format. The certificate chain must be no greater than 5 certs long.
  19853. // The chain must include at least one intermediate cert.
  19854. Certificate string `json:"certificate,omitempty"`
  19855. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19856. // format.
  19857. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19858. // Description: An optional description of this resource. Provide this
  19859. // property when you create the resource.
  19860. Description string `json:"description,omitempty"`
  19861. // Id: [Output Only] The unique identifier for the resource. This
  19862. // identifier is defined by the server.
  19863. Id uint64 `json:"id,omitempty,string"`
  19864. // Kind: [Output Only] Type of the resource. Always
  19865. // compute#sslCertificate for SSL certificates.
  19866. Kind string `json:"kind,omitempty"`
  19867. // Name: Name of the resource. Provided by the client when the resource
  19868. // is created. The name must be 1-63 characters long, and comply with
  19869. // RFC1035. Specifically, the name must be 1-63 characters long and
  19870. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19871. // the first character must be a lowercase letter, and all following
  19872. // characters must be a dash, lowercase letter, or digit, except the
  19873. // last character, which cannot be a dash.
  19874. Name string `json:"name,omitempty"`
  19875. // PrivateKey: A write-only private key in PEM format. Only insert
  19876. // requests will include this field.
  19877. PrivateKey string `json:"privateKey,omitempty"`
  19878. // SelfLink: [Output only] Server-defined URL for the resource.
  19879. SelfLink string `json:"selfLink,omitempty"`
  19880. // ServerResponse contains the HTTP response code and headers from the
  19881. // server.
  19882. googleapi.ServerResponse `json:"-"`
  19883. // ForceSendFields is a list of field names (e.g. "Certificate") to
  19884. // unconditionally include in API requests. By default, fields with
  19885. // empty values are omitted from API requests. However, any non-pointer,
  19886. // non-interface field appearing in ForceSendFields will be sent to the
  19887. // server regardless of whether the field is empty or not. This may be
  19888. // used to include empty fields in Patch requests.
  19889. ForceSendFields []string `json:"-"`
  19890. // NullFields is a list of field names (e.g. "Certificate") to include
  19891. // in API requests with the JSON null value. By default, fields with
  19892. // empty values are omitted from API requests. However, any field with
  19893. // an empty value appearing in NullFields will be sent to the server as
  19894. // null. It is an error if a field in this list has a non-empty value.
  19895. // This may be used to include null fields in Patch requests.
  19896. NullFields []string `json:"-"`
  19897. }
  19898. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  19899. type NoMethod SslCertificate
  19900. raw := NoMethod(*s)
  19901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19902. }
  19903. // SslCertificateList: Contains a list of SslCertificate resources.
  19904. type SslCertificateList struct {
  19905. // Id: [Output Only] Unique identifier for the resource; defined by the
  19906. // server.
  19907. Id string `json:"id,omitempty"`
  19908. // Items: A list of SslCertificate resources.
  19909. Items []*SslCertificate `json:"items,omitempty"`
  19910. // Kind: Type of resource.
  19911. Kind string `json:"kind,omitempty"`
  19912. // NextPageToken: [Output Only] This token allows you to get the next
  19913. // page of results for list requests. If the number of results is larger
  19914. // than maxResults, use the nextPageToken as a value for the query
  19915. // parameter pageToken in the next list request. Subsequent list
  19916. // requests will have their own nextPageToken to continue paging through
  19917. // the results.
  19918. NextPageToken string `json:"nextPageToken,omitempty"`
  19919. // SelfLink: [Output Only] Server-defined URL for this resource.
  19920. SelfLink string `json:"selfLink,omitempty"`
  19921. // Warning: [Output Only] Informational warning message.
  19922. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  19923. // ServerResponse contains the HTTP response code and headers from the
  19924. // server.
  19925. googleapi.ServerResponse `json:"-"`
  19926. // ForceSendFields is a list of field names (e.g. "Id") to
  19927. // unconditionally include in API requests. By default, fields with
  19928. // empty values are omitted from API requests. However, any non-pointer,
  19929. // non-interface field appearing in ForceSendFields will be sent to the
  19930. // server regardless of whether the field is empty or not. This may be
  19931. // used to include empty fields in Patch requests.
  19932. ForceSendFields []string `json:"-"`
  19933. // NullFields is a list of field names (e.g. "Id") to include in API
  19934. // requests with the JSON null value. By default, fields with empty
  19935. // values are omitted from API requests. However, any field with an
  19936. // empty value appearing in NullFields will be sent to the server as
  19937. // null. It is an error if a field in this list has a non-empty value.
  19938. // This may be used to include null fields in Patch requests.
  19939. NullFields []string `json:"-"`
  19940. }
  19941. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  19942. type NoMethod SslCertificateList
  19943. raw := NoMethod(*s)
  19944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19945. }
  19946. // SslCertificateListWarning: [Output Only] Informational warning
  19947. // message.
  19948. type SslCertificateListWarning struct {
  19949. // Code: [Output Only] A warning code, if applicable. For example,
  19950. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19951. // the response.
  19952. //
  19953. // Possible values:
  19954. // "CLEANUP_FAILED"
  19955. // "DEPRECATED_RESOURCE_USED"
  19956. // "DEPRECATED_TYPE_USED"
  19957. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19958. // "EXPERIMENTAL_TYPE_USED"
  19959. // "EXTERNAL_API_WARNING"
  19960. // "FIELD_VALUE_OVERRIDEN"
  19961. // "INJECTED_KERNELS_DEPRECATED"
  19962. // "MISSING_TYPE_DEPENDENCY"
  19963. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19964. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19965. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19966. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19967. // "NEXT_HOP_NOT_RUNNING"
  19968. // "NOT_CRITICAL_ERROR"
  19969. // "NO_RESULTS_ON_PAGE"
  19970. // "REQUIRED_TOS_AGREEMENT"
  19971. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19972. // "RESOURCE_NOT_DELETED"
  19973. // "SCHEMA_VALIDATION_IGNORED"
  19974. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19975. // "UNDECLARED_PROPERTIES"
  19976. // "UNREACHABLE"
  19977. Code string `json:"code,omitempty"`
  19978. // Data: [Output Only] Metadata about this warning in key: value format.
  19979. // For example:
  19980. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19981. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  19982. // Message: [Output Only] A human-readable description of the warning
  19983. // code.
  19984. Message string `json:"message,omitempty"`
  19985. // ForceSendFields is a list of field names (e.g. "Code") to
  19986. // unconditionally include in API requests. By default, fields with
  19987. // empty values are omitted from API requests. However, any non-pointer,
  19988. // non-interface field appearing in ForceSendFields will be sent to the
  19989. // server regardless of whether the field is empty or not. This may be
  19990. // used to include empty fields in Patch requests.
  19991. ForceSendFields []string `json:"-"`
  19992. // NullFields is a list of field names (e.g. "Code") to include in API
  19993. // requests with the JSON null value. By default, fields with empty
  19994. // values are omitted from API requests. However, any field with an
  19995. // empty value appearing in NullFields will be sent to the server as
  19996. // null. It is an error if a field in this list has a non-empty value.
  19997. // This may be used to include null fields in Patch requests.
  19998. NullFields []string `json:"-"`
  19999. }
  20000. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  20001. type NoMethod SslCertificateListWarning
  20002. raw := NoMethod(*s)
  20003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20004. }
  20005. type SslCertificateListWarningData struct {
  20006. // Key: [Output Only] A key that provides more detail on the warning
  20007. // being returned. For example, for warnings where there are no results
  20008. // in a list request for a particular zone, this key might be scope and
  20009. // the key value might be the zone name. Other examples might be a key
  20010. // indicating a deprecated resource and a suggested replacement, or a
  20011. // warning about invalid network settings (for example, if an instance
  20012. // attempts to perform IP forwarding but is not enabled for IP
  20013. // forwarding).
  20014. Key string `json:"key,omitempty"`
  20015. // Value: [Output Only] A warning data value corresponding to the key.
  20016. Value string `json:"value,omitempty"`
  20017. // ForceSendFields is a list of field names (e.g. "Key") to
  20018. // unconditionally include in API requests. By default, fields with
  20019. // empty values are omitted from API requests. However, any non-pointer,
  20020. // non-interface field appearing in ForceSendFields will be sent to the
  20021. // server regardless of whether the field is empty or not. This may be
  20022. // used to include empty fields in Patch requests.
  20023. ForceSendFields []string `json:"-"`
  20024. // NullFields is a list of field names (e.g. "Key") to include in API
  20025. // requests with the JSON null value. By default, fields with empty
  20026. // values are omitted from API requests. However, any field with an
  20027. // empty value appearing in NullFields will be sent to the server as
  20028. // null. It is an error if a field in this list has a non-empty value.
  20029. // This may be used to include null fields in Patch requests.
  20030. NullFields []string `json:"-"`
  20031. }
  20032. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  20033. type NoMethod SslCertificateListWarningData
  20034. raw := NoMethod(*s)
  20035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20036. }
  20037. type SslPoliciesList struct {
  20038. // Id: [Output Only] Unique identifier for the resource; defined by the
  20039. // server.
  20040. Id string `json:"id,omitempty"`
  20041. // Items: A list of SslPolicy resources.
  20042. Items []*SslPolicy `json:"items,omitempty"`
  20043. // Kind: [Output Only] Type of the resource. Always
  20044. // compute#sslPoliciesList for lists of sslPolicies.
  20045. Kind string `json:"kind,omitempty"`
  20046. // NextPageToken: [Output Only] This token allows you to get the next
  20047. // page of results for list requests. If the number of results is larger
  20048. // than maxResults, use the nextPageToken as a value for the query
  20049. // parameter pageToken in the next list request. Subsequent list
  20050. // requests will have their own nextPageToken to continue paging through
  20051. // the results.
  20052. NextPageToken string `json:"nextPageToken,omitempty"`
  20053. // SelfLink: [Output Only] Server-defined URL for this resource.
  20054. SelfLink string `json:"selfLink,omitempty"`
  20055. // Warning: [Output Only] Informational warning message.
  20056. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  20057. // ServerResponse contains the HTTP response code and headers from the
  20058. // server.
  20059. googleapi.ServerResponse `json:"-"`
  20060. // ForceSendFields is a list of field names (e.g. "Id") to
  20061. // unconditionally include in API requests. By default, fields with
  20062. // empty values are omitted from API requests. However, any non-pointer,
  20063. // non-interface field appearing in ForceSendFields will be sent to the
  20064. // server regardless of whether the field is empty or not. This may be
  20065. // used to include empty fields in Patch requests.
  20066. ForceSendFields []string `json:"-"`
  20067. // NullFields is a list of field names (e.g. "Id") to include in API
  20068. // requests with the JSON null value. By default, fields with empty
  20069. // values are omitted from API requests. However, any field with an
  20070. // empty value appearing in NullFields will be sent to the server as
  20071. // null. It is an error if a field in this list has a non-empty value.
  20072. // This may be used to include null fields in Patch requests.
  20073. NullFields []string `json:"-"`
  20074. }
  20075. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  20076. type NoMethod SslPoliciesList
  20077. raw := NoMethod(*s)
  20078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20079. }
  20080. // SslPoliciesListWarning: [Output Only] Informational warning message.
  20081. type SslPoliciesListWarning struct {
  20082. // Code: [Output Only] A warning code, if applicable. For example,
  20083. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20084. // the response.
  20085. //
  20086. // Possible values:
  20087. // "CLEANUP_FAILED"
  20088. // "DEPRECATED_RESOURCE_USED"
  20089. // "DEPRECATED_TYPE_USED"
  20090. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20091. // "EXPERIMENTAL_TYPE_USED"
  20092. // "EXTERNAL_API_WARNING"
  20093. // "FIELD_VALUE_OVERRIDEN"
  20094. // "INJECTED_KERNELS_DEPRECATED"
  20095. // "MISSING_TYPE_DEPENDENCY"
  20096. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20097. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20098. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20099. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20100. // "NEXT_HOP_NOT_RUNNING"
  20101. // "NOT_CRITICAL_ERROR"
  20102. // "NO_RESULTS_ON_PAGE"
  20103. // "REQUIRED_TOS_AGREEMENT"
  20104. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20105. // "RESOURCE_NOT_DELETED"
  20106. // "SCHEMA_VALIDATION_IGNORED"
  20107. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20108. // "UNDECLARED_PROPERTIES"
  20109. // "UNREACHABLE"
  20110. Code string `json:"code,omitempty"`
  20111. // Data: [Output Only] Metadata about this warning in key: value format.
  20112. // For example:
  20113. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20114. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  20115. // Message: [Output Only] A human-readable description of the warning
  20116. // code.
  20117. Message string `json:"message,omitempty"`
  20118. // ForceSendFields is a list of field names (e.g. "Code") to
  20119. // unconditionally include in API requests. By default, fields with
  20120. // empty values are omitted from API requests. However, any non-pointer,
  20121. // non-interface field appearing in ForceSendFields will be sent to the
  20122. // server regardless of whether the field is empty or not. This may be
  20123. // used to include empty fields in Patch requests.
  20124. ForceSendFields []string `json:"-"`
  20125. // NullFields is a list of field names (e.g. "Code") to include in API
  20126. // requests with the JSON null value. By default, fields with empty
  20127. // values are omitted from API requests. However, any field with an
  20128. // empty value appearing in NullFields will be sent to the server as
  20129. // null. It is an error if a field in this list has a non-empty value.
  20130. // This may be used to include null fields in Patch requests.
  20131. NullFields []string `json:"-"`
  20132. }
  20133. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  20134. type NoMethod SslPoliciesListWarning
  20135. raw := NoMethod(*s)
  20136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20137. }
  20138. type SslPoliciesListWarningData struct {
  20139. // Key: [Output Only] A key that provides more detail on the warning
  20140. // being returned. For example, for warnings where there are no results
  20141. // in a list request for a particular zone, this key might be scope and
  20142. // the key value might be the zone name. Other examples might be a key
  20143. // indicating a deprecated resource and a suggested replacement, or a
  20144. // warning about invalid network settings (for example, if an instance
  20145. // attempts to perform IP forwarding but is not enabled for IP
  20146. // forwarding).
  20147. Key string `json:"key,omitempty"`
  20148. // Value: [Output Only] A warning data value corresponding to the key.
  20149. Value string `json:"value,omitempty"`
  20150. // ForceSendFields is a list of field names (e.g. "Key") to
  20151. // unconditionally include in API requests. By default, fields with
  20152. // empty values are omitted from API requests. However, any non-pointer,
  20153. // non-interface field appearing in ForceSendFields will be sent to the
  20154. // server regardless of whether the field is empty or not. This may be
  20155. // used to include empty fields in Patch requests.
  20156. ForceSendFields []string `json:"-"`
  20157. // NullFields is a list of field names (e.g. "Key") to include in API
  20158. // requests with the JSON null value. By default, fields with empty
  20159. // values are omitted from API requests. However, any field with an
  20160. // empty value appearing in NullFields will be sent to the server as
  20161. // null. It is an error if a field in this list has a non-empty value.
  20162. // This may be used to include null fields in Patch requests.
  20163. NullFields []string `json:"-"`
  20164. }
  20165. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  20166. type NoMethod SslPoliciesListWarningData
  20167. raw := NoMethod(*s)
  20168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20169. }
  20170. type SslPoliciesListAvailableFeaturesResponse struct {
  20171. Features []string `json:"features,omitempty"`
  20172. // ServerResponse contains the HTTP response code and headers from the
  20173. // server.
  20174. googleapi.ServerResponse `json:"-"`
  20175. // ForceSendFields is a list of field names (e.g. "Features") to
  20176. // unconditionally include in API requests. By default, fields with
  20177. // empty values are omitted from API requests. However, any non-pointer,
  20178. // non-interface field appearing in ForceSendFields will be sent to the
  20179. // server regardless of whether the field is empty or not. This may be
  20180. // used to include empty fields in Patch requests.
  20181. ForceSendFields []string `json:"-"`
  20182. // NullFields is a list of field names (e.g. "Features") to include in
  20183. // API requests with the JSON null value. By default, fields with empty
  20184. // values are omitted from API requests. However, any field with an
  20185. // empty value appearing in NullFields will be sent to the server as
  20186. // null. It is an error if a field in this list has a non-empty value.
  20187. // This may be used to include null fields in Patch requests.
  20188. NullFields []string `json:"-"`
  20189. }
  20190. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  20191. type NoMethod SslPoliciesListAvailableFeaturesResponse
  20192. raw := NoMethod(*s)
  20193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20194. }
  20195. // SslPolicy: A SSL policy specifies the server-side support for SSL
  20196. // features. This can be attached to a TargetHttpsProxy or a
  20197. // TargetSslProxy. This affects connections between clients and the
  20198. // HTTPS or SSL proxy load balancer. They do not affect the connection
  20199. // between the load balancers and the backends.
  20200. type SslPolicy struct {
  20201. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20202. // format.
  20203. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20204. // CustomFeatures: A list of features enabled when the selected profile
  20205. // is CUSTOM. The
  20206. // - method returns the set of features that can be specified in this
  20207. // list. This field must be empty if the profile is not CUSTOM.
  20208. CustomFeatures []string `json:"customFeatures,omitempty"`
  20209. // Description: An optional description of this resource. Provide this
  20210. // property when you create the resource.
  20211. Description string `json:"description,omitempty"`
  20212. // EnabledFeatures: [Output Only] The list of features enabled in the
  20213. // SSL policy.
  20214. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  20215. // Fingerprint: Fingerprint of this resource. A hash of the contents
  20216. // stored in this object. This field is used in optimistic locking. This
  20217. // field will be ignored when inserting a SslPolicy. An up-to-date
  20218. // fingerprint must be provided in order to update the SslPolicy,
  20219. // otherwise the request will fail with error 412 conditionNotMet.
  20220. //
  20221. // To see the latest fingerprint, make a get() request to retrieve an
  20222. // SslPolicy.
  20223. Fingerprint string `json:"fingerprint,omitempty"`
  20224. // Id: [Output Only] The unique identifier for the resource. This
  20225. // identifier is defined by the server.
  20226. Id uint64 `json:"id,omitempty,string"`
  20227. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  20228. // SSL policies.
  20229. Kind string `json:"kind,omitempty"`
  20230. // MinTlsVersion: The minimum version of SSL protocol that can be used
  20231. // by the clients to establish a connection with the load balancer. This
  20232. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  20233. //
  20234. // Possible values:
  20235. // "TLS_1_0"
  20236. // "TLS_1_1"
  20237. // "TLS_1_2"
  20238. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  20239. // Name: Name of the resource. The name must be 1-63 characters long,
  20240. // and comply with RFC1035. Specifically, the name must be 1-63
  20241. // characters long and match the regular expression
  20242. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20243. // a lowercase letter, and all following characters must be a dash,
  20244. // lowercase letter, or digit, except the last character, which cannot
  20245. // be a dash.
  20246. Name string `json:"name,omitempty"`
  20247. // Profile: Profile specifies the set of SSL features that can be used
  20248. // by the load balancer when negotiating SSL with clients. This can be
  20249. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  20250. // the set of SSL features to enable must be specified in the
  20251. // customFeatures field.
  20252. //
  20253. // Possible values:
  20254. // "COMPATIBLE"
  20255. // "CUSTOM"
  20256. // "MODERN"
  20257. // "RESTRICTED"
  20258. Profile string `json:"profile,omitempty"`
  20259. // SelfLink: [Output Only] Server-defined URL for the resource.
  20260. SelfLink string `json:"selfLink,omitempty"`
  20261. // Warnings: [Output Only] If potential misconfigurations are detected
  20262. // for this SSL policy, this field will be populated with warning
  20263. // messages.
  20264. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  20265. // ServerResponse contains the HTTP response code and headers from the
  20266. // server.
  20267. googleapi.ServerResponse `json:"-"`
  20268. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20269. // to unconditionally include in API requests. By default, fields with
  20270. // empty values are omitted from API requests. However, any non-pointer,
  20271. // non-interface field appearing in ForceSendFields will be sent to the
  20272. // server regardless of whether the field is empty or not. This may be
  20273. // used to include empty fields in Patch requests.
  20274. ForceSendFields []string `json:"-"`
  20275. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20276. // include in API requests with the JSON null value. By default, fields
  20277. // with empty values are omitted from API requests. However, any field
  20278. // with an empty value appearing in NullFields will be sent to the
  20279. // server as null. It is an error if a field in this list has a
  20280. // non-empty value. This may be used to include null fields in Patch
  20281. // requests.
  20282. NullFields []string `json:"-"`
  20283. }
  20284. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  20285. type NoMethod SslPolicy
  20286. raw := NoMethod(*s)
  20287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20288. }
  20289. type SslPolicyWarnings struct {
  20290. // Code: [Output Only] A warning code, if applicable. For example,
  20291. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20292. // the response.
  20293. //
  20294. // Possible values:
  20295. // "CLEANUP_FAILED"
  20296. // "DEPRECATED_RESOURCE_USED"
  20297. // "DEPRECATED_TYPE_USED"
  20298. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20299. // "EXPERIMENTAL_TYPE_USED"
  20300. // "EXTERNAL_API_WARNING"
  20301. // "FIELD_VALUE_OVERRIDEN"
  20302. // "INJECTED_KERNELS_DEPRECATED"
  20303. // "MISSING_TYPE_DEPENDENCY"
  20304. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20305. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20306. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20307. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20308. // "NEXT_HOP_NOT_RUNNING"
  20309. // "NOT_CRITICAL_ERROR"
  20310. // "NO_RESULTS_ON_PAGE"
  20311. // "REQUIRED_TOS_AGREEMENT"
  20312. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20313. // "RESOURCE_NOT_DELETED"
  20314. // "SCHEMA_VALIDATION_IGNORED"
  20315. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20316. // "UNDECLARED_PROPERTIES"
  20317. // "UNREACHABLE"
  20318. Code string `json:"code,omitempty"`
  20319. // Data: [Output Only] Metadata about this warning in key: value format.
  20320. // For example:
  20321. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20322. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  20323. // Message: [Output Only] A human-readable description of the warning
  20324. // code.
  20325. Message string `json:"message,omitempty"`
  20326. // ForceSendFields is a list of field names (e.g. "Code") to
  20327. // unconditionally include in API requests. By default, fields with
  20328. // empty values are omitted from API requests. However, any non-pointer,
  20329. // non-interface field appearing in ForceSendFields will be sent to the
  20330. // server regardless of whether the field is empty or not. This may be
  20331. // used to include empty fields in Patch requests.
  20332. ForceSendFields []string `json:"-"`
  20333. // NullFields is a list of field names (e.g. "Code") to include in API
  20334. // requests with the JSON null value. By default, fields with empty
  20335. // values are omitted from API requests. However, any field with an
  20336. // empty value appearing in NullFields will be sent to the server as
  20337. // null. It is an error if a field in this list has a non-empty value.
  20338. // This may be used to include null fields in Patch requests.
  20339. NullFields []string `json:"-"`
  20340. }
  20341. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  20342. type NoMethod SslPolicyWarnings
  20343. raw := NoMethod(*s)
  20344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20345. }
  20346. type SslPolicyWarningsData struct {
  20347. // Key: [Output Only] A key that provides more detail on the warning
  20348. // being returned. For example, for warnings where there are no results
  20349. // in a list request for a particular zone, this key might be scope and
  20350. // the key value might be the zone name. Other examples might be a key
  20351. // indicating a deprecated resource and a suggested replacement, or a
  20352. // warning about invalid network settings (for example, if an instance
  20353. // attempts to perform IP forwarding but is not enabled for IP
  20354. // forwarding).
  20355. Key string `json:"key,omitempty"`
  20356. // Value: [Output Only] A warning data value corresponding to the key.
  20357. Value string `json:"value,omitempty"`
  20358. // ForceSendFields is a list of field names (e.g. "Key") to
  20359. // unconditionally include in API requests. By default, fields with
  20360. // empty values are omitted from API requests. However, any non-pointer,
  20361. // non-interface field appearing in ForceSendFields will be sent to the
  20362. // server regardless of whether the field is empty or not. This may be
  20363. // used to include empty fields in Patch requests.
  20364. ForceSendFields []string `json:"-"`
  20365. // NullFields is a list of field names (e.g. "Key") to include in API
  20366. // requests with the JSON null value. By default, fields with empty
  20367. // values are omitted from API requests. However, any field with an
  20368. // empty value appearing in NullFields will be sent to the server as
  20369. // null. It is an error if a field in this list has a non-empty value.
  20370. // This may be used to include null fields in Patch requests.
  20371. NullFields []string `json:"-"`
  20372. }
  20373. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  20374. type NoMethod SslPolicyWarningsData
  20375. raw := NoMethod(*s)
  20376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20377. }
  20378. type SslPolicyReference struct {
  20379. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  20380. // to clear any existing SSL policy associated with the target proxy
  20381. // resource.
  20382. SslPolicy string `json:"sslPolicy,omitempty"`
  20383. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  20384. // unconditionally include in API requests. By default, fields with
  20385. // empty values are omitted from API requests. However, any non-pointer,
  20386. // non-interface field appearing in ForceSendFields will be sent to the
  20387. // server regardless of whether the field is empty or not. This may be
  20388. // used to include empty fields in Patch requests.
  20389. ForceSendFields []string `json:"-"`
  20390. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  20391. // API requests with the JSON null value. By default, fields with empty
  20392. // values are omitted from API requests. However, any field with an
  20393. // empty value appearing in NullFields will be sent to the server as
  20394. // null. It is an error if a field in this list has a non-empty value.
  20395. // This may be used to include null fields in Patch requests.
  20396. NullFields []string `json:"-"`
  20397. }
  20398. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  20399. type NoMethod SslPolicyReference
  20400. raw := NoMethod(*s)
  20401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20402. }
  20403. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  20404. // ==) (== resource_for v1.subnetworks ==)
  20405. type Subnetwork struct {
  20406. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20407. // format.
  20408. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20409. // Description: An optional description of this resource. Provide this
  20410. // property when you create the resource. This field can be set only at
  20411. // resource creation time.
  20412. Description string `json:"description,omitempty"`
  20413. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  20414. // If this field is not explicitly set, it will not appear in get
  20415. // listings. If not set the default behavior is to disable flow logging.
  20416. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  20417. // Fingerprint: Fingerprint of this resource. A hash of the contents
  20418. // stored in this object. This field is used in optimistic locking. This
  20419. // field will be ignored when inserting a Subnetwork. An up-to-date
  20420. // fingerprint must be provided in order to update the Subnetwork,
  20421. // otherwise the request will fail with error 412 conditionNotMet.
  20422. //
  20423. // To see the latest fingerprint, make a get() request to retrieve a
  20424. // Subnetwork.
  20425. Fingerprint string `json:"fingerprint,omitempty"`
  20426. // GatewayAddress: [Output Only] The gateway address for default routes
  20427. // to reach destination addresses outside this subnetwork.
  20428. GatewayAddress string `json:"gatewayAddress,omitempty"`
  20429. // Id: [Output Only] The unique identifier for the resource. This
  20430. // identifier is defined by the server.
  20431. Id uint64 `json:"id,omitempty,string"`
  20432. // IpCidrRange: The range of internal addresses that are owned by this
  20433. // subnetwork. Provide this property when you create the subnetwork. For
  20434. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  20435. // non-overlapping within a network. Only IPv4 is supported. This field
  20436. // can be set only at resource creation time.
  20437. IpCidrRange string `json:"ipCidrRange,omitempty"`
  20438. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  20439. // for Subnetwork resources.
  20440. Kind string `json:"kind,omitempty"`
  20441. // Name: The name of the resource, provided by the client when initially
  20442. // creating the resource. The name must be 1-63 characters long, and
  20443. // comply with RFC1035. Specifically, the name must be 1-63 characters
  20444. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  20445. // which means the first character must be a lowercase letter, and all
  20446. // following characters must be a dash, lowercase letter, or digit,
  20447. // except the last character, which cannot be a dash.
  20448. Name string `json:"name,omitempty"`
  20449. // Network: The URL of the network to which this subnetwork belongs,
  20450. // provided by the client when initially creating the subnetwork. Only
  20451. // networks that are in the distributed mode can have subnetworks. This
  20452. // field can be set only at resource creation time.
  20453. Network string `json:"network,omitempty"`
  20454. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  20455. // Google services without assigned external IP addresses. This field
  20456. // can be both set at resource creation time and updated using
  20457. // setPrivateIpGoogleAccess.
  20458. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  20459. // Region: URL of the region where the Subnetwork resides. This field
  20460. // can be set only at resource creation time.
  20461. Region string `json:"region,omitempty"`
  20462. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  20463. // for VM instances contained in this subnetwork. The primary IP of such
  20464. // VM must belong to the primary ipCidrRange of the subnetwork. The
  20465. // alias IPs may belong to either primary or secondary ranges. This
  20466. // field can be updated with a patch request.
  20467. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  20468. // SelfLink: [Output Only] Server-defined URL for the resource.
  20469. SelfLink string `json:"selfLink,omitempty"`
  20470. // ServerResponse contains the HTTP response code and headers from the
  20471. // server.
  20472. googleapi.ServerResponse `json:"-"`
  20473. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20474. // to unconditionally include in API requests. By default, fields with
  20475. // empty values are omitted from API requests. However, any non-pointer,
  20476. // non-interface field appearing in ForceSendFields will be sent to the
  20477. // server regardless of whether the field is empty or not. This may be
  20478. // used to include empty fields in Patch requests.
  20479. ForceSendFields []string `json:"-"`
  20480. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20481. // include in API requests with the JSON null value. By default, fields
  20482. // with empty values are omitted from API requests. However, any field
  20483. // with an empty value appearing in NullFields will be sent to the
  20484. // server as null. It is an error if a field in this list has a
  20485. // non-empty value. This may be used to include null fields in Patch
  20486. // requests.
  20487. NullFields []string `json:"-"`
  20488. }
  20489. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  20490. type NoMethod Subnetwork
  20491. raw := NoMethod(*s)
  20492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20493. }
  20494. type SubnetworkAggregatedList struct {
  20495. // Id: [Output Only] Unique identifier for the resource; defined by the
  20496. // server.
  20497. Id string `json:"id,omitempty"`
  20498. // Items: A list of SubnetworksScopedList resources.
  20499. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  20500. // Kind: [Output Only] Type of resource. Always
  20501. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  20502. Kind string `json:"kind,omitempty"`
  20503. // NextPageToken: [Output Only] This token allows you to get the next
  20504. // page of results for list requests. If the number of results is larger
  20505. // than maxResults, use the nextPageToken as a value for the query
  20506. // parameter pageToken in the next list request. Subsequent list
  20507. // requests will have their own nextPageToken to continue paging through
  20508. // the results.
  20509. NextPageToken string `json:"nextPageToken,omitempty"`
  20510. // SelfLink: [Output Only] Server-defined URL for this resource.
  20511. SelfLink string `json:"selfLink,omitempty"`
  20512. // Warning: [Output Only] Informational warning message.
  20513. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  20514. // ServerResponse contains the HTTP response code and headers from the
  20515. // server.
  20516. googleapi.ServerResponse `json:"-"`
  20517. // ForceSendFields is a list of field names (e.g. "Id") to
  20518. // unconditionally include in API requests. By default, fields with
  20519. // empty values are omitted from API requests. However, any non-pointer,
  20520. // non-interface field appearing in ForceSendFields will be sent to the
  20521. // server regardless of whether the field is empty or not. This may be
  20522. // used to include empty fields in Patch requests.
  20523. ForceSendFields []string `json:"-"`
  20524. // NullFields is a list of field names (e.g. "Id") to include in API
  20525. // requests with the JSON null value. By default, fields with empty
  20526. // values are omitted from API requests. However, any field with an
  20527. // empty value appearing in NullFields will be sent to the server as
  20528. // null. It is an error if a field in this list has a non-empty value.
  20529. // This may be used to include null fields in Patch requests.
  20530. NullFields []string `json:"-"`
  20531. }
  20532. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  20533. type NoMethod SubnetworkAggregatedList
  20534. raw := NoMethod(*s)
  20535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20536. }
  20537. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  20538. // message.
  20539. type SubnetworkAggregatedListWarning struct {
  20540. // Code: [Output Only] A warning code, if applicable. For example,
  20541. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20542. // the response.
  20543. //
  20544. // Possible values:
  20545. // "CLEANUP_FAILED"
  20546. // "DEPRECATED_RESOURCE_USED"
  20547. // "DEPRECATED_TYPE_USED"
  20548. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20549. // "EXPERIMENTAL_TYPE_USED"
  20550. // "EXTERNAL_API_WARNING"
  20551. // "FIELD_VALUE_OVERRIDEN"
  20552. // "INJECTED_KERNELS_DEPRECATED"
  20553. // "MISSING_TYPE_DEPENDENCY"
  20554. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20555. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20556. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20557. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20558. // "NEXT_HOP_NOT_RUNNING"
  20559. // "NOT_CRITICAL_ERROR"
  20560. // "NO_RESULTS_ON_PAGE"
  20561. // "REQUIRED_TOS_AGREEMENT"
  20562. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20563. // "RESOURCE_NOT_DELETED"
  20564. // "SCHEMA_VALIDATION_IGNORED"
  20565. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20566. // "UNDECLARED_PROPERTIES"
  20567. // "UNREACHABLE"
  20568. Code string `json:"code,omitempty"`
  20569. // Data: [Output Only] Metadata about this warning in key: value format.
  20570. // For example:
  20571. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20572. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  20573. // Message: [Output Only] A human-readable description of the warning
  20574. // code.
  20575. Message string `json:"message,omitempty"`
  20576. // ForceSendFields is a list of field names (e.g. "Code") to
  20577. // unconditionally include in API requests. By default, fields with
  20578. // empty values are omitted from API requests. However, any non-pointer,
  20579. // non-interface field appearing in ForceSendFields will be sent to the
  20580. // server regardless of whether the field is empty or not. This may be
  20581. // used to include empty fields in Patch requests.
  20582. ForceSendFields []string `json:"-"`
  20583. // NullFields is a list of field names (e.g. "Code") to include in API
  20584. // requests with the JSON null value. By default, fields with empty
  20585. // values are omitted from API requests. However, any field with an
  20586. // empty value appearing in NullFields will be sent to the server as
  20587. // null. It is an error if a field in this list has a non-empty value.
  20588. // This may be used to include null fields in Patch requests.
  20589. NullFields []string `json:"-"`
  20590. }
  20591. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  20592. type NoMethod SubnetworkAggregatedListWarning
  20593. raw := NoMethod(*s)
  20594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20595. }
  20596. type SubnetworkAggregatedListWarningData struct {
  20597. // Key: [Output Only] A key that provides more detail on the warning
  20598. // being returned. For example, for warnings where there are no results
  20599. // in a list request for a particular zone, this key might be scope and
  20600. // the key value might be the zone name. Other examples might be a key
  20601. // indicating a deprecated resource and a suggested replacement, or a
  20602. // warning about invalid network settings (for example, if an instance
  20603. // attempts to perform IP forwarding but is not enabled for IP
  20604. // forwarding).
  20605. Key string `json:"key,omitempty"`
  20606. // Value: [Output Only] A warning data value corresponding to the key.
  20607. Value string `json:"value,omitempty"`
  20608. // ForceSendFields is a list of field names (e.g. "Key") to
  20609. // unconditionally include in API requests. By default, fields with
  20610. // empty values are omitted from API requests. However, any non-pointer,
  20611. // non-interface field appearing in ForceSendFields will be sent to the
  20612. // server regardless of whether the field is empty or not. This may be
  20613. // used to include empty fields in Patch requests.
  20614. ForceSendFields []string `json:"-"`
  20615. // NullFields is a list of field names (e.g. "Key") to include in API
  20616. // requests with the JSON null value. By default, fields with empty
  20617. // values are omitted from API requests. However, any field with an
  20618. // empty value appearing in NullFields will be sent to the server as
  20619. // null. It is an error if a field in this list has a non-empty value.
  20620. // This may be used to include null fields in Patch requests.
  20621. NullFields []string `json:"-"`
  20622. }
  20623. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  20624. type NoMethod SubnetworkAggregatedListWarningData
  20625. raw := NoMethod(*s)
  20626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20627. }
  20628. // SubnetworkList: Contains a list of Subnetwork resources.
  20629. type SubnetworkList struct {
  20630. // Id: [Output Only] Unique identifier for the resource; defined by the
  20631. // server.
  20632. Id string `json:"id,omitempty"`
  20633. // Items: A list of Subnetwork resources.
  20634. Items []*Subnetwork `json:"items,omitempty"`
  20635. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  20636. // for lists of subnetworks.
  20637. Kind string `json:"kind,omitempty"`
  20638. // NextPageToken: [Output Only] This token allows you to get the next
  20639. // page of results for list requests. If the number of results is larger
  20640. // than maxResults, use the nextPageToken as a value for the query
  20641. // parameter pageToken in the next list request. Subsequent list
  20642. // requests will have their own nextPageToken to continue paging through
  20643. // the results.
  20644. NextPageToken string `json:"nextPageToken,omitempty"`
  20645. // SelfLink: [Output Only] Server-defined URL for this resource.
  20646. SelfLink string `json:"selfLink,omitempty"`
  20647. // Warning: [Output Only] Informational warning message.
  20648. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  20649. // ServerResponse contains the HTTP response code and headers from the
  20650. // server.
  20651. googleapi.ServerResponse `json:"-"`
  20652. // ForceSendFields is a list of field names (e.g. "Id") to
  20653. // unconditionally include in API requests. By default, fields with
  20654. // empty values are omitted from API requests. However, any non-pointer,
  20655. // non-interface field appearing in ForceSendFields will be sent to the
  20656. // server regardless of whether the field is empty or not. This may be
  20657. // used to include empty fields in Patch requests.
  20658. ForceSendFields []string `json:"-"`
  20659. // NullFields is a list of field names (e.g. "Id") to include in API
  20660. // requests with the JSON null value. By default, fields with empty
  20661. // values are omitted from API requests. However, any field with an
  20662. // empty value appearing in NullFields will be sent to the server as
  20663. // null. It is an error if a field in this list has a non-empty value.
  20664. // This may be used to include null fields in Patch requests.
  20665. NullFields []string `json:"-"`
  20666. }
  20667. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  20668. type NoMethod SubnetworkList
  20669. raw := NoMethod(*s)
  20670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20671. }
  20672. // SubnetworkListWarning: [Output Only] Informational warning message.
  20673. type SubnetworkListWarning struct {
  20674. // Code: [Output Only] A warning code, if applicable. For example,
  20675. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20676. // the response.
  20677. //
  20678. // Possible values:
  20679. // "CLEANUP_FAILED"
  20680. // "DEPRECATED_RESOURCE_USED"
  20681. // "DEPRECATED_TYPE_USED"
  20682. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20683. // "EXPERIMENTAL_TYPE_USED"
  20684. // "EXTERNAL_API_WARNING"
  20685. // "FIELD_VALUE_OVERRIDEN"
  20686. // "INJECTED_KERNELS_DEPRECATED"
  20687. // "MISSING_TYPE_DEPENDENCY"
  20688. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20689. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20690. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20691. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20692. // "NEXT_HOP_NOT_RUNNING"
  20693. // "NOT_CRITICAL_ERROR"
  20694. // "NO_RESULTS_ON_PAGE"
  20695. // "REQUIRED_TOS_AGREEMENT"
  20696. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20697. // "RESOURCE_NOT_DELETED"
  20698. // "SCHEMA_VALIDATION_IGNORED"
  20699. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20700. // "UNDECLARED_PROPERTIES"
  20701. // "UNREACHABLE"
  20702. Code string `json:"code,omitempty"`
  20703. // Data: [Output Only] Metadata about this warning in key: value format.
  20704. // For example:
  20705. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20706. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  20707. // Message: [Output Only] A human-readable description of the warning
  20708. // code.
  20709. Message string `json:"message,omitempty"`
  20710. // ForceSendFields is a list of field names (e.g. "Code") to
  20711. // unconditionally include in API requests. By default, fields with
  20712. // empty values are omitted from API requests. However, any non-pointer,
  20713. // non-interface field appearing in ForceSendFields will be sent to the
  20714. // server regardless of whether the field is empty or not. This may be
  20715. // used to include empty fields in Patch requests.
  20716. ForceSendFields []string `json:"-"`
  20717. // NullFields is a list of field names (e.g. "Code") to include in API
  20718. // requests with the JSON null value. By default, fields with empty
  20719. // values are omitted from API requests. However, any field with an
  20720. // empty value appearing in NullFields will be sent to the server as
  20721. // null. It is an error if a field in this list has a non-empty value.
  20722. // This may be used to include null fields in Patch requests.
  20723. NullFields []string `json:"-"`
  20724. }
  20725. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  20726. type NoMethod SubnetworkListWarning
  20727. raw := NoMethod(*s)
  20728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20729. }
  20730. type SubnetworkListWarningData struct {
  20731. // Key: [Output Only] A key that provides more detail on the warning
  20732. // being returned. For example, for warnings where there are no results
  20733. // in a list request for a particular zone, this key might be scope and
  20734. // the key value might be the zone name. Other examples might be a key
  20735. // indicating a deprecated resource and a suggested replacement, or a
  20736. // warning about invalid network settings (for example, if an instance
  20737. // attempts to perform IP forwarding but is not enabled for IP
  20738. // forwarding).
  20739. Key string `json:"key,omitempty"`
  20740. // Value: [Output Only] A warning data value corresponding to the key.
  20741. Value string `json:"value,omitempty"`
  20742. // ForceSendFields is a list of field names (e.g. "Key") to
  20743. // unconditionally include in API requests. By default, fields with
  20744. // empty values are omitted from API requests. However, any non-pointer,
  20745. // non-interface field appearing in ForceSendFields will be sent to the
  20746. // server regardless of whether the field is empty or not. This may be
  20747. // used to include empty fields in Patch requests.
  20748. ForceSendFields []string `json:"-"`
  20749. // NullFields is a list of field names (e.g. "Key") to include in API
  20750. // requests with the JSON null value. By default, fields with empty
  20751. // values are omitted from API requests. However, any field with an
  20752. // empty value appearing in NullFields will be sent to the server as
  20753. // null. It is an error if a field in this list has a non-empty value.
  20754. // This may be used to include null fields in Patch requests.
  20755. NullFields []string `json:"-"`
  20756. }
  20757. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  20758. type NoMethod SubnetworkListWarningData
  20759. raw := NoMethod(*s)
  20760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20761. }
  20762. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  20763. // subnetwork.
  20764. type SubnetworkSecondaryRange struct {
  20765. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  20766. // secondary range. Provide this property when you create the
  20767. // subnetwork. Ranges must be unique and non-overlapping with all
  20768. // primary and secondary IP ranges within a network. Only IPv4 is
  20769. // supported.
  20770. IpCidrRange string `json:"ipCidrRange,omitempty"`
  20771. // RangeName: The name associated with this subnetwork secondary range,
  20772. // used when adding an alias IP range to a VM instance. The name must be
  20773. // 1-63 characters long, and comply with RFC1035. The name must be
  20774. // unique within the subnetwork.
  20775. RangeName string `json:"rangeName,omitempty"`
  20776. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  20777. // unconditionally include in API requests. By default, fields with
  20778. // empty values are omitted from API requests. However, any non-pointer,
  20779. // non-interface field appearing in ForceSendFields will be sent to the
  20780. // server regardless of whether the field is empty or not. This may be
  20781. // used to include empty fields in Patch requests.
  20782. ForceSendFields []string `json:"-"`
  20783. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  20784. // in API requests with the JSON null value. By default, fields with
  20785. // empty values are omitted from API requests. However, any field with
  20786. // an empty value appearing in NullFields will be sent to the server as
  20787. // null. It is an error if a field in this list has a non-empty value.
  20788. // This may be used to include null fields in Patch requests.
  20789. NullFields []string `json:"-"`
  20790. }
  20791. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  20792. type NoMethod SubnetworkSecondaryRange
  20793. raw := NoMethod(*s)
  20794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20795. }
  20796. type SubnetworksExpandIpCidrRangeRequest struct {
  20797. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  20798. // that are legal on this Subnetwork. This range should be disjoint from
  20799. // other subnetworks within this network. This range can only be larger
  20800. // than (i.e. a superset of) the range previously defined before the
  20801. // update.
  20802. IpCidrRange string `json:"ipCidrRange,omitempty"`
  20803. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  20804. // unconditionally include in API requests. By default, fields with
  20805. // empty values are omitted from API requests. However, any non-pointer,
  20806. // non-interface field appearing in ForceSendFields will be sent to the
  20807. // server regardless of whether the field is empty or not. This may be
  20808. // used to include empty fields in Patch requests.
  20809. ForceSendFields []string `json:"-"`
  20810. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  20811. // in API requests with the JSON null value. By default, fields with
  20812. // empty values are omitted from API requests. However, any field with
  20813. // an empty value appearing in NullFields will be sent to the server as
  20814. // null. It is an error if a field in this list has a non-empty value.
  20815. // This may be used to include null fields in Patch requests.
  20816. NullFields []string `json:"-"`
  20817. }
  20818. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  20819. type NoMethod SubnetworksExpandIpCidrRangeRequest
  20820. raw := NoMethod(*s)
  20821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20822. }
  20823. type SubnetworksScopedList struct {
  20824. // Subnetworks: A list of subnetworks contained in this scope.
  20825. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  20826. // Warning: An informational warning that appears when the list of
  20827. // addresses is empty.
  20828. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  20829. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  20830. // unconditionally include in API requests. By default, fields with
  20831. // empty values are omitted from API requests. However, any non-pointer,
  20832. // non-interface field appearing in ForceSendFields will be sent to the
  20833. // server regardless of whether the field is empty or not. This may be
  20834. // used to include empty fields in Patch requests.
  20835. ForceSendFields []string `json:"-"`
  20836. // NullFields is a list of field names (e.g. "Subnetworks") to include
  20837. // in API requests with the JSON null value. By default, fields with
  20838. // empty values are omitted from API requests. However, any field with
  20839. // an empty value appearing in NullFields will be sent to the server as
  20840. // null. It is an error if a field in this list has a non-empty value.
  20841. // This may be used to include null fields in Patch requests.
  20842. NullFields []string `json:"-"`
  20843. }
  20844. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  20845. type NoMethod SubnetworksScopedList
  20846. raw := NoMethod(*s)
  20847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20848. }
  20849. // SubnetworksScopedListWarning: An informational warning that appears
  20850. // when the list of addresses is empty.
  20851. type SubnetworksScopedListWarning struct {
  20852. // Code: [Output Only] A warning code, if applicable. For example,
  20853. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20854. // the response.
  20855. //
  20856. // Possible values:
  20857. // "CLEANUP_FAILED"
  20858. // "DEPRECATED_RESOURCE_USED"
  20859. // "DEPRECATED_TYPE_USED"
  20860. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20861. // "EXPERIMENTAL_TYPE_USED"
  20862. // "EXTERNAL_API_WARNING"
  20863. // "FIELD_VALUE_OVERRIDEN"
  20864. // "INJECTED_KERNELS_DEPRECATED"
  20865. // "MISSING_TYPE_DEPENDENCY"
  20866. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20867. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20868. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20869. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20870. // "NEXT_HOP_NOT_RUNNING"
  20871. // "NOT_CRITICAL_ERROR"
  20872. // "NO_RESULTS_ON_PAGE"
  20873. // "REQUIRED_TOS_AGREEMENT"
  20874. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20875. // "RESOURCE_NOT_DELETED"
  20876. // "SCHEMA_VALIDATION_IGNORED"
  20877. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20878. // "UNDECLARED_PROPERTIES"
  20879. // "UNREACHABLE"
  20880. Code string `json:"code,omitempty"`
  20881. // Data: [Output Only] Metadata about this warning in key: value format.
  20882. // For example:
  20883. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20884. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  20885. // Message: [Output Only] A human-readable description of the warning
  20886. // code.
  20887. Message string `json:"message,omitempty"`
  20888. // ForceSendFields is a list of field names (e.g. "Code") to
  20889. // unconditionally include in API requests. By default, fields with
  20890. // empty values are omitted from API requests. However, any non-pointer,
  20891. // non-interface field appearing in ForceSendFields will be sent to the
  20892. // server regardless of whether the field is empty or not. This may be
  20893. // used to include empty fields in Patch requests.
  20894. ForceSendFields []string `json:"-"`
  20895. // NullFields is a list of field names (e.g. "Code") to include in API
  20896. // requests with the JSON null value. By default, fields with empty
  20897. // values are omitted from API requests. However, any field with an
  20898. // empty value appearing in NullFields will be sent to the server as
  20899. // null. It is an error if a field in this list has a non-empty value.
  20900. // This may be used to include null fields in Patch requests.
  20901. NullFields []string `json:"-"`
  20902. }
  20903. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  20904. type NoMethod SubnetworksScopedListWarning
  20905. raw := NoMethod(*s)
  20906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20907. }
  20908. type SubnetworksScopedListWarningData struct {
  20909. // Key: [Output Only] A key that provides more detail on the warning
  20910. // being returned. For example, for warnings where there are no results
  20911. // in a list request for a particular zone, this key might be scope and
  20912. // the key value might be the zone name. Other examples might be a key
  20913. // indicating a deprecated resource and a suggested replacement, or a
  20914. // warning about invalid network settings (for example, if an instance
  20915. // attempts to perform IP forwarding but is not enabled for IP
  20916. // forwarding).
  20917. Key string `json:"key,omitempty"`
  20918. // Value: [Output Only] A warning data value corresponding to the key.
  20919. Value string `json:"value,omitempty"`
  20920. // ForceSendFields is a list of field names (e.g. "Key") to
  20921. // unconditionally include in API requests. By default, fields with
  20922. // empty values are omitted from API requests. However, any non-pointer,
  20923. // non-interface field appearing in ForceSendFields will be sent to the
  20924. // server regardless of whether the field is empty or not. This may be
  20925. // used to include empty fields in Patch requests.
  20926. ForceSendFields []string `json:"-"`
  20927. // NullFields is a list of field names (e.g. "Key") to include in API
  20928. // requests with the JSON null value. By default, fields with empty
  20929. // values are omitted from API requests. However, any field with an
  20930. // empty value appearing in NullFields will be sent to the server as
  20931. // null. It is an error if a field in this list has a non-empty value.
  20932. // This may be used to include null fields in Patch requests.
  20933. NullFields []string `json:"-"`
  20934. }
  20935. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  20936. type NoMethod SubnetworksScopedListWarningData
  20937. raw := NoMethod(*s)
  20938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20939. }
  20940. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  20941. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  20942. // ForceSendFields is a list of field names (e.g.
  20943. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  20944. // By default, fields with empty values are omitted from API requests.
  20945. // However, any non-pointer, non-interface field appearing in
  20946. // ForceSendFields will be sent to the server regardless of whether the
  20947. // field is empty or not. This may be used to include empty fields in
  20948. // Patch requests.
  20949. ForceSendFields []string `json:"-"`
  20950. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  20951. // include in API requests with the JSON null value. By default, fields
  20952. // with empty values are omitted from API requests. However, any field
  20953. // with an empty value appearing in NullFields will be sent to the
  20954. // server as null. It is an error if a field in this list has a
  20955. // non-empty value. This may be used to include null fields in Patch
  20956. // requests.
  20957. NullFields []string `json:"-"`
  20958. }
  20959. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  20960. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  20961. raw := NoMethod(*s)
  20962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20963. }
  20964. type TCPHealthCheck struct {
  20965. // Port: The TCP port number for the health check request. The default
  20966. // value is 80. Valid values are 1 through 65535.
  20967. Port int64 `json:"port,omitempty"`
  20968. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  20969. // both port and port_name are defined, port takes precedence.
  20970. PortName string `json:"portName,omitempty"`
  20971. // ProxyHeader: Specifies the type of proxy header to append before
  20972. // sending data to the backend, either NONE or PROXY_V1. The default is
  20973. // NONE.
  20974. //
  20975. // Possible values:
  20976. // "NONE"
  20977. // "PROXY_V1"
  20978. ProxyHeader string `json:"proxyHeader,omitempty"`
  20979. // Request: The application data to send once the TCP connection has
  20980. // been established (default value is empty). If both request and
  20981. // response are empty, the connection establishment alone will indicate
  20982. // health. The request data can only be ASCII.
  20983. Request string `json:"request,omitempty"`
  20984. // Response: The bytes to match against the beginning of the response
  20985. // data. If left empty (the default value), any response will indicate
  20986. // health. The response data can only be ASCII.
  20987. Response string `json:"response,omitempty"`
  20988. // ForceSendFields is a list of field names (e.g. "Port") to
  20989. // unconditionally include in API requests. By default, fields with
  20990. // empty values are omitted from API requests. However, any non-pointer,
  20991. // non-interface field appearing in ForceSendFields will be sent to the
  20992. // server regardless of whether the field is empty or not. This may be
  20993. // used to include empty fields in Patch requests.
  20994. ForceSendFields []string `json:"-"`
  20995. // NullFields is a list of field names (e.g. "Port") to include in API
  20996. // requests with the JSON null value. By default, fields with empty
  20997. // values are omitted from API requests. However, any field with an
  20998. // empty value appearing in NullFields will be sent to the server as
  20999. // null. It is an error if a field in this list has a non-empty value.
  21000. // This may be used to include null fields in Patch requests.
  21001. NullFields []string `json:"-"`
  21002. }
  21003. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  21004. type NoMethod TCPHealthCheck
  21005. raw := NoMethod(*s)
  21006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21007. }
  21008. // Tags: A set of instance tags.
  21009. type Tags struct {
  21010. // Fingerprint: Specifies a fingerprint for this request, which is
  21011. // essentially a hash of the tags' contents and used for optimistic
  21012. // locking. The fingerprint is initially generated by Compute Engine and
  21013. // changes after every request to modify or update tags. You must always
  21014. // provide an up-to-date fingerprint hash in order to update or change
  21015. // tags.
  21016. //
  21017. // To see the latest fingerprint, make get() request to the instance.
  21018. Fingerprint string `json:"fingerprint,omitempty"`
  21019. // Items: An array of tags. Each tag must be 1-63 characters long, and
  21020. // comply with RFC1035.
  21021. Items []string `json:"items,omitempty"`
  21022. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  21023. // unconditionally include in API requests. By default, fields with
  21024. // empty values are omitted from API requests. However, any non-pointer,
  21025. // non-interface field appearing in ForceSendFields will be sent to the
  21026. // server regardless of whether the field is empty or not. This may be
  21027. // used to include empty fields in Patch requests.
  21028. ForceSendFields []string `json:"-"`
  21029. // NullFields is a list of field names (e.g. "Fingerprint") to include
  21030. // in API requests with the JSON null value. By default, fields with
  21031. // empty values are omitted from API requests. However, any field with
  21032. // an empty value appearing in NullFields will be sent to the server as
  21033. // null. It is an error if a field in this list has a non-empty value.
  21034. // This may be used to include null fields in Patch requests.
  21035. NullFields []string `json:"-"`
  21036. }
  21037. func (s *Tags) MarshalJSON() ([]byte, error) {
  21038. type NoMethod Tags
  21039. raw := NoMethod(*s)
  21040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21041. }
  21042. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  21043. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  21044. // resource_for v1.targetHttpProxies ==)
  21045. type TargetHttpProxy struct {
  21046. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21047. // format.
  21048. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21049. // Description: An optional description of this resource. Provide this
  21050. // property when you create the resource.
  21051. Description string `json:"description,omitempty"`
  21052. // Id: [Output Only] The unique identifier for the resource. This
  21053. // identifier is defined by the server.
  21054. Id uint64 `json:"id,omitempty,string"`
  21055. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  21056. // for target HTTP proxies.
  21057. Kind string `json:"kind,omitempty"`
  21058. // Name: Name of the resource. Provided by the client when the resource
  21059. // is created. The name must be 1-63 characters long, and comply with
  21060. // RFC1035. Specifically, the name must be 1-63 characters long and
  21061. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21062. // the first character must be a lowercase letter, and all following
  21063. // characters must be a dash, lowercase letter, or digit, except the
  21064. // last character, which cannot be a dash.
  21065. Name string `json:"name,omitempty"`
  21066. // SelfLink: [Output Only] Server-defined URL for the resource.
  21067. SelfLink string `json:"selfLink,omitempty"`
  21068. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  21069. // to the BackendService.
  21070. UrlMap string `json:"urlMap,omitempty"`
  21071. // ServerResponse contains the HTTP response code and headers from the
  21072. // server.
  21073. googleapi.ServerResponse `json:"-"`
  21074. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21075. // to unconditionally include in API requests. By default, fields with
  21076. // empty values are omitted from API requests. However, any non-pointer,
  21077. // non-interface field appearing in ForceSendFields will be sent to the
  21078. // server regardless of whether the field is empty or not. This may be
  21079. // used to include empty fields in Patch requests.
  21080. ForceSendFields []string `json:"-"`
  21081. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21082. // include in API requests with the JSON null value. By default, fields
  21083. // with empty values are omitted from API requests. However, any field
  21084. // with an empty value appearing in NullFields will be sent to the
  21085. // server as null. It is an error if a field in this list has a
  21086. // non-empty value. This may be used to include null fields in Patch
  21087. // requests.
  21088. NullFields []string `json:"-"`
  21089. }
  21090. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  21091. type NoMethod TargetHttpProxy
  21092. raw := NoMethod(*s)
  21093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21094. }
  21095. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  21096. type TargetHttpProxyList struct {
  21097. // Id: [Output Only] Unique identifier for the resource; defined by the
  21098. // server.
  21099. Id string `json:"id,omitempty"`
  21100. // Items: A list of TargetHttpProxy resources.
  21101. Items []*TargetHttpProxy `json:"items,omitempty"`
  21102. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  21103. // of target HTTP proxies.
  21104. Kind string `json:"kind,omitempty"`
  21105. // NextPageToken: [Output Only] This token allows you to get the next
  21106. // page of results for list requests. If the number of results is larger
  21107. // than maxResults, use the nextPageToken as a value for the query
  21108. // parameter pageToken in the next list request. Subsequent list
  21109. // requests will have their own nextPageToken to continue paging through
  21110. // the results.
  21111. NextPageToken string `json:"nextPageToken,omitempty"`
  21112. // SelfLink: [Output Only] Server-defined URL for this resource.
  21113. SelfLink string `json:"selfLink,omitempty"`
  21114. // Warning: [Output Only] Informational warning message.
  21115. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  21116. // ServerResponse contains the HTTP response code and headers from the
  21117. // server.
  21118. googleapi.ServerResponse `json:"-"`
  21119. // ForceSendFields is a list of field names (e.g. "Id") to
  21120. // unconditionally include in API requests. By default, fields with
  21121. // empty values are omitted from API requests. However, any non-pointer,
  21122. // non-interface field appearing in ForceSendFields will be sent to the
  21123. // server regardless of whether the field is empty or not. This may be
  21124. // used to include empty fields in Patch requests.
  21125. ForceSendFields []string `json:"-"`
  21126. // NullFields is a list of field names (e.g. "Id") to include in API
  21127. // requests with the JSON null value. By default, fields with empty
  21128. // values are omitted from API requests. However, any field with an
  21129. // empty value appearing in NullFields will be sent to the server as
  21130. // null. It is an error if a field in this list has a non-empty value.
  21131. // This may be used to include null fields in Patch requests.
  21132. NullFields []string `json:"-"`
  21133. }
  21134. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  21135. type NoMethod TargetHttpProxyList
  21136. raw := NoMethod(*s)
  21137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21138. }
  21139. // TargetHttpProxyListWarning: [Output Only] Informational warning
  21140. // message.
  21141. type TargetHttpProxyListWarning struct {
  21142. // Code: [Output Only] A warning code, if applicable. For example,
  21143. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21144. // the response.
  21145. //
  21146. // Possible values:
  21147. // "CLEANUP_FAILED"
  21148. // "DEPRECATED_RESOURCE_USED"
  21149. // "DEPRECATED_TYPE_USED"
  21150. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21151. // "EXPERIMENTAL_TYPE_USED"
  21152. // "EXTERNAL_API_WARNING"
  21153. // "FIELD_VALUE_OVERRIDEN"
  21154. // "INJECTED_KERNELS_DEPRECATED"
  21155. // "MISSING_TYPE_DEPENDENCY"
  21156. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21157. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21158. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21159. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21160. // "NEXT_HOP_NOT_RUNNING"
  21161. // "NOT_CRITICAL_ERROR"
  21162. // "NO_RESULTS_ON_PAGE"
  21163. // "REQUIRED_TOS_AGREEMENT"
  21164. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21165. // "RESOURCE_NOT_DELETED"
  21166. // "SCHEMA_VALIDATION_IGNORED"
  21167. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21168. // "UNDECLARED_PROPERTIES"
  21169. // "UNREACHABLE"
  21170. Code string `json:"code,omitempty"`
  21171. // Data: [Output Only] Metadata about this warning in key: value format.
  21172. // For example:
  21173. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21174. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  21175. // Message: [Output Only] A human-readable description of the warning
  21176. // code.
  21177. Message string `json:"message,omitempty"`
  21178. // ForceSendFields is a list of field names (e.g. "Code") to
  21179. // unconditionally include in API requests. By default, fields with
  21180. // empty values are omitted from API requests. However, any non-pointer,
  21181. // non-interface field appearing in ForceSendFields will be sent to the
  21182. // server regardless of whether the field is empty or not. This may be
  21183. // used to include empty fields in Patch requests.
  21184. ForceSendFields []string `json:"-"`
  21185. // NullFields is a list of field names (e.g. "Code") to include in API
  21186. // requests with the JSON null value. By default, fields with empty
  21187. // values are omitted from API requests. However, any field with an
  21188. // empty value appearing in NullFields will be sent to the server as
  21189. // null. It is an error if a field in this list has a non-empty value.
  21190. // This may be used to include null fields in Patch requests.
  21191. NullFields []string `json:"-"`
  21192. }
  21193. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  21194. type NoMethod TargetHttpProxyListWarning
  21195. raw := NoMethod(*s)
  21196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21197. }
  21198. type TargetHttpProxyListWarningData struct {
  21199. // Key: [Output Only] A key that provides more detail on the warning
  21200. // being returned. For example, for warnings where there are no results
  21201. // in a list request for a particular zone, this key might be scope and
  21202. // the key value might be the zone name. Other examples might be a key
  21203. // indicating a deprecated resource and a suggested replacement, or a
  21204. // warning about invalid network settings (for example, if an instance
  21205. // attempts to perform IP forwarding but is not enabled for IP
  21206. // forwarding).
  21207. Key string `json:"key,omitempty"`
  21208. // Value: [Output Only] A warning data value corresponding to the key.
  21209. Value string `json:"value,omitempty"`
  21210. // ForceSendFields is a list of field names (e.g. "Key") to
  21211. // unconditionally include in API requests. By default, fields with
  21212. // empty values are omitted from API requests. However, any non-pointer,
  21213. // non-interface field appearing in ForceSendFields will be sent to the
  21214. // server regardless of whether the field is empty or not. This may be
  21215. // used to include empty fields in Patch requests.
  21216. ForceSendFields []string `json:"-"`
  21217. // NullFields is a list of field names (e.g. "Key") to include in API
  21218. // requests with the JSON null value. By default, fields with empty
  21219. // values are omitted from API requests. However, any field with an
  21220. // empty value appearing in NullFields will be sent to the server as
  21221. // null. It is an error if a field in this list has a non-empty value.
  21222. // This may be used to include null fields in Patch requests.
  21223. NullFields []string `json:"-"`
  21224. }
  21225. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  21226. type NoMethod TargetHttpProxyListWarningData
  21227. raw := NoMethod(*s)
  21228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21229. }
  21230. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  21231. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  21232. //
  21233. // Possible values:
  21234. // "DISABLE"
  21235. // "ENABLE"
  21236. // "NONE"
  21237. QuicOverride string `json:"quicOverride,omitempty"`
  21238. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  21239. // unconditionally include in API requests. By default, fields with
  21240. // empty values are omitted from API requests. However, any non-pointer,
  21241. // non-interface field appearing in ForceSendFields will be sent to the
  21242. // server regardless of whether the field is empty or not. This may be
  21243. // used to include empty fields in Patch requests.
  21244. ForceSendFields []string `json:"-"`
  21245. // NullFields is a list of field names (e.g. "QuicOverride") to include
  21246. // in API requests with the JSON null value. By default, fields with
  21247. // empty values are omitted from API requests. However, any field with
  21248. // an empty value appearing in NullFields will be sent to the server as
  21249. // null. It is an error if a field in this list has a non-empty value.
  21250. // This may be used to include null fields in Patch requests.
  21251. NullFields []string `json:"-"`
  21252. }
  21253. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  21254. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  21255. raw := NoMethod(*s)
  21256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21257. }
  21258. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  21259. // SslCertificates: New set of SslCertificate resources to associate
  21260. // with this TargetHttpsProxy resource. Currently exactly one
  21261. // SslCertificate resource must be specified.
  21262. SslCertificates []string `json:"sslCertificates,omitempty"`
  21263. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  21264. // unconditionally include in API requests. By default, fields with
  21265. // empty values are omitted from API requests. However, any non-pointer,
  21266. // non-interface field appearing in ForceSendFields will be sent to the
  21267. // server regardless of whether the field is empty or not. This may be
  21268. // used to include empty fields in Patch requests.
  21269. ForceSendFields []string `json:"-"`
  21270. // NullFields is a list of field names (e.g. "SslCertificates") to
  21271. // include in API requests with the JSON null value. By default, fields
  21272. // with empty values are omitted from API requests. However, any field
  21273. // with an empty value appearing in NullFields will be sent to the
  21274. // server as null. It is an error if a field in this list has a
  21275. // non-empty value. This may be used to include null fields in Patch
  21276. // requests.
  21277. NullFields []string `json:"-"`
  21278. }
  21279. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  21280. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  21281. raw := NoMethod(*s)
  21282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21283. }
  21284. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  21285. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  21286. // resource_for v1.targetHttpsProxies ==)
  21287. type TargetHttpsProxy struct {
  21288. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21289. // format.
  21290. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21291. // Description: An optional description of this resource. Provide this
  21292. // property when you create the resource.
  21293. Description string `json:"description,omitempty"`
  21294. // Id: [Output Only] The unique identifier for the resource. This
  21295. // identifier is defined by the server.
  21296. Id uint64 `json:"id,omitempty,string"`
  21297. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  21298. // for target HTTPS proxies.
  21299. Kind string `json:"kind,omitempty"`
  21300. // Name: Name of the resource. Provided by the client when the resource
  21301. // is created. The name must be 1-63 characters long, and comply with
  21302. // RFC1035. Specifically, the name must be 1-63 characters long and
  21303. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21304. // the first character must be a lowercase letter, and all following
  21305. // characters must be a dash, lowercase letter, or digit, except the
  21306. // last character, which cannot be a dash.
  21307. Name string `json:"name,omitempty"`
  21308. // QuicOverride: Specifies the QUIC override policy for this
  21309. // TargetHttpsProxy resource. This determines whether the load balancer
  21310. // will attempt to negotiate QUIC with clients or not. Can specify one
  21311. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  21312. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  21313. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  21314. // overrides, which is equivalent to DISABLE. Not specifying this field
  21315. // is equivalent to specifying NONE.
  21316. //
  21317. // Possible values:
  21318. // "DISABLE"
  21319. // "ENABLE"
  21320. // "NONE"
  21321. QuicOverride string `json:"quicOverride,omitempty"`
  21322. // SelfLink: [Output Only] Server-defined URL for the resource.
  21323. SelfLink string `json:"selfLink,omitempty"`
  21324. // SslCertificates: URLs to SslCertificate resources that are used to
  21325. // authenticate connections between users and the load balancer. At
  21326. // least one SSL certificate must be specified. Currently, you may
  21327. // specify up to 15 SSL certificates.
  21328. SslCertificates []string `json:"sslCertificates,omitempty"`
  21329. // SslPolicy: URL of SslPolicy resource that will be associated with the
  21330. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  21331. // will not have any SSL policy configured.
  21332. SslPolicy string `json:"sslPolicy,omitempty"`
  21333. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  21334. // that defines the mapping from URL to the BackendService. For example,
  21335. // the following are all valid URLs for specifying a URL map:
  21336. // -
  21337. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  21338. // - projects/project/global/urlMaps/url-map
  21339. // - global/urlMaps/url-map
  21340. UrlMap string `json:"urlMap,omitempty"`
  21341. // ServerResponse contains the HTTP response code and headers from the
  21342. // server.
  21343. googleapi.ServerResponse `json:"-"`
  21344. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21345. // to unconditionally include in API requests. By default, fields with
  21346. // empty values are omitted from API requests. However, any non-pointer,
  21347. // non-interface field appearing in ForceSendFields will be sent to the
  21348. // server regardless of whether the field is empty or not. This may be
  21349. // used to include empty fields in Patch requests.
  21350. ForceSendFields []string `json:"-"`
  21351. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21352. // include in API requests with the JSON null value. By default, fields
  21353. // with empty values are omitted from API requests. However, any field
  21354. // with an empty value appearing in NullFields will be sent to the
  21355. // server as null. It is an error if a field in this list has a
  21356. // non-empty value. This may be used to include null fields in Patch
  21357. // requests.
  21358. NullFields []string `json:"-"`
  21359. }
  21360. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  21361. type NoMethod TargetHttpsProxy
  21362. raw := NoMethod(*s)
  21363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21364. }
  21365. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  21366. type TargetHttpsProxyList struct {
  21367. // Id: [Output Only] Unique identifier for the resource; defined by the
  21368. // server.
  21369. Id string `json:"id,omitempty"`
  21370. // Items: A list of TargetHttpsProxy resources.
  21371. Items []*TargetHttpsProxy `json:"items,omitempty"`
  21372. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  21373. // of target HTTPS proxies.
  21374. Kind string `json:"kind,omitempty"`
  21375. // NextPageToken: [Output Only] This token allows you to get the next
  21376. // page of results for list requests. If the number of results is larger
  21377. // than maxResults, use the nextPageToken as a value for the query
  21378. // parameter pageToken in the next list request. Subsequent list
  21379. // requests will have their own nextPageToken to continue paging through
  21380. // the results.
  21381. NextPageToken string `json:"nextPageToken,omitempty"`
  21382. // SelfLink: [Output Only] Server-defined URL for this resource.
  21383. SelfLink string `json:"selfLink,omitempty"`
  21384. // Warning: [Output Only] Informational warning message.
  21385. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  21386. // ServerResponse contains the HTTP response code and headers from the
  21387. // server.
  21388. googleapi.ServerResponse `json:"-"`
  21389. // ForceSendFields is a list of field names (e.g. "Id") to
  21390. // unconditionally include in API requests. By default, fields with
  21391. // empty values are omitted from API requests. However, any non-pointer,
  21392. // non-interface field appearing in ForceSendFields will be sent to the
  21393. // server regardless of whether the field is empty or not. This may be
  21394. // used to include empty fields in Patch requests.
  21395. ForceSendFields []string `json:"-"`
  21396. // NullFields is a list of field names (e.g. "Id") to include in API
  21397. // requests with the JSON null value. By default, fields with empty
  21398. // values are omitted from API requests. However, any field with an
  21399. // empty value appearing in NullFields will be sent to the server as
  21400. // null. It is an error if a field in this list has a non-empty value.
  21401. // This may be used to include null fields in Patch requests.
  21402. NullFields []string `json:"-"`
  21403. }
  21404. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  21405. type NoMethod TargetHttpsProxyList
  21406. raw := NoMethod(*s)
  21407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21408. }
  21409. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  21410. // message.
  21411. type TargetHttpsProxyListWarning struct {
  21412. // Code: [Output Only] A warning code, if applicable. For example,
  21413. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21414. // the response.
  21415. //
  21416. // Possible values:
  21417. // "CLEANUP_FAILED"
  21418. // "DEPRECATED_RESOURCE_USED"
  21419. // "DEPRECATED_TYPE_USED"
  21420. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21421. // "EXPERIMENTAL_TYPE_USED"
  21422. // "EXTERNAL_API_WARNING"
  21423. // "FIELD_VALUE_OVERRIDEN"
  21424. // "INJECTED_KERNELS_DEPRECATED"
  21425. // "MISSING_TYPE_DEPENDENCY"
  21426. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21427. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21428. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21429. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21430. // "NEXT_HOP_NOT_RUNNING"
  21431. // "NOT_CRITICAL_ERROR"
  21432. // "NO_RESULTS_ON_PAGE"
  21433. // "REQUIRED_TOS_AGREEMENT"
  21434. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21435. // "RESOURCE_NOT_DELETED"
  21436. // "SCHEMA_VALIDATION_IGNORED"
  21437. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21438. // "UNDECLARED_PROPERTIES"
  21439. // "UNREACHABLE"
  21440. Code string `json:"code,omitempty"`
  21441. // Data: [Output Only] Metadata about this warning in key: value format.
  21442. // For example:
  21443. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21444. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  21445. // Message: [Output Only] A human-readable description of the warning
  21446. // code.
  21447. Message string `json:"message,omitempty"`
  21448. // ForceSendFields is a list of field names (e.g. "Code") to
  21449. // unconditionally include in API requests. By default, fields with
  21450. // empty values are omitted from API requests. However, any non-pointer,
  21451. // non-interface field appearing in ForceSendFields will be sent to the
  21452. // server regardless of whether the field is empty or not. This may be
  21453. // used to include empty fields in Patch requests.
  21454. ForceSendFields []string `json:"-"`
  21455. // NullFields is a list of field names (e.g. "Code") to include in API
  21456. // requests with the JSON null value. By default, fields with empty
  21457. // values are omitted from API requests. However, any field with an
  21458. // empty value appearing in NullFields will be sent to the server as
  21459. // null. It is an error if a field in this list has a non-empty value.
  21460. // This may be used to include null fields in Patch requests.
  21461. NullFields []string `json:"-"`
  21462. }
  21463. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  21464. type NoMethod TargetHttpsProxyListWarning
  21465. raw := NoMethod(*s)
  21466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21467. }
  21468. type TargetHttpsProxyListWarningData struct {
  21469. // Key: [Output Only] A key that provides more detail on the warning
  21470. // being returned. For example, for warnings where there are no results
  21471. // in a list request for a particular zone, this key might be scope and
  21472. // the key value might be the zone name. Other examples might be a key
  21473. // indicating a deprecated resource and a suggested replacement, or a
  21474. // warning about invalid network settings (for example, if an instance
  21475. // attempts to perform IP forwarding but is not enabled for IP
  21476. // forwarding).
  21477. Key string `json:"key,omitempty"`
  21478. // Value: [Output Only] A warning data value corresponding to the key.
  21479. Value string `json:"value,omitempty"`
  21480. // ForceSendFields is a list of field names (e.g. "Key") to
  21481. // unconditionally include in API requests. By default, fields with
  21482. // empty values are omitted from API requests. However, any non-pointer,
  21483. // non-interface field appearing in ForceSendFields will be sent to the
  21484. // server regardless of whether the field is empty or not. This may be
  21485. // used to include empty fields in Patch requests.
  21486. ForceSendFields []string `json:"-"`
  21487. // NullFields is a list of field names (e.g. "Key") to include in API
  21488. // requests with the JSON null value. By default, fields with empty
  21489. // values are omitted from API requests. However, any field with an
  21490. // empty value appearing in NullFields will be sent to the server as
  21491. // null. It is an error if a field in this list has a non-empty value.
  21492. // This may be used to include null fields in Patch requests.
  21493. NullFields []string `json:"-"`
  21494. }
  21495. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  21496. type NoMethod TargetHttpsProxyListWarningData
  21497. raw := NoMethod(*s)
  21498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21499. }
  21500. // TargetInstance: A TargetInstance resource. This resource defines an
  21501. // endpoint instance that terminates traffic of certain protocols. (==
  21502. // resource_for beta.targetInstances ==) (== resource_for
  21503. // v1.targetInstances ==)
  21504. type TargetInstance struct {
  21505. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21506. // format.
  21507. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21508. // Description: An optional description of this resource. Provide this
  21509. // property when you create the resource.
  21510. Description string `json:"description,omitempty"`
  21511. // Id: [Output Only] The unique identifier for the resource. This
  21512. // identifier is defined by the server.
  21513. Id uint64 `json:"id,omitempty,string"`
  21514. // Instance: A URL to the virtual machine instance that handles traffic
  21515. // for this target instance. When creating a target instance, you can
  21516. // provide the fully-qualified URL or a valid partial URL to the desired
  21517. // virtual machine. For example, the following are all valid URLs:
  21518. // -
  21519. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  21520. // - projects/project/zones/zone/instances/instance
  21521. // - zones/zone/instances/instance
  21522. Instance string `json:"instance,omitempty"`
  21523. // Kind: [Output Only] The type of the resource. Always
  21524. // compute#targetInstance for target instances.
  21525. Kind string `json:"kind,omitempty"`
  21526. // Name: Name of the resource. Provided by the client when the resource
  21527. // is created. The name must be 1-63 characters long, and comply with
  21528. // RFC1035. Specifically, the name must be 1-63 characters long and
  21529. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21530. // the first character must be a lowercase letter, and all following
  21531. // characters must be a dash, lowercase letter, or digit, except the
  21532. // last character, which cannot be a dash.
  21533. Name string `json:"name,omitempty"`
  21534. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  21535. // Currently only NO_NAT (default value) is supported.
  21536. //
  21537. // Possible values:
  21538. // "NO_NAT"
  21539. NatPolicy string `json:"natPolicy,omitempty"`
  21540. // SelfLink: [Output Only] Server-defined URL for the resource.
  21541. SelfLink string `json:"selfLink,omitempty"`
  21542. // Zone: [Output Only] URL of the zone where the target instance
  21543. // resides. You must specify this field as part of the HTTP request URL.
  21544. // It is not settable as a field in the request body.
  21545. Zone string `json:"zone,omitempty"`
  21546. // ServerResponse contains the HTTP response code and headers from the
  21547. // server.
  21548. googleapi.ServerResponse `json:"-"`
  21549. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21550. // to unconditionally include in API requests. By default, fields with
  21551. // empty values are omitted from API requests. However, any non-pointer,
  21552. // non-interface field appearing in ForceSendFields will be sent to the
  21553. // server regardless of whether the field is empty or not. This may be
  21554. // used to include empty fields in Patch requests.
  21555. ForceSendFields []string `json:"-"`
  21556. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21557. // include in API requests with the JSON null value. By default, fields
  21558. // with empty values are omitted from API requests. However, any field
  21559. // with an empty value appearing in NullFields will be sent to the
  21560. // server as null. It is an error if a field in this list has a
  21561. // non-empty value. This may be used to include null fields in Patch
  21562. // requests.
  21563. NullFields []string `json:"-"`
  21564. }
  21565. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  21566. type NoMethod TargetInstance
  21567. raw := NoMethod(*s)
  21568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21569. }
  21570. type TargetInstanceAggregatedList struct {
  21571. // Id: [Output Only] Unique identifier for the resource; defined by the
  21572. // server.
  21573. Id string `json:"id,omitempty"`
  21574. // Items: A list of TargetInstance resources.
  21575. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  21576. // Kind: Type of resource.
  21577. Kind string `json:"kind,omitempty"`
  21578. // NextPageToken: [Output Only] This token allows you to get the next
  21579. // page of results for list requests. If the number of results is larger
  21580. // than maxResults, use the nextPageToken as a value for the query
  21581. // parameter pageToken in the next list request. Subsequent list
  21582. // requests will have their own nextPageToken to continue paging through
  21583. // the results.
  21584. NextPageToken string `json:"nextPageToken,omitempty"`
  21585. // SelfLink: [Output Only] Server-defined URL for this resource.
  21586. SelfLink string `json:"selfLink,omitempty"`
  21587. // Warning: [Output Only] Informational warning message.
  21588. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  21589. // ServerResponse contains the HTTP response code and headers from the
  21590. // server.
  21591. googleapi.ServerResponse `json:"-"`
  21592. // ForceSendFields is a list of field names (e.g. "Id") to
  21593. // unconditionally include in API requests. By default, fields with
  21594. // empty values are omitted from API requests. However, any non-pointer,
  21595. // non-interface field appearing in ForceSendFields will be sent to the
  21596. // server regardless of whether the field is empty or not. This may be
  21597. // used to include empty fields in Patch requests.
  21598. ForceSendFields []string `json:"-"`
  21599. // NullFields is a list of field names (e.g. "Id") to include in API
  21600. // requests with the JSON null value. By default, fields with empty
  21601. // values are omitted from API requests. However, any field with an
  21602. // empty value appearing in NullFields will be sent to the server as
  21603. // null. It is an error if a field in this list has a non-empty value.
  21604. // This may be used to include null fields in Patch requests.
  21605. NullFields []string `json:"-"`
  21606. }
  21607. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  21608. type NoMethod TargetInstanceAggregatedList
  21609. raw := NoMethod(*s)
  21610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21611. }
  21612. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  21613. // warning message.
  21614. type TargetInstanceAggregatedListWarning struct {
  21615. // Code: [Output Only] A warning code, if applicable. For example,
  21616. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21617. // the response.
  21618. //
  21619. // Possible values:
  21620. // "CLEANUP_FAILED"
  21621. // "DEPRECATED_RESOURCE_USED"
  21622. // "DEPRECATED_TYPE_USED"
  21623. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21624. // "EXPERIMENTAL_TYPE_USED"
  21625. // "EXTERNAL_API_WARNING"
  21626. // "FIELD_VALUE_OVERRIDEN"
  21627. // "INJECTED_KERNELS_DEPRECATED"
  21628. // "MISSING_TYPE_DEPENDENCY"
  21629. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21630. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21631. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21632. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21633. // "NEXT_HOP_NOT_RUNNING"
  21634. // "NOT_CRITICAL_ERROR"
  21635. // "NO_RESULTS_ON_PAGE"
  21636. // "REQUIRED_TOS_AGREEMENT"
  21637. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21638. // "RESOURCE_NOT_DELETED"
  21639. // "SCHEMA_VALIDATION_IGNORED"
  21640. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21641. // "UNDECLARED_PROPERTIES"
  21642. // "UNREACHABLE"
  21643. Code string `json:"code,omitempty"`
  21644. // Data: [Output Only] Metadata about this warning in key: value format.
  21645. // For example:
  21646. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21647. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  21648. // Message: [Output Only] A human-readable description of the warning
  21649. // code.
  21650. Message string `json:"message,omitempty"`
  21651. // ForceSendFields is a list of field names (e.g. "Code") to
  21652. // unconditionally include in API requests. By default, fields with
  21653. // empty values are omitted from API requests. However, any non-pointer,
  21654. // non-interface field appearing in ForceSendFields will be sent to the
  21655. // server regardless of whether the field is empty or not. This may be
  21656. // used to include empty fields in Patch requests.
  21657. ForceSendFields []string `json:"-"`
  21658. // NullFields is a list of field names (e.g. "Code") to include in API
  21659. // requests with the JSON null value. By default, fields with empty
  21660. // values are omitted from API requests. However, any field with an
  21661. // empty value appearing in NullFields will be sent to the server as
  21662. // null. It is an error if a field in this list has a non-empty value.
  21663. // This may be used to include null fields in Patch requests.
  21664. NullFields []string `json:"-"`
  21665. }
  21666. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21667. type NoMethod TargetInstanceAggregatedListWarning
  21668. raw := NoMethod(*s)
  21669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21670. }
  21671. type TargetInstanceAggregatedListWarningData struct {
  21672. // Key: [Output Only] A key that provides more detail on the warning
  21673. // being returned. For example, for warnings where there are no results
  21674. // in a list request for a particular zone, this key might be scope and
  21675. // the key value might be the zone name. Other examples might be a key
  21676. // indicating a deprecated resource and a suggested replacement, or a
  21677. // warning about invalid network settings (for example, if an instance
  21678. // attempts to perform IP forwarding but is not enabled for IP
  21679. // forwarding).
  21680. Key string `json:"key,omitempty"`
  21681. // Value: [Output Only] A warning data value corresponding to the key.
  21682. Value string `json:"value,omitempty"`
  21683. // ForceSendFields is a list of field names (e.g. "Key") to
  21684. // unconditionally include in API requests. By default, fields with
  21685. // empty values are omitted from API requests. However, any non-pointer,
  21686. // non-interface field appearing in ForceSendFields will be sent to the
  21687. // server regardless of whether the field is empty or not. This may be
  21688. // used to include empty fields in Patch requests.
  21689. ForceSendFields []string `json:"-"`
  21690. // NullFields is a list of field names (e.g. "Key") to include in API
  21691. // requests with the JSON null value. By default, fields with empty
  21692. // values are omitted from API requests. However, any field with an
  21693. // empty value appearing in NullFields will be sent to the server as
  21694. // null. It is an error if a field in this list has a non-empty value.
  21695. // This may be used to include null fields in Patch requests.
  21696. NullFields []string `json:"-"`
  21697. }
  21698. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21699. type NoMethod TargetInstanceAggregatedListWarningData
  21700. raw := NoMethod(*s)
  21701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21702. }
  21703. // TargetInstanceList: Contains a list of TargetInstance resources.
  21704. type TargetInstanceList struct {
  21705. // Id: [Output Only] Unique identifier for the resource; defined by the
  21706. // server.
  21707. Id string `json:"id,omitempty"`
  21708. // Items: A list of TargetInstance resources.
  21709. Items []*TargetInstance `json:"items,omitempty"`
  21710. // Kind: Type of resource.
  21711. Kind string `json:"kind,omitempty"`
  21712. // NextPageToken: [Output Only] This token allows you to get the next
  21713. // page of results for list requests. If the number of results is larger
  21714. // than maxResults, use the nextPageToken as a value for the query
  21715. // parameter pageToken in the next list request. Subsequent list
  21716. // requests will have their own nextPageToken to continue paging through
  21717. // the results.
  21718. NextPageToken string `json:"nextPageToken,omitempty"`
  21719. // SelfLink: [Output Only] Server-defined URL for this resource.
  21720. SelfLink string `json:"selfLink,omitempty"`
  21721. // Warning: [Output Only] Informational warning message.
  21722. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  21723. // ServerResponse contains the HTTP response code and headers from the
  21724. // server.
  21725. googleapi.ServerResponse `json:"-"`
  21726. // ForceSendFields is a list of field names (e.g. "Id") to
  21727. // unconditionally include in API requests. By default, fields with
  21728. // empty values are omitted from API requests. However, any non-pointer,
  21729. // non-interface field appearing in ForceSendFields will be sent to the
  21730. // server regardless of whether the field is empty or not. This may be
  21731. // used to include empty fields in Patch requests.
  21732. ForceSendFields []string `json:"-"`
  21733. // NullFields is a list of field names (e.g. "Id") to include in API
  21734. // requests with the JSON null value. By default, fields with empty
  21735. // values are omitted from API requests. However, any field with an
  21736. // empty value appearing in NullFields will be sent to the server as
  21737. // null. It is an error if a field in this list has a non-empty value.
  21738. // This may be used to include null fields in Patch requests.
  21739. NullFields []string `json:"-"`
  21740. }
  21741. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  21742. type NoMethod TargetInstanceList
  21743. raw := NoMethod(*s)
  21744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21745. }
  21746. // TargetInstanceListWarning: [Output Only] Informational warning
  21747. // message.
  21748. type TargetInstanceListWarning struct {
  21749. // Code: [Output Only] A warning code, if applicable. For example,
  21750. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21751. // the response.
  21752. //
  21753. // Possible values:
  21754. // "CLEANUP_FAILED"
  21755. // "DEPRECATED_RESOURCE_USED"
  21756. // "DEPRECATED_TYPE_USED"
  21757. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21758. // "EXPERIMENTAL_TYPE_USED"
  21759. // "EXTERNAL_API_WARNING"
  21760. // "FIELD_VALUE_OVERRIDEN"
  21761. // "INJECTED_KERNELS_DEPRECATED"
  21762. // "MISSING_TYPE_DEPENDENCY"
  21763. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21764. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21765. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21766. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21767. // "NEXT_HOP_NOT_RUNNING"
  21768. // "NOT_CRITICAL_ERROR"
  21769. // "NO_RESULTS_ON_PAGE"
  21770. // "REQUIRED_TOS_AGREEMENT"
  21771. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21772. // "RESOURCE_NOT_DELETED"
  21773. // "SCHEMA_VALIDATION_IGNORED"
  21774. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21775. // "UNDECLARED_PROPERTIES"
  21776. // "UNREACHABLE"
  21777. Code string `json:"code,omitempty"`
  21778. // Data: [Output Only] Metadata about this warning in key: value format.
  21779. // For example:
  21780. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21781. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  21782. // Message: [Output Only] A human-readable description of the warning
  21783. // code.
  21784. Message string `json:"message,omitempty"`
  21785. // ForceSendFields is a list of field names (e.g. "Code") to
  21786. // unconditionally include in API requests. By default, fields with
  21787. // empty values are omitted from API requests. However, any non-pointer,
  21788. // non-interface field appearing in ForceSendFields will be sent to the
  21789. // server regardless of whether the field is empty or not. This may be
  21790. // used to include empty fields in Patch requests.
  21791. ForceSendFields []string `json:"-"`
  21792. // NullFields is a list of field names (e.g. "Code") to include in API
  21793. // requests with the JSON null value. By default, fields with empty
  21794. // values are omitted from API requests. However, any field with an
  21795. // empty value appearing in NullFields will be sent to the server as
  21796. // null. It is an error if a field in this list has a non-empty value.
  21797. // This may be used to include null fields in Patch requests.
  21798. NullFields []string `json:"-"`
  21799. }
  21800. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  21801. type NoMethod TargetInstanceListWarning
  21802. raw := NoMethod(*s)
  21803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21804. }
  21805. type TargetInstanceListWarningData struct {
  21806. // Key: [Output Only] A key that provides more detail on the warning
  21807. // being returned. For example, for warnings where there are no results
  21808. // in a list request for a particular zone, this key might be scope and
  21809. // the key value might be the zone name. Other examples might be a key
  21810. // indicating a deprecated resource and a suggested replacement, or a
  21811. // warning about invalid network settings (for example, if an instance
  21812. // attempts to perform IP forwarding but is not enabled for IP
  21813. // forwarding).
  21814. Key string `json:"key,omitempty"`
  21815. // Value: [Output Only] A warning data value corresponding to the key.
  21816. Value string `json:"value,omitempty"`
  21817. // ForceSendFields is a list of field names (e.g. "Key") to
  21818. // unconditionally include in API requests. By default, fields with
  21819. // empty values are omitted from API requests. However, any non-pointer,
  21820. // non-interface field appearing in ForceSendFields will be sent to the
  21821. // server regardless of whether the field is empty or not. This may be
  21822. // used to include empty fields in Patch requests.
  21823. ForceSendFields []string `json:"-"`
  21824. // NullFields is a list of field names (e.g. "Key") to include in API
  21825. // requests with the JSON null value. By default, fields with empty
  21826. // values are omitted from API requests. However, any field with an
  21827. // empty value appearing in NullFields will be sent to the server as
  21828. // null. It is an error if a field in this list has a non-empty value.
  21829. // This may be used to include null fields in Patch requests.
  21830. NullFields []string `json:"-"`
  21831. }
  21832. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  21833. type NoMethod TargetInstanceListWarningData
  21834. raw := NoMethod(*s)
  21835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21836. }
  21837. type TargetInstancesScopedList struct {
  21838. // TargetInstances: A list of target instances contained in this scope.
  21839. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  21840. // Warning: Informational warning which replaces the list of addresses
  21841. // when the list is empty.
  21842. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  21843. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  21844. // unconditionally include in API requests. By default, fields with
  21845. // empty values are omitted from API requests. However, any non-pointer,
  21846. // non-interface field appearing in ForceSendFields will be sent to the
  21847. // server regardless of whether the field is empty or not. This may be
  21848. // used to include empty fields in Patch requests.
  21849. ForceSendFields []string `json:"-"`
  21850. // NullFields is a list of field names (e.g. "TargetInstances") to
  21851. // include in API requests with the JSON null value. By default, fields
  21852. // with empty values are omitted from API requests. However, any field
  21853. // with an empty value appearing in NullFields will be sent to the
  21854. // server as null. It is an error if a field in this list has a
  21855. // non-empty value. This may be used to include null fields in Patch
  21856. // requests.
  21857. NullFields []string `json:"-"`
  21858. }
  21859. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  21860. type NoMethod TargetInstancesScopedList
  21861. raw := NoMethod(*s)
  21862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21863. }
  21864. // TargetInstancesScopedListWarning: Informational warning which
  21865. // replaces the list of addresses when the list is empty.
  21866. type TargetInstancesScopedListWarning struct {
  21867. // Code: [Output Only] A warning code, if applicable. For example,
  21868. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21869. // the response.
  21870. //
  21871. // Possible values:
  21872. // "CLEANUP_FAILED"
  21873. // "DEPRECATED_RESOURCE_USED"
  21874. // "DEPRECATED_TYPE_USED"
  21875. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21876. // "EXPERIMENTAL_TYPE_USED"
  21877. // "EXTERNAL_API_WARNING"
  21878. // "FIELD_VALUE_OVERRIDEN"
  21879. // "INJECTED_KERNELS_DEPRECATED"
  21880. // "MISSING_TYPE_DEPENDENCY"
  21881. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21882. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21883. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21884. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21885. // "NEXT_HOP_NOT_RUNNING"
  21886. // "NOT_CRITICAL_ERROR"
  21887. // "NO_RESULTS_ON_PAGE"
  21888. // "REQUIRED_TOS_AGREEMENT"
  21889. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21890. // "RESOURCE_NOT_DELETED"
  21891. // "SCHEMA_VALIDATION_IGNORED"
  21892. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21893. // "UNDECLARED_PROPERTIES"
  21894. // "UNREACHABLE"
  21895. Code string `json:"code,omitempty"`
  21896. // Data: [Output Only] Metadata about this warning in key: value format.
  21897. // For example:
  21898. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21899. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  21900. // Message: [Output Only] A human-readable description of the warning
  21901. // code.
  21902. Message string `json:"message,omitempty"`
  21903. // ForceSendFields is a list of field names (e.g. "Code") to
  21904. // unconditionally include in API requests. By default, fields with
  21905. // empty values are omitted from API requests. However, any non-pointer,
  21906. // non-interface field appearing in ForceSendFields will be sent to the
  21907. // server regardless of whether the field is empty or not. This may be
  21908. // used to include empty fields in Patch requests.
  21909. ForceSendFields []string `json:"-"`
  21910. // NullFields is a list of field names (e.g. "Code") to include in API
  21911. // requests with the JSON null value. By default, fields with empty
  21912. // values are omitted from API requests. However, any field with an
  21913. // empty value appearing in NullFields will be sent to the server as
  21914. // null. It is an error if a field in this list has a non-empty value.
  21915. // This may be used to include null fields in Patch requests.
  21916. NullFields []string `json:"-"`
  21917. }
  21918. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  21919. type NoMethod TargetInstancesScopedListWarning
  21920. raw := NoMethod(*s)
  21921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21922. }
  21923. type TargetInstancesScopedListWarningData struct {
  21924. // Key: [Output Only] A key that provides more detail on the warning
  21925. // being returned. For example, for warnings where there are no results
  21926. // in a list request for a particular zone, this key might be scope and
  21927. // the key value might be the zone name. Other examples might be a key
  21928. // indicating a deprecated resource and a suggested replacement, or a
  21929. // warning about invalid network settings (for example, if an instance
  21930. // attempts to perform IP forwarding but is not enabled for IP
  21931. // forwarding).
  21932. Key string `json:"key,omitempty"`
  21933. // Value: [Output Only] A warning data value corresponding to the key.
  21934. Value string `json:"value,omitempty"`
  21935. // ForceSendFields is a list of field names (e.g. "Key") to
  21936. // unconditionally include in API requests. By default, fields with
  21937. // empty values are omitted from API requests. However, any non-pointer,
  21938. // non-interface field appearing in ForceSendFields will be sent to the
  21939. // server regardless of whether the field is empty or not. This may be
  21940. // used to include empty fields in Patch requests.
  21941. ForceSendFields []string `json:"-"`
  21942. // NullFields is a list of field names (e.g. "Key") to include in API
  21943. // requests with the JSON null value. By default, fields with empty
  21944. // values are omitted from API requests. However, any field with an
  21945. // empty value appearing in NullFields will be sent to the server as
  21946. // null. It is an error if a field in this list has a non-empty value.
  21947. // This may be used to include null fields in Patch requests.
  21948. NullFields []string `json:"-"`
  21949. }
  21950. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21951. type NoMethod TargetInstancesScopedListWarningData
  21952. raw := NoMethod(*s)
  21953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21954. }
  21955. // TargetPool: A TargetPool resource. This resource defines a pool of
  21956. // instances, an associated HttpHealthCheck resource, and the fallback
  21957. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  21958. // v1.targetPools ==)
  21959. type TargetPool struct {
  21960. // BackupPool: This field is applicable only when the containing target
  21961. // pool is serving a forwarding rule as the primary pool, and its
  21962. // failoverRatio field is properly set to a value between [0,
  21963. // 1].
  21964. //
  21965. // backupPool and failoverRatio together define the fallback behavior of
  21966. // the primary target pool: if the ratio of the healthy instances in the
  21967. // primary pool is at or below failoverRatio, traffic arriving at the
  21968. // load-balanced IP will be directed to the backup pool.
  21969. //
  21970. // In case where failoverRatio and backupPool are not set, or all the
  21971. // instances in the backup pool are unhealthy, the traffic will be
  21972. // directed back to the primary pool in the "force" mode, where traffic
  21973. // will be spread to the healthy instances with the best effort, or to
  21974. // all instances when no instance is healthy.
  21975. BackupPool string `json:"backupPool,omitempty"`
  21976. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21977. // format.
  21978. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21979. // Description: An optional description of this resource. Provide this
  21980. // property when you create the resource.
  21981. Description string `json:"description,omitempty"`
  21982. // FailoverRatio: This field is applicable only when the containing
  21983. // target pool is serving a forwarding rule as the primary pool (i.e.,
  21984. // not as a backup pool to some other target pool). The value of the
  21985. // field must be in [0, 1].
  21986. //
  21987. // If set, backupPool must also be set. They together define the
  21988. // fallback behavior of the primary target pool: if the ratio of the
  21989. // healthy instances in the primary pool is at or below this number,
  21990. // traffic arriving at the load-balanced IP will be directed to the
  21991. // backup pool.
  21992. //
  21993. // In case where failoverRatio is not set or all the instances in the
  21994. // backup pool are unhealthy, the traffic will be directed back to the
  21995. // primary pool in the "force" mode, where traffic will be spread to the
  21996. // healthy instances with the best effort, or to all instances when no
  21997. // instance is healthy.
  21998. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  21999. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  22000. // instance in this pool is considered healthy if and only if the health
  22001. // checks pass. An empty list means all member instances will be
  22002. // considered healthy at all times. Only HttpHealthChecks are supported.
  22003. // Only one health check may be specified.
  22004. HealthChecks []string `json:"healthChecks,omitempty"`
  22005. // Id: [Output Only] The unique identifier for the resource. This
  22006. // identifier is defined by the server.
  22007. Id uint64 `json:"id,omitempty,string"`
  22008. // Instances: A list of resource URLs to the virtual machine instances
  22009. // serving this pool. They must live in zones contained in the same
  22010. // region as this pool.
  22011. Instances []string `json:"instances,omitempty"`
  22012. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  22013. // for target pools.
  22014. Kind string `json:"kind,omitempty"`
  22015. // Name: Name of the resource. Provided by the client when the resource
  22016. // is created. The name must be 1-63 characters long, and comply with
  22017. // RFC1035. Specifically, the name must be 1-63 characters long and
  22018. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22019. // the first character must be a lowercase letter, and all following
  22020. // characters must be a dash, lowercase letter, or digit, except the
  22021. // last character, which cannot be a dash.
  22022. Name string `json:"name,omitempty"`
  22023. // Region: [Output Only] URL of the region where the target pool
  22024. // resides.
  22025. Region string `json:"region,omitempty"`
  22026. // SelfLink: [Output Only] Server-defined URL for the resource.
  22027. SelfLink string `json:"selfLink,omitempty"`
  22028. // SessionAffinity: Session affinity option, must be one of the
  22029. // following values:
  22030. // NONE: Connections from the same client IP may go to any instance in
  22031. // the pool.
  22032. // CLIENT_IP: Connections from the same client IP will go to the same
  22033. // instance in the pool while that instance remains
  22034. // healthy.
  22035. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  22036. // protocol will go to the same instance in the pool while that instance
  22037. // remains healthy.
  22038. //
  22039. // Possible values:
  22040. // "CLIENT_IP"
  22041. // "CLIENT_IP_PORT_PROTO"
  22042. // "CLIENT_IP_PROTO"
  22043. // "GENERATED_COOKIE"
  22044. // "NONE"
  22045. SessionAffinity string `json:"sessionAffinity,omitempty"`
  22046. // ServerResponse contains the HTTP response code and headers from the
  22047. // server.
  22048. googleapi.ServerResponse `json:"-"`
  22049. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  22050. // unconditionally include in API requests. By default, fields with
  22051. // empty values are omitted from API requests. However, any non-pointer,
  22052. // non-interface field appearing in ForceSendFields will be sent to the
  22053. // server regardless of whether the field is empty or not. This may be
  22054. // used to include empty fields in Patch requests.
  22055. ForceSendFields []string `json:"-"`
  22056. // NullFields is a list of field names (e.g. "BackupPool") to include in
  22057. // API requests with the JSON null value. By default, fields with empty
  22058. // values are omitted from API requests. However, any field with an
  22059. // empty value appearing in NullFields will be sent to the server as
  22060. // null. It is an error if a field in this list has a non-empty value.
  22061. // This may be used to include null fields in Patch requests.
  22062. NullFields []string `json:"-"`
  22063. }
  22064. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  22065. type NoMethod TargetPool
  22066. raw := NoMethod(*s)
  22067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22068. }
  22069. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  22070. type NoMethod TargetPool
  22071. var s1 struct {
  22072. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  22073. *NoMethod
  22074. }
  22075. s1.NoMethod = (*NoMethod)(s)
  22076. if err := json.Unmarshal(data, &s1); err != nil {
  22077. return err
  22078. }
  22079. s.FailoverRatio = float64(s1.FailoverRatio)
  22080. return nil
  22081. }
  22082. type TargetPoolAggregatedList struct {
  22083. // Id: [Output Only] Unique identifier for the resource; defined by the
  22084. // server.
  22085. Id string `json:"id,omitempty"`
  22086. // Items: A list of TargetPool resources.
  22087. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  22088. // Kind: [Output Only] Type of resource. Always
  22089. // compute#targetPoolAggregatedList for aggregated lists of target
  22090. // pools.
  22091. Kind string `json:"kind,omitempty"`
  22092. // NextPageToken: [Output Only] This token allows you to get the next
  22093. // page of results for list requests. If the number of results is larger
  22094. // than maxResults, use the nextPageToken as a value for the query
  22095. // parameter pageToken in the next list request. Subsequent list
  22096. // requests will have their own nextPageToken to continue paging through
  22097. // the results.
  22098. NextPageToken string `json:"nextPageToken,omitempty"`
  22099. // SelfLink: [Output Only] Server-defined URL for this resource.
  22100. SelfLink string `json:"selfLink,omitempty"`
  22101. // Warning: [Output Only] Informational warning message.
  22102. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  22103. // ServerResponse contains the HTTP response code and headers from the
  22104. // server.
  22105. googleapi.ServerResponse `json:"-"`
  22106. // ForceSendFields is a list of field names (e.g. "Id") to
  22107. // unconditionally include in API requests. By default, fields with
  22108. // empty values are omitted from API requests. However, any non-pointer,
  22109. // non-interface field appearing in ForceSendFields will be sent to the
  22110. // server regardless of whether the field is empty or not. This may be
  22111. // used to include empty fields in Patch requests.
  22112. ForceSendFields []string `json:"-"`
  22113. // NullFields is a list of field names (e.g. "Id") to include in API
  22114. // requests with the JSON null value. By default, fields with empty
  22115. // values are omitted from API requests. However, any field with an
  22116. // empty value appearing in NullFields will be sent to the server as
  22117. // null. It is an error if a field in this list has a non-empty value.
  22118. // This may be used to include null fields in Patch requests.
  22119. NullFields []string `json:"-"`
  22120. }
  22121. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  22122. type NoMethod TargetPoolAggregatedList
  22123. raw := NoMethod(*s)
  22124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22125. }
  22126. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  22127. // message.
  22128. type TargetPoolAggregatedListWarning struct {
  22129. // Code: [Output Only] A warning code, if applicable. For example,
  22130. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22131. // the response.
  22132. //
  22133. // Possible values:
  22134. // "CLEANUP_FAILED"
  22135. // "DEPRECATED_RESOURCE_USED"
  22136. // "DEPRECATED_TYPE_USED"
  22137. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22138. // "EXPERIMENTAL_TYPE_USED"
  22139. // "EXTERNAL_API_WARNING"
  22140. // "FIELD_VALUE_OVERRIDEN"
  22141. // "INJECTED_KERNELS_DEPRECATED"
  22142. // "MISSING_TYPE_DEPENDENCY"
  22143. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22144. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22145. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22146. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22147. // "NEXT_HOP_NOT_RUNNING"
  22148. // "NOT_CRITICAL_ERROR"
  22149. // "NO_RESULTS_ON_PAGE"
  22150. // "REQUIRED_TOS_AGREEMENT"
  22151. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22152. // "RESOURCE_NOT_DELETED"
  22153. // "SCHEMA_VALIDATION_IGNORED"
  22154. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22155. // "UNDECLARED_PROPERTIES"
  22156. // "UNREACHABLE"
  22157. Code string `json:"code,omitempty"`
  22158. // Data: [Output Only] Metadata about this warning in key: value format.
  22159. // For example:
  22160. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22161. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  22162. // Message: [Output Only] A human-readable description of the warning
  22163. // code.
  22164. Message string `json:"message,omitempty"`
  22165. // ForceSendFields is a list of field names (e.g. "Code") to
  22166. // unconditionally include in API requests. By default, fields with
  22167. // empty values are omitted from API requests. However, any non-pointer,
  22168. // non-interface field appearing in ForceSendFields will be sent to the
  22169. // server regardless of whether the field is empty or not. This may be
  22170. // used to include empty fields in Patch requests.
  22171. ForceSendFields []string `json:"-"`
  22172. // NullFields is a list of field names (e.g. "Code") to include in API
  22173. // requests with the JSON null value. By default, fields with empty
  22174. // values are omitted from API requests. However, any field with an
  22175. // empty value appearing in NullFields will be sent to the server as
  22176. // null. It is an error if a field in this list has a non-empty value.
  22177. // This may be used to include null fields in Patch requests.
  22178. NullFields []string `json:"-"`
  22179. }
  22180. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22181. type NoMethod TargetPoolAggregatedListWarning
  22182. raw := NoMethod(*s)
  22183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22184. }
  22185. type TargetPoolAggregatedListWarningData struct {
  22186. // Key: [Output Only] A key that provides more detail on the warning
  22187. // being returned. For example, for warnings where there are no results
  22188. // in a list request for a particular zone, this key might be scope and
  22189. // the key value might be the zone name. Other examples might be a key
  22190. // indicating a deprecated resource and a suggested replacement, or a
  22191. // warning about invalid network settings (for example, if an instance
  22192. // attempts to perform IP forwarding but is not enabled for IP
  22193. // forwarding).
  22194. Key string `json:"key,omitempty"`
  22195. // Value: [Output Only] A warning data value corresponding to the key.
  22196. Value string `json:"value,omitempty"`
  22197. // ForceSendFields is a list of field names (e.g. "Key") to
  22198. // unconditionally include in API requests. By default, fields with
  22199. // empty values are omitted from API requests. However, any non-pointer,
  22200. // non-interface field appearing in ForceSendFields will be sent to the
  22201. // server regardless of whether the field is empty or not. This may be
  22202. // used to include empty fields in Patch requests.
  22203. ForceSendFields []string `json:"-"`
  22204. // NullFields is a list of field names (e.g. "Key") to include in API
  22205. // requests with the JSON null value. By default, fields with empty
  22206. // values are omitted from API requests. However, any field with an
  22207. // empty value appearing in NullFields will be sent to the server as
  22208. // null. It is an error if a field in this list has a non-empty value.
  22209. // This may be used to include null fields in Patch requests.
  22210. NullFields []string `json:"-"`
  22211. }
  22212. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22213. type NoMethod TargetPoolAggregatedListWarningData
  22214. raw := NoMethod(*s)
  22215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22216. }
  22217. type TargetPoolInstanceHealth struct {
  22218. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  22219. // Kind: [Output Only] Type of resource. Always
  22220. // compute#targetPoolInstanceHealth when checking the health of an
  22221. // instance.
  22222. Kind string `json:"kind,omitempty"`
  22223. // ServerResponse contains the HTTP response code and headers from the
  22224. // server.
  22225. googleapi.ServerResponse `json:"-"`
  22226. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  22227. // unconditionally include in API requests. By default, fields with
  22228. // empty values are omitted from API requests. However, any non-pointer,
  22229. // non-interface field appearing in ForceSendFields will be sent to the
  22230. // server regardless of whether the field is empty or not. This may be
  22231. // used to include empty fields in Patch requests.
  22232. ForceSendFields []string `json:"-"`
  22233. // NullFields is a list of field names (e.g. "HealthStatus") to include
  22234. // in API requests with the JSON null value. By default, fields with
  22235. // empty values are omitted from API requests. However, any field with
  22236. // an empty value appearing in NullFields will be sent to the server as
  22237. // null. It is an error if a field in this list has a non-empty value.
  22238. // This may be used to include null fields in Patch requests.
  22239. NullFields []string `json:"-"`
  22240. }
  22241. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  22242. type NoMethod TargetPoolInstanceHealth
  22243. raw := NoMethod(*s)
  22244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22245. }
  22246. // TargetPoolList: Contains a list of TargetPool resources.
  22247. type TargetPoolList struct {
  22248. // Id: [Output Only] Unique identifier for the resource; defined by the
  22249. // server.
  22250. Id string `json:"id,omitempty"`
  22251. // Items: A list of TargetPool resources.
  22252. Items []*TargetPool `json:"items,omitempty"`
  22253. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  22254. // for lists of target pools.
  22255. Kind string `json:"kind,omitempty"`
  22256. // NextPageToken: [Output Only] This token allows you to get the next
  22257. // page of results for list requests. If the number of results is larger
  22258. // than maxResults, use the nextPageToken as a value for the query
  22259. // parameter pageToken in the next list request. Subsequent list
  22260. // requests will have their own nextPageToken to continue paging through
  22261. // the results.
  22262. NextPageToken string `json:"nextPageToken,omitempty"`
  22263. // SelfLink: [Output Only] Server-defined URL for this resource.
  22264. SelfLink string `json:"selfLink,omitempty"`
  22265. // Warning: [Output Only] Informational warning message.
  22266. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  22267. // ServerResponse contains the HTTP response code and headers from the
  22268. // server.
  22269. googleapi.ServerResponse `json:"-"`
  22270. // ForceSendFields is a list of field names (e.g. "Id") to
  22271. // unconditionally include in API requests. By default, fields with
  22272. // empty values are omitted from API requests. However, any non-pointer,
  22273. // non-interface field appearing in ForceSendFields will be sent to the
  22274. // server regardless of whether the field is empty or not. This may be
  22275. // used to include empty fields in Patch requests.
  22276. ForceSendFields []string `json:"-"`
  22277. // NullFields is a list of field names (e.g. "Id") to include in API
  22278. // requests with the JSON null value. By default, fields with empty
  22279. // values are omitted from API requests. However, any field with an
  22280. // empty value appearing in NullFields will be sent to the server as
  22281. // null. It is an error if a field in this list has a non-empty value.
  22282. // This may be used to include null fields in Patch requests.
  22283. NullFields []string `json:"-"`
  22284. }
  22285. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  22286. type NoMethod TargetPoolList
  22287. raw := NoMethod(*s)
  22288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22289. }
  22290. // TargetPoolListWarning: [Output Only] Informational warning message.
  22291. type TargetPoolListWarning struct {
  22292. // Code: [Output Only] A warning code, if applicable. For example,
  22293. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22294. // the response.
  22295. //
  22296. // Possible values:
  22297. // "CLEANUP_FAILED"
  22298. // "DEPRECATED_RESOURCE_USED"
  22299. // "DEPRECATED_TYPE_USED"
  22300. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22301. // "EXPERIMENTAL_TYPE_USED"
  22302. // "EXTERNAL_API_WARNING"
  22303. // "FIELD_VALUE_OVERRIDEN"
  22304. // "INJECTED_KERNELS_DEPRECATED"
  22305. // "MISSING_TYPE_DEPENDENCY"
  22306. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22307. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22308. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22309. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22310. // "NEXT_HOP_NOT_RUNNING"
  22311. // "NOT_CRITICAL_ERROR"
  22312. // "NO_RESULTS_ON_PAGE"
  22313. // "REQUIRED_TOS_AGREEMENT"
  22314. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22315. // "RESOURCE_NOT_DELETED"
  22316. // "SCHEMA_VALIDATION_IGNORED"
  22317. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22318. // "UNDECLARED_PROPERTIES"
  22319. // "UNREACHABLE"
  22320. Code string `json:"code,omitempty"`
  22321. // Data: [Output Only] Metadata about this warning in key: value format.
  22322. // For example:
  22323. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22324. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  22325. // Message: [Output Only] A human-readable description of the warning
  22326. // code.
  22327. Message string `json:"message,omitempty"`
  22328. // ForceSendFields is a list of field names (e.g. "Code") to
  22329. // unconditionally include in API requests. By default, fields with
  22330. // empty values are omitted from API requests. However, any non-pointer,
  22331. // non-interface field appearing in ForceSendFields will be sent to the
  22332. // server regardless of whether the field is empty or not. This may be
  22333. // used to include empty fields in Patch requests.
  22334. ForceSendFields []string `json:"-"`
  22335. // NullFields is a list of field names (e.g. "Code") to include in API
  22336. // requests with the JSON null value. By default, fields with empty
  22337. // values are omitted from API requests. However, any field with an
  22338. // empty value appearing in NullFields will be sent to the server as
  22339. // null. It is an error if a field in this list has a non-empty value.
  22340. // This may be used to include null fields in Patch requests.
  22341. NullFields []string `json:"-"`
  22342. }
  22343. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  22344. type NoMethod TargetPoolListWarning
  22345. raw := NoMethod(*s)
  22346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22347. }
  22348. type TargetPoolListWarningData struct {
  22349. // Key: [Output Only] A key that provides more detail on the warning
  22350. // being returned. For example, for warnings where there are no results
  22351. // in a list request for a particular zone, this key might be scope and
  22352. // the key value might be the zone name. Other examples might be a key
  22353. // indicating a deprecated resource and a suggested replacement, or a
  22354. // warning about invalid network settings (for example, if an instance
  22355. // attempts to perform IP forwarding but is not enabled for IP
  22356. // forwarding).
  22357. Key string `json:"key,omitempty"`
  22358. // Value: [Output Only] A warning data value corresponding to the key.
  22359. Value string `json:"value,omitempty"`
  22360. // ForceSendFields is a list of field names (e.g. "Key") to
  22361. // unconditionally include in API requests. By default, fields with
  22362. // empty values are omitted from API requests. However, any non-pointer,
  22363. // non-interface field appearing in ForceSendFields will be sent to the
  22364. // server regardless of whether the field is empty or not. This may be
  22365. // used to include empty fields in Patch requests.
  22366. ForceSendFields []string `json:"-"`
  22367. // NullFields is a list of field names (e.g. "Key") to include in API
  22368. // requests with the JSON null value. By default, fields with empty
  22369. // values are omitted from API requests. However, any field with an
  22370. // empty value appearing in NullFields will be sent to the server as
  22371. // null. It is an error if a field in this list has a non-empty value.
  22372. // This may be used to include null fields in Patch requests.
  22373. NullFields []string `json:"-"`
  22374. }
  22375. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  22376. type NoMethod TargetPoolListWarningData
  22377. raw := NoMethod(*s)
  22378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22379. }
  22380. type TargetPoolsAddHealthCheckRequest struct {
  22381. // HealthChecks: The HttpHealthCheck to add to the target pool.
  22382. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  22383. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  22384. // unconditionally include in API requests. By default, fields with
  22385. // empty values are omitted from API requests. However, any non-pointer,
  22386. // non-interface field appearing in ForceSendFields will be sent to the
  22387. // server regardless of whether the field is empty or not. This may be
  22388. // used to include empty fields in Patch requests.
  22389. ForceSendFields []string `json:"-"`
  22390. // NullFields is a list of field names (e.g. "HealthChecks") to include
  22391. // in API requests with the JSON null value. By default, fields with
  22392. // empty values are omitted from API requests. However, any field with
  22393. // an empty value appearing in NullFields will be sent to the server as
  22394. // null. It is an error if a field in this list has a non-empty value.
  22395. // This may be used to include null fields in Patch requests.
  22396. NullFields []string `json:"-"`
  22397. }
  22398. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  22399. type NoMethod TargetPoolsAddHealthCheckRequest
  22400. raw := NoMethod(*s)
  22401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22402. }
  22403. type TargetPoolsAddInstanceRequest struct {
  22404. // Instances: A full or partial URL to an instance to add to this target
  22405. // pool. This can be a full or partial URL. For example, the following
  22406. // are valid URLs:
  22407. // -
  22408. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  22409. // - projects/project-id/zones/zone/instances/instance-name
  22410. // - zones/zone/instances/instance-name
  22411. Instances []*InstanceReference `json:"instances,omitempty"`
  22412. // ForceSendFields is a list of field names (e.g. "Instances") to
  22413. // unconditionally include in API requests. By default, fields with
  22414. // empty values are omitted from API requests. However, any non-pointer,
  22415. // non-interface field appearing in ForceSendFields will be sent to the
  22416. // server regardless of whether the field is empty or not. This may be
  22417. // used to include empty fields in Patch requests.
  22418. ForceSendFields []string `json:"-"`
  22419. // NullFields is a list of field names (e.g. "Instances") to include in
  22420. // API requests with the JSON null value. By default, fields with empty
  22421. // values are omitted from API requests. However, any field with an
  22422. // empty value appearing in NullFields will be sent to the server as
  22423. // null. It is an error if a field in this list has a non-empty value.
  22424. // This may be used to include null fields in Patch requests.
  22425. NullFields []string `json:"-"`
  22426. }
  22427. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  22428. type NoMethod TargetPoolsAddInstanceRequest
  22429. raw := NoMethod(*s)
  22430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22431. }
  22432. type TargetPoolsRemoveHealthCheckRequest struct {
  22433. // HealthChecks: Health check URL to be removed. This can be a full or
  22434. // valid partial URL. For example, the following are valid URLs:
  22435. // -
  22436. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  22437. // - projects/project/global/httpHealthChecks/health-check
  22438. // - global/httpHealthChecks/health-check
  22439. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  22440. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  22441. // unconditionally include in API requests. By default, fields with
  22442. // empty values are omitted from API requests. However, any non-pointer,
  22443. // non-interface field appearing in ForceSendFields will be sent to the
  22444. // server regardless of whether the field is empty or not. This may be
  22445. // used to include empty fields in Patch requests.
  22446. ForceSendFields []string `json:"-"`
  22447. // NullFields is a list of field names (e.g. "HealthChecks") to include
  22448. // in API requests with the JSON null value. By default, fields with
  22449. // empty values are omitted from API requests. However, any field with
  22450. // an empty value appearing in NullFields will be sent to the server as
  22451. // null. It is an error if a field in this list has a non-empty value.
  22452. // This may be used to include null fields in Patch requests.
  22453. NullFields []string `json:"-"`
  22454. }
  22455. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  22456. type NoMethod TargetPoolsRemoveHealthCheckRequest
  22457. raw := NoMethod(*s)
  22458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22459. }
  22460. type TargetPoolsRemoveInstanceRequest struct {
  22461. // Instances: URLs of the instances to be removed from target pool.
  22462. Instances []*InstanceReference `json:"instances,omitempty"`
  22463. // ForceSendFields is a list of field names (e.g. "Instances") to
  22464. // unconditionally include in API requests. By default, fields with
  22465. // empty values are omitted from API requests. However, any non-pointer,
  22466. // non-interface field appearing in ForceSendFields will be sent to the
  22467. // server regardless of whether the field is empty or not. This may be
  22468. // used to include empty fields in Patch requests.
  22469. ForceSendFields []string `json:"-"`
  22470. // NullFields is a list of field names (e.g. "Instances") to include in
  22471. // API requests with the JSON null value. By default, fields with empty
  22472. // values are omitted from API requests. However, any field with an
  22473. // empty value appearing in NullFields will be sent to the server as
  22474. // null. It is an error if a field in this list has a non-empty value.
  22475. // This may be used to include null fields in Patch requests.
  22476. NullFields []string `json:"-"`
  22477. }
  22478. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  22479. type NoMethod TargetPoolsRemoveInstanceRequest
  22480. raw := NoMethod(*s)
  22481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22482. }
  22483. type TargetPoolsScopedList struct {
  22484. // TargetPools: A list of target pools contained in this scope.
  22485. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  22486. // Warning: Informational warning which replaces the list of addresses
  22487. // when the list is empty.
  22488. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  22489. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  22490. // unconditionally include in API requests. By default, fields with
  22491. // empty values are omitted from API requests. However, any non-pointer,
  22492. // non-interface field appearing in ForceSendFields will be sent to the
  22493. // server regardless of whether the field is empty or not. This may be
  22494. // used to include empty fields in Patch requests.
  22495. ForceSendFields []string `json:"-"`
  22496. // NullFields is a list of field names (e.g. "TargetPools") to include
  22497. // in API requests with the JSON null value. By default, fields with
  22498. // empty values are omitted from API requests. However, any field with
  22499. // an empty value appearing in NullFields will be sent to the server as
  22500. // null. It is an error if a field in this list has a non-empty value.
  22501. // This may be used to include null fields in Patch requests.
  22502. NullFields []string `json:"-"`
  22503. }
  22504. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  22505. type NoMethod TargetPoolsScopedList
  22506. raw := NoMethod(*s)
  22507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22508. }
  22509. // TargetPoolsScopedListWarning: Informational warning which replaces
  22510. // the list of addresses when the list is empty.
  22511. type TargetPoolsScopedListWarning struct {
  22512. // Code: [Output Only] A warning code, if applicable. For example,
  22513. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22514. // the response.
  22515. //
  22516. // Possible values:
  22517. // "CLEANUP_FAILED"
  22518. // "DEPRECATED_RESOURCE_USED"
  22519. // "DEPRECATED_TYPE_USED"
  22520. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22521. // "EXPERIMENTAL_TYPE_USED"
  22522. // "EXTERNAL_API_WARNING"
  22523. // "FIELD_VALUE_OVERRIDEN"
  22524. // "INJECTED_KERNELS_DEPRECATED"
  22525. // "MISSING_TYPE_DEPENDENCY"
  22526. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22527. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22528. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22529. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22530. // "NEXT_HOP_NOT_RUNNING"
  22531. // "NOT_CRITICAL_ERROR"
  22532. // "NO_RESULTS_ON_PAGE"
  22533. // "REQUIRED_TOS_AGREEMENT"
  22534. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22535. // "RESOURCE_NOT_DELETED"
  22536. // "SCHEMA_VALIDATION_IGNORED"
  22537. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22538. // "UNDECLARED_PROPERTIES"
  22539. // "UNREACHABLE"
  22540. Code string `json:"code,omitempty"`
  22541. // Data: [Output Only] Metadata about this warning in key: value format.
  22542. // For example:
  22543. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22544. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  22545. // Message: [Output Only] A human-readable description of the warning
  22546. // code.
  22547. Message string `json:"message,omitempty"`
  22548. // ForceSendFields is a list of field names (e.g. "Code") to
  22549. // unconditionally include in API requests. By default, fields with
  22550. // empty values are omitted from API requests. However, any non-pointer,
  22551. // non-interface field appearing in ForceSendFields will be sent to the
  22552. // server regardless of whether the field is empty or not. This may be
  22553. // used to include empty fields in Patch requests.
  22554. ForceSendFields []string `json:"-"`
  22555. // NullFields is a list of field names (e.g. "Code") to include in API
  22556. // requests with the JSON null value. By default, fields with empty
  22557. // values are omitted from API requests. However, any field with an
  22558. // empty value appearing in NullFields will be sent to the server as
  22559. // null. It is an error if a field in this list has a non-empty value.
  22560. // This may be used to include null fields in Patch requests.
  22561. NullFields []string `json:"-"`
  22562. }
  22563. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  22564. type NoMethod TargetPoolsScopedListWarning
  22565. raw := NoMethod(*s)
  22566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22567. }
  22568. type TargetPoolsScopedListWarningData struct {
  22569. // Key: [Output Only] A key that provides more detail on the warning
  22570. // being returned. For example, for warnings where there are no results
  22571. // in a list request for a particular zone, this key might be scope and
  22572. // the key value might be the zone name. Other examples might be a key
  22573. // indicating a deprecated resource and a suggested replacement, or a
  22574. // warning about invalid network settings (for example, if an instance
  22575. // attempts to perform IP forwarding but is not enabled for IP
  22576. // forwarding).
  22577. Key string `json:"key,omitempty"`
  22578. // Value: [Output Only] A warning data value corresponding to the key.
  22579. Value string `json:"value,omitempty"`
  22580. // ForceSendFields is a list of field names (e.g. "Key") to
  22581. // unconditionally include in API requests. By default, fields with
  22582. // empty values are omitted from API requests. However, any non-pointer,
  22583. // non-interface field appearing in ForceSendFields will be sent to the
  22584. // server regardless of whether the field is empty or not. This may be
  22585. // used to include empty fields in Patch requests.
  22586. ForceSendFields []string `json:"-"`
  22587. // NullFields is a list of field names (e.g. "Key") to include in API
  22588. // requests with the JSON null value. By default, fields with empty
  22589. // values are omitted from API requests. However, any field with an
  22590. // empty value appearing in NullFields will be sent to the server as
  22591. // null. It is an error if a field in this list has a non-empty value.
  22592. // This may be used to include null fields in Patch requests.
  22593. NullFields []string `json:"-"`
  22594. }
  22595. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  22596. type NoMethod TargetPoolsScopedListWarningData
  22597. raw := NoMethod(*s)
  22598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22599. }
  22600. type TargetReference struct {
  22601. Target string `json:"target,omitempty"`
  22602. // ForceSendFields is a list of field names (e.g. "Target") to
  22603. // unconditionally include in API requests. By default, fields with
  22604. // empty values are omitted from API requests. However, any non-pointer,
  22605. // non-interface field appearing in ForceSendFields will be sent to the
  22606. // server regardless of whether the field is empty or not. This may be
  22607. // used to include empty fields in Patch requests.
  22608. ForceSendFields []string `json:"-"`
  22609. // NullFields is a list of field names (e.g. "Target") to include in API
  22610. // requests with the JSON null value. By default, fields with empty
  22611. // values are omitted from API requests. However, any field with an
  22612. // empty value appearing in NullFields will be sent to the server as
  22613. // null. It is an error if a field in this list has a non-empty value.
  22614. // This may be used to include null fields in Patch requests.
  22615. NullFields []string `json:"-"`
  22616. }
  22617. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  22618. type NoMethod TargetReference
  22619. raw := NoMethod(*s)
  22620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22621. }
  22622. type TargetSslProxiesSetBackendServiceRequest struct {
  22623. // Service: The URL of the new BackendService resource for the
  22624. // targetSslProxy.
  22625. Service string `json:"service,omitempty"`
  22626. // ForceSendFields is a list of field names (e.g. "Service") to
  22627. // unconditionally include in API requests. By default, fields with
  22628. // empty values are omitted from API requests. However, any non-pointer,
  22629. // non-interface field appearing in ForceSendFields will be sent to the
  22630. // server regardless of whether the field is empty or not. This may be
  22631. // used to include empty fields in Patch requests.
  22632. ForceSendFields []string `json:"-"`
  22633. // NullFields is a list of field names (e.g. "Service") to include in
  22634. // API requests with the JSON null value. By default, fields with empty
  22635. // values are omitted from API requests. However, any field with an
  22636. // empty value appearing in NullFields will be sent to the server as
  22637. // null. It is an error if a field in this list has a non-empty value.
  22638. // This may be used to include null fields in Patch requests.
  22639. NullFields []string `json:"-"`
  22640. }
  22641. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  22642. type NoMethod TargetSslProxiesSetBackendServiceRequest
  22643. raw := NoMethod(*s)
  22644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22645. }
  22646. type TargetSslProxiesSetProxyHeaderRequest struct {
  22647. // ProxyHeader: The new type of proxy header to append before sending
  22648. // data to the backend. NONE or PROXY_V1 are allowed.
  22649. //
  22650. // Possible values:
  22651. // "NONE"
  22652. // "PROXY_V1"
  22653. ProxyHeader string `json:"proxyHeader,omitempty"`
  22654. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  22655. // unconditionally include in API requests. By default, fields with
  22656. // empty values are omitted from API requests. However, any non-pointer,
  22657. // non-interface field appearing in ForceSendFields will be sent to the
  22658. // server regardless of whether the field is empty or not. This may be
  22659. // used to include empty fields in Patch requests.
  22660. ForceSendFields []string `json:"-"`
  22661. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  22662. // in API requests with the JSON null value. By default, fields with
  22663. // empty values are omitted from API requests. However, any field with
  22664. // an empty value appearing in NullFields will be sent to the server as
  22665. // null. It is an error if a field in this list has a non-empty value.
  22666. // This may be used to include null fields in Patch requests.
  22667. NullFields []string `json:"-"`
  22668. }
  22669. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  22670. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  22671. raw := NoMethod(*s)
  22672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22673. }
  22674. type TargetSslProxiesSetSslCertificatesRequest struct {
  22675. // SslCertificates: New set of URLs to SslCertificate resources to
  22676. // associate with this TargetSslProxy. Currently exactly one ssl
  22677. // certificate must be specified.
  22678. SslCertificates []string `json:"sslCertificates,omitempty"`
  22679. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  22680. // unconditionally include in API requests. By default, fields with
  22681. // empty values are omitted from API requests. However, any non-pointer,
  22682. // non-interface field appearing in ForceSendFields will be sent to the
  22683. // server regardless of whether the field is empty or not. This may be
  22684. // used to include empty fields in Patch requests.
  22685. ForceSendFields []string `json:"-"`
  22686. // NullFields is a list of field names (e.g. "SslCertificates") to
  22687. // include in API requests with the JSON null value. By default, fields
  22688. // with empty values are omitted from API requests. However, any field
  22689. // with an empty value appearing in NullFields will be sent to the
  22690. // server as null. It is an error if a field in this list has a
  22691. // non-empty value. This may be used to include null fields in Patch
  22692. // requests.
  22693. NullFields []string `json:"-"`
  22694. }
  22695. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  22696. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  22697. raw := NoMethod(*s)
  22698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22699. }
  22700. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  22701. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  22702. // resource_for v1.targetSslProxies ==)
  22703. type TargetSslProxy struct {
  22704. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22705. // format.
  22706. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22707. // Description: An optional description of this resource. Provide this
  22708. // property when you create the resource.
  22709. Description string `json:"description,omitempty"`
  22710. // Id: [Output Only] The unique identifier for the resource. This
  22711. // identifier is defined by the server.
  22712. Id uint64 `json:"id,omitempty,string"`
  22713. // Kind: [Output Only] Type of the resource. Always
  22714. // compute#targetSslProxy for target SSL proxies.
  22715. Kind string `json:"kind,omitempty"`
  22716. // Name: Name of the resource. Provided by the client when the resource
  22717. // is created. The name must be 1-63 characters long, and comply with
  22718. // RFC1035. Specifically, the name must be 1-63 characters long and
  22719. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22720. // the first character must be a lowercase letter, and all following
  22721. // characters must be a dash, lowercase letter, or digit, except the
  22722. // last character, which cannot be a dash.
  22723. Name string `json:"name,omitempty"`
  22724. // ProxyHeader: Specifies the type of proxy header to append before
  22725. // sending data to the backend, either NONE or PROXY_V1. The default is
  22726. // NONE.
  22727. //
  22728. // Possible values:
  22729. // "NONE"
  22730. // "PROXY_V1"
  22731. ProxyHeader string `json:"proxyHeader,omitempty"`
  22732. // SelfLink: [Output Only] Server-defined URL for the resource.
  22733. SelfLink string `json:"selfLink,omitempty"`
  22734. // Service: URL to the BackendService resource.
  22735. Service string `json:"service,omitempty"`
  22736. // SslCertificates: URLs to SslCertificate resources that are used to
  22737. // authenticate connections to Backends. At least one SSL certificate
  22738. // must be specified. Currently, you may specify up to 15 SSL
  22739. // certificates.
  22740. SslCertificates []string `json:"sslCertificates,omitempty"`
  22741. // SslPolicy: URL of SslPolicy resource that will be associated with the
  22742. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  22743. // not have any SSL policy configured.
  22744. SslPolicy string `json:"sslPolicy,omitempty"`
  22745. // ServerResponse contains the HTTP response code and headers from the
  22746. // server.
  22747. googleapi.ServerResponse `json:"-"`
  22748. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22749. // to unconditionally include in API requests. By default, fields with
  22750. // empty values are omitted from API requests. However, any non-pointer,
  22751. // non-interface field appearing in ForceSendFields will be sent to the
  22752. // server regardless of whether the field is empty or not. This may be
  22753. // used to include empty fields in Patch requests.
  22754. ForceSendFields []string `json:"-"`
  22755. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22756. // include in API requests with the JSON null value. By default, fields
  22757. // with empty values are omitted from API requests. However, any field
  22758. // with an empty value appearing in NullFields will be sent to the
  22759. // server as null. It is an error if a field in this list has a
  22760. // non-empty value. This may be used to include null fields in Patch
  22761. // requests.
  22762. NullFields []string `json:"-"`
  22763. }
  22764. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  22765. type NoMethod TargetSslProxy
  22766. raw := NoMethod(*s)
  22767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22768. }
  22769. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  22770. type TargetSslProxyList struct {
  22771. // Id: [Output Only] Unique identifier for the resource; defined by the
  22772. // server.
  22773. Id string `json:"id,omitempty"`
  22774. // Items: A list of TargetSslProxy resources.
  22775. Items []*TargetSslProxy `json:"items,omitempty"`
  22776. // Kind: Type of resource.
  22777. Kind string `json:"kind,omitempty"`
  22778. // NextPageToken: [Output Only] This token allows you to get the next
  22779. // page of results for list requests. If the number of results is larger
  22780. // than maxResults, use the nextPageToken as a value for the query
  22781. // parameter pageToken in the next list request. Subsequent list
  22782. // requests will have their own nextPageToken to continue paging through
  22783. // the results.
  22784. NextPageToken string `json:"nextPageToken,omitempty"`
  22785. // SelfLink: [Output Only] Server-defined URL for this resource.
  22786. SelfLink string `json:"selfLink,omitempty"`
  22787. // Warning: [Output Only] Informational warning message.
  22788. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  22789. // ServerResponse contains the HTTP response code and headers from the
  22790. // server.
  22791. googleapi.ServerResponse `json:"-"`
  22792. // ForceSendFields is a list of field names (e.g. "Id") to
  22793. // unconditionally include in API requests. By default, fields with
  22794. // empty values are omitted from API requests. However, any non-pointer,
  22795. // non-interface field appearing in ForceSendFields will be sent to the
  22796. // server regardless of whether the field is empty or not. This may be
  22797. // used to include empty fields in Patch requests.
  22798. ForceSendFields []string `json:"-"`
  22799. // NullFields is a list of field names (e.g. "Id") to include in API
  22800. // requests with the JSON null value. By default, fields with empty
  22801. // values are omitted from API requests. However, any field with an
  22802. // empty value appearing in NullFields will be sent to the server as
  22803. // null. It is an error if a field in this list has a non-empty value.
  22804. // This may be used to include null fields in Patch requests.
  22805. NullFields []string `json:"-"`
  22806. }
  22807. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  22808. type NoMethod TargetSslProxyList
  22809. raw := NoMethod(*s)
  22810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22811. }
  22812. // TargetSslProxyListWarning: [Output Only] Informational warning
  22813. // message.
  22814. type TargetSslProxyListWarning struct {
  22815. // Code: [Output Only] A warning code, if applicable. For example,
  22816. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22817. // the response.
  22818. //
  22819. // Possible values:
  22820. // "CLEANUP_FAILED"
  22821. // "DEPRECATED_RESOURCE_USED"
  22822. // "DEPRECATED_TYPE_USED"
  22823. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22824. // "EXPERIMENTAL_TYPE_USED"
  22825. // "EXTERNAL_API_WARNING"
  22826. // "FIELD_VALUE_OVERRIDEN"
  22827. // "INJECTED_KERNELS_DEPRECATED"
  22828. // "MISSING_TYPE_DEPENDENCY"
  22829. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22830. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22831. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22832. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22833. // "NEXT_HOP_NOT_RUNNING"
  22834. // "NOT_CRITICAL_ERROR"
  22835. // "NO_RESULTS_ON_PAGE"
  22836. // "REQUIRED_TOS_AGREEMENT"
  22837. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22838. // "RESOURCE_NOT_DELETED"
  22839. // "SCHEMA_VALIDATION_IGNORED"
  22840. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22841. // "UNDECLARED_PROPERTIES"
  22842. // "UNREACHABLE"
  22843. Code string `json:"code,omitempty"`
  22844. // Data: [Output Only] Metadata about this warning in key: value format.
  22845. // For example:
  22846. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22847. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  22848. // Message: [Output Only] A human-readable description of the warning
  22849. // code.
  22850. Message string `json:"message,omitempty"`
  22851. // ForceSendFields is a list of field names (e.g. "Code") to
  22852. // unconditionally include in API requests. By default, fields with
  22853. // empty values are omitted from API requests. However, any non-pointer,
  22854. // non-interface field appearing in ForceSendFields will be sent to the
  22855. // server regardless of whether the field is empty or not. This may be
  22856. // used to include empty fields in Patch requests.
  22857. ForceSendFields []string `json:"-"`
  22858. // NullFields is a list of field names (e.g. "Code") to include in API
  22859. // requests with the JSON null value. By default, fields with empty
  22860. // values are omitted from API requests. However, any field with an
  22861. // empty value appearing in NullFields will be sent to the server as
  22862. // null. It is an error if a field in this list has a non-empty value.
  22863. // This may be used to include null fields in Patch requests.
  22864. NullFields []string `json:"-"`
  22865. }
  22866. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  22867. type NoMethod TargetSslProxyListWarning
  22868. raw := NoMethod(*s)
  22869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22870. }
  22871. type TargetSslProxyListWarningData struct {
  22872. // Key: [Output Only] A key that provides more detail on the warning
  22873. // being returned. For example, for warnings where there are no results
  22874. // in a list request for a particular zone, this key might be scope and
  22875. // the key value might be the zone name. Other examples might be a key
  22876. // indicating a deprecated resource and a suggested replacement, or a
  22877. // warning about invalid network settings (for example, if an instance
  22878. // attempts to perform IP forwarding but is not enabled for IP
  22879. // forwarding).
  22880. Key string `json:"key,omitempty"`
  22881. // Value: [Output Only] A warning data value corresponding to the key.
  22882. Value string `json:"value,omitempty"`
  22883. // ForceSendFields is a list of field names (e.g. "Key") to
  22884. // unconditionally include in API requests. By default, fields with
  22885. // empty values are omitted from API requests. However, any non-pointer,
  22886. // non-interface field appearing in ForceSendFields will be sent to the
  22887. // server regardless of whether the field is empty or not. This may be
  22888. // used to include empty fields in Patch requests.
  22889. ForceSendFields []string `json:"-"`
  22890. // NullFields is a list of field names (e.g. "Key") to include in API
  22891. // requests with the JSON null value. By default, fields with empty
  22892. // values are omitted from API requests. However, any field with an
  22893. // empty value appearing in NullFields will be sent to the server as
  22894. // null. It is an error if a field in this list has a non-empty value.
  22895. // This may be used to include null fields in Patch requests.
  22896. NullFields []string `json:"-"`
  22897. }
  22898. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  22899. type NoMethod TargetSslProxyListWarningData
  22900. raw := NoMethod(*s)
  22901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22902. }
  22903. type TargetTcpProxiesSetBackendServiceRequest struct {
  22904. // Service: The URL of the new BackendService resource for the
  22905. // targetTcpProxy.
  22906. Service string `json:"service,omitempty"`
  22907. // ForceSendFields is a list of field names (e.g. "Service") to
  22908. // unconditionally include in API requests. By default, fields with
  22909. // empty values are omitted from API requests. However, any non-pointer,
  22910. // non-interface field appearing in ForceSendFields will be sent to the
  22911. // server regardless of whether the field is empty or not. This may be
  22912. // used to include empty fields in Patch requests.
  22913. ForceSendFields []string `json:"-"`
  22914. // NullFields is a list of field names (e.g. "Service") to include in
  22915. // API requests with the JSON null value. By default, fields with empty
  22916. // values are omitted from API requests. However, any field with an
  22917. // empty value appearing in NullFields will be sent to the server as
  22918. // null. It is an error if a field in this list has a non-empty value.
  22919. // This may be used to include null fields in Patch requests.
  22920. NullFields []string `json:"-"`
  22921. }
  22922. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  22923. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  22924. raw := NoMethod(*s)
  22925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22926. }
  22927. type TargetTcpProxiesSetProxyHeaderRequest struct {
  22928. // ProxyHeader: The new type of proxy header to append before sending
  22929. // data to the backend. NONE or PROXY_V1 are allowed.
  22930. //
  22931. // Possible values:
  22932. // "NONE"
  22933. // "PROXY_V1"
  22934. ProxyHeader string `json:"proxyHeader,omitempty"`
  22935. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  22936. // unconditionally include in API requests. By default, fields with
  22937. // empty values are omitted from API requests. However, any non-pointer,
  22938. // non-interface field appearing in ForceSendFields will be sent to the
  22939. // server regardless of whether the field is empty or not. This may be
  22940. // used to include empty fields in Patch requests.
  22941. ForceSendFields []string `json:"-"`
  22942. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  22943. // in API requests with the JSON null value. By default, fields with
  22944. // empty values are omitted from API requests. However, any field with
  22945. // an empty value appearing in NullFields will be sent to the server as
  22946. // null. It is an error if a field in this list has a non-empty value.
  22947. // This may be used to include null fields in Patch requests.
  22948. NullFields []string `json:"-"`
  22949. }
  22950. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  22951. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  22952. raw := NoMethod(*s)
  22953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22954. }
  22955. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  22956. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  22957. // resource_for v1.targetTcpProxies ==)
  22958. type TargetTcpProxy struct {
  22959. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22960. // format.
  22961. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22962. // Description: An optional description of this resource. Provide this
  22963. // property when you create the resource.
  22964. Description string `json:"description,omitempty"`
  22965. // Id: [Output Only] The unique identifier for the resource. This
  22966. // identifier is defined by the server.
  22967. Id uint64 `json:"id,omitempty,string"`
  22968. // Kind: [Output Only] Type of the resource. Always
  22969. // compute#targetTcpProxy for target TCP proxies.
  22970. Kind string `json:"kind,omitempty"`
  22971. // Name: Name of the resource. Provided by the client when the resource
  22972. // is created. The name must be 1-63 characters long, and comply with
  22973. // RFC1035. Specifically, the name must be 1-63 characters long and
  22974. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22975. // the first character must be a lowercase letter, and all following
  22976. // characters must be a dash, lowercase letter, or digit, except the
  22977. // last character, which cannot be a dash.
  22978. Name string `json:"name,omitempty"`
  22979. // ProxyHeader: Specifies the type of proxy header to append before
  22980. // sending data to the backend, either NONE or PROXY_V1. The default is
  22981. // NONE.
  22982. //
  22983. // Possible values:
  22984. // "NONE"
  22985. // "PROXY_V1"
  22986. ProxyHeader string `json:"proxyHeader,omitempty"`
  22987. // SelfLink: [Output Only] Server-defined URL for the resource.
  22988. SelfLink string `json:"selfLink,omitempty"`
  22989. // Service: URL to the BackendService resource.
  22990. Service string `json:"service,omitempty"`
  22991. // ServerResponse contains the HTTP response code and headers from the
  22992. // server.
  22993. googleapi.ServerResponse `json:"-"`
  22994. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22995. // to unconditionally include in API requests. By default, fields with
  22996. // empty values are omitted from API requests. However, any non-pointer,
  22997. // non-interface field appearing in ForceSendFields will be sent to the
  22998. // server regardless of whether the field is empty or not. This may be
  22999. // used to include empty fields in Patch requests.
  23000. ForceSendFields []string `json:"-"`
  23001. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23002. // include in API requests with the JSON null value. By default, fields
  23003. // with empty values are omitted from API requests. However, any field
  23004. // with an empty value appearing in NullFields will be sent to the
  23005. // server as null. It is an error if a field in this list has a
  23006. // non-empty value. This may be used to include null fields in Patch
  23007. // requests.
  23008. NullFields []string `json:"-"`
  23009. }
  23010. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  23011. type NoMethod TargetTcpProxy
  23012. raw := NoMethod(*s)
  23013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23014. }
  23015. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  23016. type TargetTcpProxyList struct {
  23017. // Id: [Output Only] Unique identifier for the resource; defined by the
  23018. // server.
  23019. Id string `json:"id,omitempty"`
  23020. // Items: A list of TargetTcpProxy resources.
  23021. Items []*TargetTcpProxy `json:"items,omitempty"`
  23022. // Kind: Type of resource.
  23023. Kind string `json:"kind,omitempty"`
  23024. // NextPageToken: [Output Only] This token allows you to get the next
  23025. // page of results for list requests. If the number of results is larger
  23026. // than maxResults, use the nextPageToken as a value for the query
  23027. // parameter pageToken in the next list request. Subsequent list
  23028. // requests will have their own nextPageToken to continue paging through
  23029. // the results.
  23030. NextPageToken string `json:"nextPageToken,omitempty"`
  23031. // SelfLink: [Output Only] Server-defined URL for this resource.
  23032. SelfLink string `json:"selfLink,omitempty"`
  23033. // Warning: [Output Only] Informational warning message.
  23034. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  23035. // ServerResponse contains the HTTP response code and headers from the
  23036. // server.
  23037. googleapi.ServerResponse `json:"-"`
  23038. // ForceSendFields is a list of field names (e.g. "Id") to
  23039. // unconditionally include in API requests. By default, fields with
  23040. // empty values are omitted from API requests. However, any non-pointer,
  23041. // non-interface field appearing in ForceSendFields will be sent to the
  23042. // server regardless of whether the field is empty or not. This may be
  23043. // used to include empty fields in Patch requests.
  23044. ForceSendFields []string `json:"-"`
  23045. // NullFields is a list of field names (e.g. "Id") to include in API
  23046. // requests with the JSON null value. By default, fields with empty
  23047. // values are omitted from API requests. However, any field with an
  23048. // empty value appearing in NullFields will be sent to the server as
  23049. // null. It is an error if a field in this list has a non-empty value.
  23050. // This may be used to include null fields in Patch requests.
  23051. NullFields []string `json:"-"`
  23052. }
  23053. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  23054. type NoMethod TargetTcpProxyList
  23055. raw := NoMethod(*s)
  23056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23057. }
  23058. // TargetTcpProxyListWarning: [Output Only] Informational warning
  23059. // message.
  23060. type TargetTcpProxyListWarning struct {
  23061. // Code: [Output Only] A warning code, if applicable. For example,
  23062. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23063. // the response.
  23064. //
  23065. // Possible values:
  23066. // "CLEANUP_FAILED"
  23067. // "DEPRECATED_RESOURCE_USED"
  23068. // "DEPRECATED_TYPE_USED"
  23069. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23070. // "EXPERIMENTAL_TYPE_USED"
  23071. // "EXTERNAL_API_WARNING"
  23072. // "FIELD_VALUE_OVERRIDEN"
  23073. // "INJECTED_KERNELS_DEPRECATED"
  23074. // "MISSING_TYPE_DEPENDENCY"
  23075. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23076. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23077. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23078. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23079. // "NEXT_HOP_NOT_RUNNING"
  23080. // "NOT_CRITICAL_ERROR"
  23081. // "NO_RESULTS_ON_PAGE"
  23082. // "REQUIRED_TOS_AGREEMENT"
  23083. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23084. // "RESOURCE_NOT_DELETED"
  23085. // "SCHEMA_VALIDATION_IGNORED"
  23086. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23087. // "UNDECLARED_PROPERTIES"
  23088. // "UNREACHABLE"
  23089. Code string `json:"code,omitempty"`
  23090. // Data: [Output Only] Metadata about this warning in key: value format.
  23091. // For example:
  23092. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23093. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  23094. // Message: [Output Only] A human-readable description of the warning
  23095. // code.
  23096. Message string `json:"message,omitempty"`
  23097. // ForceSendFields is a list of field names (e.g. "Code") to
  23098. // unconditionally include in API requests. By default, fields with
  23099. // empty values are omitted from API requests. However, any non-pointer,
  23100. // non-interface field appearing in ForceSendFields will be sent to the
  23101. // server regardless of whether the field is empty or not. This may be
  23102. // used to include empty fields in Patch requests.
  23103. ForceSendFields []string `json:"-"`
  23104. // NullFields is a list of field names (e.g. "Code") to include in API
  23105. // requests with the JSON null value. By default, fields with empty
  23106. // values are omitted from API requests. However, any field with an
  23107. // empty value appearing in NullFields will be sent to the server as
  23108. // null. It is an error if a field in this list has a non-empty value.
  23109. // This may be used to include null fields in Patch requests.
  23110. NullFields []string `json:"-"`
  23111. }
  23112. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  23113. type NoMethod TargetTcpProxyListWarning
  23114. raw := NoMethod(*s)
  23115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23116. }
  23117. type TargetTcpProxyListWarningData struct {
  23118. // Key: [Output Only] A key that provides more detail on the warning
  23119. // being returned. For example, for warnings where there are no results
  23120. // in a list request for a particular zone, this key might be scope and
  23121. // the key value might be the zone name. Other examples might be a key
  23122. // indicating a deprecated resource and a suggested replacement, or a
  23123. // warning about invalid network settings (for example, if an instance
  23124. // attempts to perform IP forwarding but is not enabled for IP
  23125. // forwarding).
  23126. Key string `json:"key,omitempty"`
  23127. // Value: [Output Only] A warning data value corresponding to the key.
  23128. Value string `json:"value,omitempty"`
  23129. // ForceSendFields is a list of field names (e.g. "Key") to
  23130. // unconditionally include in API requests. By default, fields with
  23131. // empty values are omitted from API requests. However, any non-pointer,
  23132. // non-interface field appearing in ForceSendFields will be sent to the
  23133. // server regardless of whether the field is empty or not. This may be
  23134. // used to include empty fields in Patch requests.
  23135. ForceSendFields []string `json:"-"`
  23136. // NullFields is a list of field names (e.g. "Key") to include in API
  23137. // requests with the JSON null value. By default, fields with empty
  23138. // values are omitted from API requests. However, any field with an
  23139. // empty value appearing in NullFields will be sent to the server as
  23140. // null. It is an error if a field in this list has a non-empty value.
  23141. // This may be used to include null fields in Patch requests.
  23142. NullFields []string `json:"-"`
  23143. }
  23144. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  23145. type NoMethod TargetTcpProxyListWarningData
  23146. raw := NoMethod(*s)
  23147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23148. }
  23149. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  23150. // resource_for beta.targetVpnGateways ==) (== resource_for
  23151. // v1.targetVpnGateways ==)
  23152. type TargetVpnGateway struct {
  23153. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23154. // format.
  23155. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23156. // Description: An optional description of this resource. Provide this
  23157. // property when you create the resource.
  23158. Description string `json:"description,omitempty"`
  23159. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  23160. // resources. ForwardingRules are created using
  23161. // compute.forwardingRules.insert and associated to a VPN gateway.
  23162. ForwardingRules []string `json:"forwardingRules,omitempty"`
  23163. // Id: [Output Only] The unique identifier for the resource. This
  23164. // identifier is defined by the server.
  23165. Id uint64 `json:"id,omitempty,string"`
  23166. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  23167. // for target VPN gateways.
  23168. Kind string `json:"kind,omitempty"`
  23169. // Name: Name of the resource. Provided by the client when the resource
  23170. // is created. The name must be 1-63 characters long, and comply with
  23171. // RFC1035. Specifically, the name must be 1-63 characters long and
  23172. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23173. // the first character must be a lowercase letter, and all following
  23174. // characters must be a dash, lowercase letter, or digit, except the
  23175. // last character, which cannot be a dash.
  23176. Name string `json:"name,omitempty"`
  23177. // Network: URL of the network to which this VPN gateway is attached.
  23178. // Provided by the client when the VPN gateway is created.
  23179. Network string `json:"network,omitempty"`
  23180. // Region: [Output Only] URL of the region where the target VPN gateway
  23181. // resides. You must specify this field as part of the HTTP request URL.
  23182. // It is not settable as a field in the request body.
  23183. Region string `json:"region,omitempty"`
  23184. // SelfLink: [Output Only] Server-defined URL for the resource.
  23185. SelfLink string `json:"selfLink,omitempty"`
  23186. // Status: [Output Only] The status of the VPN gateway.
  23187. //
  23188. // Possible values:
  23189. // "CREATING"
  23190. // "DELETING"
  23191. // "FAILED"
  23192. // "READY"
  23193. Status string `json:"status,omitempty"`
  23194. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  23195. // VpnTunnels are created using compute.vpntunnels.insert method and
  23196. // associated to a VPN gateway.
  23197. Tunnels []string `json:"tunnels,omitempty"`
  23198. // ServerResponse contains the HTTP response code and headers from the
  23199. // server.
  23200. googleapi.ServerResponse `json:"-"`
  23201. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23202. // to unconditionally include in API requests. By default, fields with
  23203. // empty values are omitted from API requests. However, any non-pointer,
  23204. // non-interface field appearing in ForceSendFields will be sent to the
  23205. // server regardless of whether the field is empty or not. This may be
  23206. // used to include empty fields in Patch requests.
  23207. ForceSendFields []string `json:"-"`
  23208. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23209. // include in API requests with the JSON null value. By default, fields
  23210. // with empty values are omitted from API requests. However, any field
  23211. // with an empty value appearing in NullFields will be sent to the
  23212. // server as null. It is an error if a field in this list has a
  23213. // non-empty value. This may be used to include null fields in Patch
  23214. // requests.
  23215. NullFields []string `json:"-"`
  23216. }
  23217. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  23218. type NoMethod TargetVpnGateway
  23219. raw := NoMethod(*s)
  23220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23221. }
  23222. type TargetVpnGatewayAggregatedList struct {
  23223. // Id: [Output Only] Unique identifier for the resource; defined by the
  23224. // server.
  23225. Id string `json:"id,omitempty"`
  23226. // Items: A list of TargetVpnGateway resources.
  23227. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  23228. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  23229. // for target VPN gateways.
  23230. Kind string `json:"kind,omitempty"`
  23231. // NextPageToken: [Output Only] This token allows you to get the next
  23232. // page of results for list requests. If the number of results is larger
  23233. // than maxResults, use the nextPageToken as a value for the query
  23234. // parameter pageToken in the next list request. Subsequent list
  23235. // requests will have their own nextPageToken to continue paging through
  23236. // the results.
  23237. NextPageToken string `json:"nextPageToken,omitempty"`
  23238. // SelfLink: [Output Only] Server-defined URL for this resource.
  23239. SelfLink string `json:"selfLink,omitempty"`
  23240. // Warning: [Output Only] Informational warning message.
  23241. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  23242. // ServerResponse contains the HTTP response code and headers from the
  23243. // server.
  23244. googleapi.ServerResponse `json:"-"`
  23245. // ForceSendFields is a list of field names (e.g. "Id") to
  23246. // unconditionally include in API requests. By default, fields with
  23247. // empty values are omitted from API requests. However, any non-pointer,
  23248. // non-interface field appearing in ForceSendFields will be sent to the
  23249. // server regardless of whether the field is empty or not. This may be
  23250. // used to include empty fields in Patch requests.
  23251. ForceSendFields []string `json:"-"`
  23252. // NullFields is a list of field names (e.g. "Id") to include in API
  23253. // requests with the JSON null value. By default, fields with empty
  23254. // values are omitted from API requests. However, any field with an
  23255. // empty value appearing in NullFields will be sent to the server as
  23256. // null. It is an error if a field in this list has a non-empty value.
  23257. // This may be used to include null fields in Patch requests.
  23258. NullFields []string `json:"-"`
  23259. }
  23260. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  23261. type NoMethod TargetVpnGatewayAggregatedList
  23262. raw := NoMethod(*s)
  23263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23264. }
  23265. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  23266. // warning message.
  23267. type TargetVpnGatewayAggregatedListWarning struct {
  23268. // Code: [Output Only] A warning code, if applicable. For example,
  23269. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23270. // the response.
  23271. //
  23272. // Possible values:
  23273. // "CLEANUP_FAILED"
  23274. // "DEPRECATED_RESOURCE_USED"
  23275. // "DEPRECATED_TYPE_USED"
  23276. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23277. // "EXPERIMENTAL_TYPE_USED"
  23278. // "EXTERNAL_API_WARNING"
  23279. // "FIELD_VALUE_OVERRIDEN"
  23280. // "INJECTED_KERNELS_DEPRECATED"
  23281. // "MISSING_TYPE_DEPENDENCY"
  23282. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23283. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23284. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23285. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23286. // "NEXT_HOP_NOT_RUNNING"
  23287. // "NOT_CRITICAL_ERROR"
  23288. // "NO_RESULTS_ON_PAGE"
  23289. // "REQUIRED_TOS_AGREEMENT"
  23290. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23291. // "RESOURCE_NOT_DELETED"
  23292. // "SCHEMA_VALIDATION_IGNORED"
  23293. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23294. // "UNDECLARED_PROPERTIES"
  23295. // "UNREACHABLE"
  23296. Code string `json:"code,omitempty"`
  23297. // Data: [Output Only] Metadata about this warning in key: value format.
  23298. // For example:
  23299. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23300. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  23301. // Message: [Output Only] A human-readable description of the warning
  23302. // code.
  23303. Message string `json:"message,omitempty"`
  23304. // ForceSendFields is a list of field names (e.g. "Code") to
  23305. // unconditionally include in API requests. By default, fields with
  23306. // empty values are omitted from API requests. However, any non-pointer,
  23307. // non-interface field appearing in ForceSendFields will be sent to the
  23308. // server regardless of whether the field is empty or not. This may be
  23309. // used to include empty fields in Patch requests.
  23310. ForceSendFields []string `json:"-"`
  23311. // NullFields is a list of field names (e.g. "Code") to include in API
  23312. // requests with the JSON null value. By default, fields with empty
  23313. // values are omitted from API requests. However, any field with an
  23314. // empty value appearing in NullFields will be sent to the server as
  23315. // null. It is an error if a field in this list has a non-empty value.
  23316. // This may be used to include null fields in Patch requests.
  23317. NullFields []string `json:"-"`
  23318. }
  23319. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  23320. type NoMethod TargetVpnGatewayAggregatedListWarning
  23321. raw := NoMethod(*s)
  23322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23323. }
  23324. type TargetVpnGatewayAggregatedListWarningData struct {
  23325. // Key: [Output Only] A key that provides more detail on the warning
  23326. // being returned. For example, for warnings where there are no results
  23327. // in a list request for a particular zone, this key might be scope and
  23328. // the key value might be the zone name. Other examples might be a key
  23329. // indicating a deprecated resource and a suggested replacement, or a
  23330. // warning about invalid network settings (for example, if an instance
  23331. // attempts to perform IP forwarding but is not enabled for IP
  23332. // forwarding).
  23333. Key string `json:"key,omitempty"`
  23334. // Value: [Output Only] A warning data value corresponding to the key.
  23335. Value string `json:"value,omitempty"`
  23336. // ForceSendFields is a list of field names (e.g. "Key") to
  23337. // unconditionally include in API requests. By default, fields with
  23338. // empty values are omitted from API requests. However, any non-pointer,
  23339. // non-interface field appearing in ForceSendFields will be sent to the
  23340. // server regardless of whether the field is empty or not. This may be
  23341. // used to include empty fields in Patch requests.
  23342. ForceSendFields []string `json:"-"`
  23343. // NullFields is a list of field names (e.g. "Key") to include in API
  23344. // requests with the JSON null value. By default, fields with empty
  23345. // values are omitted from API requests. However, any field with an
  23346. // empty value appearing in NullFields will be sent to the server as
  23347. // null. It is an error if a field in this list has a non-empty value.
  23348. // This may be used to include null fields in Patch requests.
  23349. NullFields []string `json:"-"`
  23350. }
  23351. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  23352. type NoMethod TargetVpnGatewayAggregatedListWarningData
  23353. raw := NoMethod(*s)
  23354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23355. }
  23356. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  23357. type TargetVpnGatewayList struct {
  23358. // Id: [Output Only] Unique identifier for the resource; defined by the
  23359. // server.
  23360. Id string `json:"id,omitempty"`
  23361. // Items: A list of TargetVpnGateway resources.
  23362. Items []*TargetVpnGateway `json:"items,omitempty"`
  23363. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  23364. // for target VPN gateways.
  23365. Kind string `json:"kind,omitempty"`
  23366. // NextPageToken: [Output Only] This token allows you to get the next
  23367. // page of results for list requests. If the number of results is larger
  23368. // than maxResults, use the nextPageToken as a value for the query
  23369. // parameter pageToken in the next list request. Subsequent list
  23370. // requests will have their own nextPageToken to continue paging through
  23371. // the results.
  23372. NextPageToken string `json:"nextPageToken,omitempty"`
  23373. // SelfLink: [Output Only] Server-defined URL for this resource.
  23374. SelfLink string `json:"selfLink,omitempty"`
  23375. // Warning: [Output Only] Informational warning message.
  23376. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  23377. // ServerResponse contains the HTTP response code and headers from the
  23378. // server.
  23379. googleapi.ServerResponse `json:"-"`
  23380. // ForceSendFields is a list of field names (e.g. "Id") to
  23381. // unconditionally include in API requests. By default, fields with
  23382. // empty values are omitted from API requests. However, any non-pointer,
  23383. // non-interface field appearing in ForceSendFields will be sent to the
  23384. // server regardless of whether the field is empty or not. This may be
  23385. // used to include empty fields in Patch requests.
  23386. ForceSendFields []string `json:"-"`
  23387. // NullFields is a list of field names (e.g. "Id") to include in API
  23388. // requests with the JSON null value. By default, fields with empty
  23389. // values are omitted from API requests. However, any field with an
  23390. // empty value appearing in NullFields will be sent to the server as
  23391. // null. It is an error if a field in this list has a non-empty value.
  23392. // This may be used to include null fields in Patch requests.
  23393. NullFields []string `json:"-"`
  23394. }
  23395. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  23396. type NoMethod TargetVpnGatewayList
  23397. raw := NoMethod(*s)
  23398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23399. }
  23400. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  23401. // message.
  23402. type TargetVpnGatewayListWarning struct {
  23403. // Code: [Output Only] A warning code, if applicable. For example,
  23404. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23405. // the response.
  23406. //
  23407. // Possible values:
  23408. // "CLEANUP_FAILED"
  23409. // "DEPRECATED_RESOURCE_USED"
  23410. // "DEPRECATED_TYPE_USED"
  23411. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23412. // "EXPERIMENTAL_TYPE_USED"
  23413. // "EXTERNAL_API_WARNING"
  23414. // "FIELD_VALUE_OVERRIDEN"
  23415. // "INJECTED_KERNELS_DEPRECATED"
  23416. // "MISSING_TYPE_DEPENDENCY"
  23417. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23418. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23419. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23420. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23421. // "NEXT_HOP_NOT_RUNNING"
  23422. // "NOT_CRITICAL_ERROR"
  23423. // "NO_RESULTS_ON_PAGE"
  23424. // "REQUIRED_TOS_AGREEMENT"
  23425. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23426. // "RESOURCE_NOT_DELETED"
  23427. // "SCHEMA_VALIDATION_IGNORED"
  23428. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23429. // "UNDECLARED_PROPERTIES"
  23430. // "UNREACHABLE"
  23431. Code string `json:"code,omitempty"`
  23432. // Data: [Output Only] Metadata about this warning in key: value format.
  23433. // For example:
  23434. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23435. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  23436. // Message: [Output Only] A human-readable description of the warning
  23437. // code.
  23438. Message string `json:"message,omitempty"`
  23439. // ForceSendFields is a list of field names (e.g. "Code") to
  23440. // unconditionally include in API requests. By default, fields with
  23441. // empty values are omitted from API requests. However, any non-pointer,
  23442. // non-interface field appearing in ForceSendFields will be sent to the
  23443. // server regardless of whether the field is empty or not. This may be
  23444. // used to include empty fields in Patch requests.
  23445. ForceSendFields []string `json:"-"`
  23446. // NullFields is a list of field names (e.g. "Code") to include in API
  23447. // requests with the JSON null value. By default, fields with empty
  23448. // values are omitted from API requests. However, any field with an
  23449. // empty value appearing in NullFields will be sent to the server as
  23450. // null. It is an error if a field in this list has a non-empty value.
  23451. // This may be used to include null fields in Patch requests.
  23452. NullFields []string `json:"-"`
  23453. }
  23454. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  23455. type NoMethod TargetVpnGatewayListWarning
  23456. raw := NoMethod(*s)
  23457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23458. }
  23459. type TargetVpnGatewayListWarningData struct {
  23460. // Key: [Output Only] A key that provides more detail on the warning
  23461. // being returned. For example, for warnings where there are no results
  23462. // in a list request for a particular zone, this key might be scope and
  23463. // the key value might be the zone name. Other examples might be a key
  23464. // indicating a deprecated resource and a suggested replacement, or a
  23465. // warning about invalid network settings (for example, if an instance
  23466. // attempts to perform IP forwarding but is not enabled for IP
  23467. // forwarding).
  23468. Key string `json:"key,omitempty"`
  23469. // Value: [Output Only] A warning data value corresponding to the key.
  23470. Value string `json:"value,omitempty"`
  23471. // ForceSendFields is a list of field names (e.g. "Key") to
  23472. // unconditionally include in API requests. By default, fields with
  23473. // empty values are omitted from API requests. However, any non-pointer,
  23474. // non-interface field appearing in ForceSendFields will be sent to the
  23475. // server regardless of whether the field is empty or not. This may be
  23476. // used to include empty fields in Patch requests.
  23477. ForceSendFields []string `json:"-"`
  23478. // NullFields is a list of field names (e.g. "Key") to include in API
  23479. // requests with the JSON null value. By default, fields with empty
  23480. // values are omitted from API requests. However, any field with an
  23481. // empty value appearing in NullFields will be sent to the server as
  23482. // null. It is an error if a field in this list has a non-empty value.
  23483. // This may be used to include null fields in Patch requests.
  23484. NullFields []string `json:"-"`
  23485. }
  23486. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  23487. type NoMethod TargetVpnGatewayListWarningData
  23488. raw := NoMethod(*s)
  23489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23490. }
  23491. type TargetVpnGatewaysScopedList struct {
  23492. // TargetVpnGateways: [Output Only] A list of target vpn gateways
  23493. // contained in this scope.
  23494. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  23495. // Warning: [Output Only] Informational warning which replaces the list
  23496. // of addresses when the list is empty.
  23497. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  23498. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  23499. // to unconditionally include in API requests. By default, fields with
  23500. // empty values are omitted from API requests. However, any non-pointer,
  23501. // non-interface field appearing in ForceSendFields will be sent to the
  23502. // server regardless of whether the field is empty or not. This may be
  23503. // used to include empty fields in Patch requests.
  23504. ForceSendFields []string `json:"-"`
  23505. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  23506. // include in API requests with the JSON null value. By default, fields
  23507. // with empty values are omitted from API requests. However, any field
  23508. // with an empty value appearing in NullFields will be sent to the
  23509. // server as null. It is an error if a field in this list has a
  23510. // non-empty value. This may be used to include null fields in Patch
  23511. // requests.
  23512. NullFields []string `json:"-"`
  23513. }
  23514. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  23515. type NoMethod TargetVpnGatewaysScopedList
  23516. raw := NoMethod(*s)
  23517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23518. }
  23519. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  23520. // warning which replaces the list of addresses when the list is empty.
  23521. type TargetVpnGatewaysScopedListWarning struct {
  23522. // Code: [Output Only] A warning code, if applicable. For example,
  23523. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23524. // the response.
  23525. //
  23526. // Possible values:
  23527. // "CLEANUP_FAILED"
  23528. // "DEPRECATED_RESOURCE_USED"
  23529. // "DEPRECATED_TYPE_USED"
  23530. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23531. // "EXPERIMENTAL_TYPE_USED"
  23532. // "EXTERNAL_API_WARNING"
  23533. // "FIELD_VALUE_OVERRIDEN"
  23534. // "INJECTED_KERNELS_DEPRECATED"
  23535. // "MISSING_TYPE_DEPENDENCY"
  23536. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23537. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23538. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23539. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23540. // "NEXT_HOP_NOT_RUNNING"
  23541. // "NOT_CRITICAL_ERROR"
  23542. // "NO_RESULTS_ON_PAGE"
  23543. // "REQUIRED_TOS_AGREEMENT"
  23544. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23545. // "RESOURCE_NOT_DELETED"
  23546. // "SCHEMA_VALIDATION_IGNORED"
  23547. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23548. // "UNDECLARED_PROPERTIES"
  23549. // "UNREACHABLE"
  23550. Code string `json:"code,omitempty"`
  23551. // Data: [Output Only] Metadata about this warning in key: value format.
  23552. // For example:
  23553. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23554. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  23555. // Message: [Output Only] A human-readable description of the warning
  23556. // code.
  23557. Message string `json:"message,omitempty"`
  23558. // ForceSendFields is a list of field names (e.g. "Code") to
  23559. // unconditionally include in API requests. By default, fields with
  23560. // empty values are omitted from API requests. However, any non-pointer,
  23561. // non-interface field appearing in ForceSendFields will be sent to the
  23562. // server regardless of whether the field is empty or not. This may be
  23563. // used to include empty fields in Patch requests.
  23564. ForceSendFields []string `json:"-"`
  23565. // NullFields is a list of field names (e.g. "Code") to include in API
  23566. // requests with the JSON null value. By default, fields with empty
  23567. // values are omitted from API requests. However, any field with an
  23568. // empty value appearing in NullFields will be sent to the server as
  23569. // null. It is an error if a field in this list has a non-empty value.
  23570. // This may be used to include null fields in Patch requests.
  23571. NullFields []string `json:"-"`
  23572. }
  23573. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  23574. type NoMethod TargetVpnGatewaysScopedListWarning
  23575. raw := NoMethod(*s)
  23576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23577. }
  23578. type TargetVpnGatewaysScopedListWarningData struct {
  23579. // Key: [Output Only] A key that provides more detail on the warning
  23580. // being returned. For example, for warnings where there are no results
  23581. // in a list request for a particular zone, this key might be scope and
  23582. // the key value might be the zone name. Other examples might be a key
  23583. // indicating a deprecated resource and a suggested replacement, or a
  23584. // warning about invalid network settings (for example, if an instance
  23585. // attempts to perform IP forwarding but is not enabled for IP
  23586. // forwarding).
  23587. Key string `json:"key,omitempty"`
  23588. // Value: [Output Only] A warning data value corresponding to the key.
  23589. Value string `json:"value,omitempty"`
  23590. // ForceSendFields is a list of field names (e.g. "Key") to
  23591. // unconditionally include in API requests. By default, fields with
  23592. // empty values are omitted from API requests. However, any non-pointer,
  23593. // non-interface field appearing in ForceSendFields will be sent to the
  23594. // server regardless of whether the field is empty or not. This may be
  23595. // used to include empty fields in Patch requests.
  23596. ForceSendFields []string `json:"-"`
  23597. // NullFields is a list of field names (e.g. "Key") to include in API
  23598. // requests with the JSON null value. By default, fields with empty
  23599. // values are omitted from API requests. However, any field with an
  23600. // empty value appearing in NullFields will be sent to the server as
  23601. // null. It is an error if a field in this list has a non-empty value.
  23602. // This may be used to include null fields in Patch requests.
  23603. NullFields []string `json:"-"`
  23604. }
  23605. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  23606. type NoMethod TargetVpnGatewaysScopedListWarningData
  23607. raw := NoMethod(*s)
  23608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23609. }
  23610. type TestFailure struct {
  23611. ActualService string `json:"actualService,omitempty"`
  23612. ExpectedService string `json:"expectedService,omitempty"`
  23613. Host string `json:"host,omitempty"`
  23614. Path string `json:"path,omitempty"`
  23615. // ForceSendFields is a list of field names (e.g. "ActualService") to
  23616. // unconditionally include in API requests. By default, fields with
  23617. // empty values are omitted from API requests. However, any non-pointer,
  23618. // non-interface field appearing in ForceSendFields will be sent to the
  23619. // server regardless of whether the field is empty or not. This may be
  23620. // used to include empty fields in Patch requests.
  23621. ForceSendFields []string `json:"-"`
  23622. // NullFields is a list of field names (e.g. "ActualService") to include
  23623. // in API requests with the JSON null value. By default, fields with
  23624. // empty values are omitted from API requests. However, any field with
  23625. // an empty value appearing in NullFields will be sent to the server as
  23626. // null. It is an error if a field in this list has a non-empty value.
  23627. // This may be used to include null fields in Patch requests.
  23628. NullFields []string `json:"-"`
  23629. }
  23630. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  23631. type NoMethod TestFailure
  23632. raw := NoMethod(*s)
  23633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23634. }
  23635. type TestPermissionsRequest struct {
  23636. // Permissions: The set of permissions to check for the 'resource'.
  23637. // Permissions with wildcards (such as '*' or 'storage.*') are not
  23638. // allowed.
  23639. Permissions []string `json:"permissions,omitempty"`
  23640. // ForceSendFields is a list of field names (e.g. "Permissions") to
  23641. // unconditionally include in API requests. By default, fields with
  23642. // empty values are omitted from API requests. However, any non-pointer,
  23643. // non-interface field appearing in ForceSendFields will be sent to the
  23644. // server regardless of whether the field is empty or not. This may be
  23645. // used to include empty fields in Patch requests.
  23646. ForceSendFields []string `json:"-"`
  23647. // NullFields is a list of field names (e.g. "Permissions") to include
  23648. // in API requests with the JSON null value. By default, fields with
  23649. // empty values are omitted from API requests. However, any field with
  23650. // an empty value appearing in NullFields will be sent to the server as
  23651. // null. It is an error if a field in this list has a non-empty value.
  23652. // This may be used to include null fields in Patch requests.
  23653. NullFields []string `json:"-"`
  23654. }
  23655. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  23656. type NoMethod TestPermissionsRequest
  23657. raw := NoMethod(*s)
  23658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23659. }
  23660. type TestPermissionsResponse struct {
  23661. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  23662. // the caller is allowed.
  23663. Permissions []string `json:"permissions,omitempty"`
  23664. // ServerResponse contains the HTTP response code and headers from the
  23665. // server.
  23666. googleapi.ServerResponse `json:"-"`
  23667. // ForceSendFields is a list of field names (e.g. "Permissions") to
  23668. // unconditionally include in API requests. By default, fields with
  23669. // empty values are omitted from API requests. However, any non-pointer,
  23670. // non-interface field appearing in ForceSendFields will be sent to the
  23671. // server regardless of whether the field is empty or not. This may be
  23672. // used to include empty fields in Patch requests.
  23673. ForceSendFields []string `json:"-"`
  23674. // NullFields is a list of field names (e.g. "Permissions") to include
  23675. // in API requests with the JSON null value. By default, fields with
  23676. // empty values are omitted from API requests. However, any field with
  23677. // an empty value appearing in NullFields will be sent to the server as
  23678. // null. It is an error if a field in this list has a non-empty value.
  23679. // This may be used to include null fields in Patch requests.
  23680. NullFields []string `json:"-"`
  23681. }
  23682. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  23683. type NoMethod TestPermissionsResponse
  23684. raw := NoMethod(*s)
  23685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23686. }
  23687. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  23688. // to the BackendService resource, based on the "longest-match" of the
  23689. // URL's host and path.
  23690. type UrlMap struct {
  23691. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23692. // format.
  23693. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23694. // DefaultService: The URL of the backendService resource if none of the
  23695. // hostRules match.
  23696. // Use defaultService instead of defaultRouteAction when simple routing
  23697. // to a backendService is desired and other advanced capabilities like
  23698. // traffic splitting and rewrites are not required.
  23699. // Only one of defaultService, defaultRouteAction or defaultUrlRedirect
  23700. // should must be set.
  23701. DefaultService string `json:"defaultService,omitempty"`
  23702. // Description: An optional description of this resource. Provide this
  23703. // property when you create the resource.
  23704. Description string `json:"description,omitempty"`
  23705. // Fingerprint: Fingerprint of this resource. A hash of the contents
  23706. // stored in this object. This field is used in optimistic locking. This
  23707. // field will be ignored when inserting a UrlMap. An up-to-date
  23708. // fingerprint must be provided in order to update the UrlMap, otherwise
  23709. // the request will fail with error 412 conditionNotMet.
  23710. //
  23711. // To see the latest fingerprint, make a get() request to retrieve a
  23712. // UrlMap.
  23713. Fingerprint string `json:"fingerprint,omitempty"`
  23714. // HostRules: The list of HostRules to use against the URL.
  23715. HostRules []*HostRule `json:"hostRules,omitempty"`
  23716. // Id: [Output Only] The unique identifier for the resource. This
  23717. // identifier is defined by the server.
  23718. Id uint64 `json:"id,omitempty,string"`
  23719. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  23720. // url maps.
  23721. Kind string `json:"kind,omitempty"`
  23722. // Name: Name of the resource. Provided by the client when the resource
  23723. // is created. The name must be 1-63 characters long, and comply with
  23724. // RFC1035. Specifically, the name must be 1-63 characters long and
  23725. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23726. // the first character must be a lowercase letter, and all following
  23727. // characters must be a dash, lowercase letter, or digit, except the
  23728. // last character, which cannot be a dash.
  23729. Name string `json:"name,omitempty"`
  23730. // PathMatchers: The list of named PathMatchers to use against the URL.
  23731. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  23732. // SelfLink: [Output Only] Server-defined URL for the resource.
  23733. SelfLink string `json:"selfLink,omitempty"`
  23734. // Tests: The list of expected URL mapping tests. Request to update this
  23735. // UrlMap will succeed only if all of the test cases pass. You can
  23736. // specify a maximum of 100 tests per UrlMap.
  23737. Tests []*UrlMapTest `json:"tests,omitempty"`
  23738. // ServerResponse contains the HTTP response code and headers from the
  23739. // server.
  23740. googleapi.ServerResponse `json:"-"`
  23741. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23742. // to unconditionally include in API requests. By default, fields with
  23743. // empty values are omitted from API requests. However, any non-pointer,
  23744. // non-interface field appearing in ForceSendFields will be sent to the
  23745. // server regardless of whether the field is empty or not. This may be
  23746. // used to include empty fields in Patch requests.
  23747. ForceSendFields []string `json:"-"`
  23748. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23749. // include in API requests with the JSON null value. By default, fields
  23750. // with empty values are omitted from API requests. However, any field
  23751. // with an empty value appearing in NullFields will be sent to the
  23752. // server as null. It is an error if a field in this list has a
  23753. // non-empty value. This may be used to include null fields in Patch
  23754. // requests.
  23755. NullFields []string `json:"-"`
  23756. }
  23757. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  23758. type NoMethod UrlMap
  23759. raw := NoMethod(*s)
  23760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23761. }
  23762. // UrlMapList: Contains a list of UrlMap resources.
  23763. type UrlMapList struct {
  23764. // Id: [Output Only] Unique identifier for the resource; defined by the
  23765. // server.
  23766. Id string `json:"id,omitempty"`
  23767. // Items: A list of UrlMap resources.
  23768. Items []*UrlMap `json:"items,omitempty"`
  23769. // Kind: Type of resource.
  23770. Kind string `json:"kind,omitempty"`
  23771. // NextPageToken: [Output Only] This token allows you to get the next
  23772. // page of results for list requests. If the number of results is larger
  23773. // than maxResults, use the nextPageToken as a value for the query
  23774. // parameter pageToken in the next list request. Subsequent list
  23775. // requests will have their own nextPageToken to continue paging through
  23776. // the results.
  23777. NextPageToken string `json:"nextPageToken,omitempty"`
  23778. // SelfLink: [Output Only] Server-defined URL for this resource.
  23779. SelfLink string `json:"selfLink,omitempty"`
  23780. // Warning: [Output Only] Informational warning message.
  23781. Warning *UrlMapListWarning `json:"warning,omitempty"`
  23782. // ServerResponse contains the HTTP response code and headers from the
  23783. // server.
  23784. googleapi.ServerResponse `json:"-"`
  23785. // ForceSendFields is a list of field names (e.g. "Id") to
  23786. // unconditionally include in API requests. By default, fields with
  23787. // empty values are omitted from API requests. However, any non-pointer,
  23788. // non-interface field appearing in ForceSendFields will be sent to the
  23789. // server regardless of whether the field is empty or not. This may be
  23790. // used to include empty fields in Patch requests.
  23791. ForceSendFields []string `json:"-"`
  23792. // NullFields is a list of field names (e.g. "Id") to include in API
  23793. // requests with the JSON null value. By default, fields with empty
  23794. // values are omitted from API requests. However, any field with an
  23795. // empty value appearing in NullFields will be sent to the server as
  23796. // null. It is an error if a field in this list has a non-empty value.
  23797. // This may be used to include null fields in Patch requests.
  23798. NullFields []string `json:"-"`
  23799. }
  23800. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  23801. type NoMethod UrlMapList
  23802. raw := NoMethod(*s)
  23803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23804. }
  23805. // UrlMapListWarning: [Output Only] Informational warning message.
  23806. type UrlMapListWarning struct {
  23807. // Code: [Output Only] A warning code, if applicable. For example,
  23808. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23809. // the response.
  23810. //
  23811. // Possible values:
  23812. // "CLEANUP_FAILED"
  23813. // "DEPRECATED_RESOURCE_USED"
  23814. // "DEPRECATED_TYPE_USED"
  23815. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23816. // "EXPERIMENTAL_TYPE_USED"
  23817. // "EXTERNAL_API_WARNING"
  23818. // "FIELD_VALUE_OVERRIDEN"
  23819. // "INJECTED_KERNELS_DEPRECATED"
  23820. // "MISSING_TYPE_DEPENDENCY"
  23821. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23822. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23823. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23824. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23825. // "NEXT_HOP_NOT_RUNNING"
  23826. // "NOT_CRITICAL_ERROR"
  23827. // "NO_RESULTS_ON_PAGE"
  23828. // "REQUIRED_TOS_AGREEMENT"
  23829. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23830. // "RESOURCE_NOT_DELETED"
  23831. // "SCHEMA_VALIDATION_IGNORED"
  23832. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23833. // "UNDECLARED_PROPERTIES"
  23834. // "UNREACHABLE"
  23835. Code string `json:"code,omitempty"`
  23836. // Data: [Output Only] Metadata about this warning in key: value format.
  23837. // For example:
  23838. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23839. Data []*UrlMapListWarningData `json:"data,omitempty"`
  23840. // Message: [Output Only] A human-readable description of the warning
  23841. // code.
  23842. Message string `json:"message,omitempty"`
  23843. // ForceSendFields is a list of field names (e.g. "Code") to
  23844. // unconditionally include in API requests. By default, fields with
  23845. // empty values are omitted from API requests. However, any non-pointer,
  23846. // non-interface field appearing in ForceSendFields will be sent to the
  23847. // server regardless of whether the field is empty or not. This may be
  23848. // used to include empty fields in Patch requests.
  23849. ForceSendFields []string `json:"-"`
  23850. // NullFields is a list of field names (e.g. "Code") to include in API
  23851. // requests with the JSON null value. By default, fields with empty
  23852. // values are omitted from API requests. However, any field with an
  23853. // empty value appearing in NullFields will be sent to the server as
  23854. // null. It is an error if a field in this list has a non-empty value.
  23855. // This may be used to include null fields in Patch requests.
  23856. NullFields []string `json:"-"`
  23857. }
  23858. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  23859. type NoMethod UrlMapListWarning
  23860. raw := NoMethod(*s)
  23861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23862. }
  23863. type UrlMapListWarningData struct {
  23864. // Key: [Output Only] A key that provides more detail on the warning
  23865. // being returned. For example, for warnings where there are no results
  23866. // in a list request for a particular zone, this key might be scope and
  23867. // the key value might be the zone name. Other examples might be a key
  23868. // indicating a deprecated resource and a suggested replacement, or a
  23869. // warning about invalid network settings (for example, if an instance
  23870. // attempts to perform IP forwarding but is not enabled for IP
  23871. // forwarding).
  23872. Key string `json:"key,omitempty"`
  23873. // Value: [Output Only] A warning data value corresponding to the key.
  23874. Value string `json:"value,omitempty"`
  23875. // ForceSendFields is a list of field names (e.g. "Key") to
  23876. // unconditionally include in API requests. By default, fields with
  23877. // empty values are omitted from API requests. However, any non-pointer,
  23878. // non-interface field appearing in ForceSendFields will be sent to the
  23879. // server regardless of whether the field is empty or not. This may be
  23880. // used to include empty fields in Patch requests.
  23881. ForceSendFields []string `json:"-"`
  23882. // NullFields is a list of field names (e.g. "Key") to include in API
  23883. // requests with the JSON null value. By default, fields with empty
  23884. // values are omitted from API requests. However, any field with an
  23885. // empty value appearing in NullFields will be sent to the server as
  23886. // null. It is an error if a field in this list has a non-empty value.
  23887. // This may be used to include null fields in Patch requests.
  23888. NullFields []string `json:"-"`
  23889. }
  23890. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  23891. type NoMethod UrlMapListWarningData
  23892. raw := NoMethod(*s)
  23893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23894. }
  23895. type UrlMapReference struct {
  23896. UrlMap string `json:"urlMap,omitempty"`
  23897. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  23898. // unconditionally include in API requests. By default, fields with
  23899. // empty values are omitted from API requests. However, any non-pointer,
  23900. // non-interface field appearing in ForceSendFields will be sent to the
  23901. // server regardless of whether the field is empty or not. This may be
  23902. // used to include empty fields in Patch requests.
  23903. ForceSendFields []string `json:"-"`
  23904. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  23905. // requests with the JSON null value. By default, fields with empty
  23906. // values are omitted from API requests. However, any field with an
  23907. // empty value appearing in NullFields will be sent to the server as
  23908. // null. It is an error if a field in this list has a non-empty value.
  23909. // This may be used to include null fields in Patch requests.
  23910. NullFields []string `json:"-"`
  23911. }
  23912. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  23913. type NoMethod UrlMapReference
  23914. raw := NoMethod(*s)
  23915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23916. }
  23917. // UrlMapTest: Message for the expected URL mappings.
  23918. type UrlMapTest struct {
  23919. // Description: Description of this test case.
  23920. Description string `json:"description,omitempty"`
  23921. // Host: Host portion of the URL.
  23922. Host string `json:"host,omitempty"`
  23923. // Path: Path portion of the URL.
  23924. Path string `json:"path,omitempty"`
  23925. // Service: Expected BackendService resource the given URL should be
  23926. // mapped to.
  23927. Service string `json:"service,omitempty"`
  23928. // ForceSendFields is a list of field names (e.g. "Description") to
  23929. // unconditionally include in API requests. By default, fields with
  23930. // empty values are omitted from API requests. However, any non-pointer,
  23931. // non-interface field appearing in ForceSendFields will be sent to the
  23932. // server regardless of whether the field is empty or not. This may be
  23933. // used to include empty fields in Patch requests.
  23934. ForceSendFields []string `json:"-"`
  23935. // NullFields is a list of field names (e.g. "Description") to include
  23936. // in API requests with the JSON null value. By default, fields with
  23937. // empty values are omitted from API requests. However, any field with
  23938. // an empty value appearing in NullFields will be sent to the server as
  23939. // null. It is an error if a field in this list has a non-empty value.
  23940. // This may be used to include null fields in Patch requests.
  23941. NullFields []string `json:"-"`
  23942. }
  23943. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  23944. type NoMethod UrlMapTest
  23945. raw := NoMethod(*s)
  23946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23947. }
  23948. // UrlMapValidationResult: Message representing the validation result
  23949. // for a UrlMap.
  23950. type UrlMapValidationResult struct {
  23951. LoadErrors []string `json:"loadErrors,omitempty"`
  23952. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  23953. // If false, 'loadErrors' indicates the reasons.
  23954. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  23955. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  23956. // TestPassed: If successfully loaded, this field indicates whether the
  23957. // test passed. If false, 'testFailures's indicate the reason of
  23958. // failure.
  23959. TestPassed bool `json:"testPassed,omitempty"`
  23960. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  23961. // unconditionally include in API requests. By default, fields with
  23962. // empty values are omitted from API requests. However, any non-pointer,
  23963. // non-interface field appearing in ForceSendFields will be sent to the
  23964. // server regardless of whether the field is empty or not. This may be
  23965. // used to include empty fields in Patch requests.
  23966. ForceSendFields []string `json:"-"`
  23967. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  23968. // API requests with the JSON null value. By default, fields with empty
  23969. // values are omitted from API requests. However, any field with an
  23970. // empty value appearing in NullFields will be sent to the server as
  23971. // null. It is an error if a field in this list has a non-empty value.
  23972. // This may be used to include null fields in Patch requests.
  23973. NullFields []string `json:"-"`
  23974. }
  23975. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  23976. type NoMethod UrlMapValidationResult
  23977. raw := NoMethod(*s)
  23978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23979. }
  23980. type UrlMapsValidateRequest struct {
  23981. // Resource: Content of the UrlMap to be validated.
  23982. Resource *UrlMap `json:"resource,omitempty"`
  23983. // ForceSendFields is a list of field names (e.g. "Resource") to
  23984. // unconditionally include in API requests. By default, fields with
  23985. // empty values are omitted from API requests. However, any non-pointer,
  23986. // non-interface field appearing in ForceSendFields will be sent to the
  23987. // server regardless of whether the field is empty or not. This may be
  23988. // used to include empty fields in Patch requests.
  23989. ForceSendFields []string `json:"-"`
  23990. // NullFields is a list of field names (e.g. "Resource") to include in
  23991. // API requests with the JSON null value. By default, fields with empty
  23992. // values are omitted from API requests. However, any field with an
  23993. // empty value appearing in NullFields will be sent to the server as
  23994. // null. It is an error if a field in this list has a non-empty value.
  23995. // This may be used to include null fields in Patch requests.
  23996. NullFields []string `json:"-"`
  23997. }
  23998. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  23999. type NoMethod UrlMapsValidateRequest
  24000. raw := NoMethod(*s)
  24001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24002. }
  24003. type UrlMapsValidateResponse struct {
  24004. Result *UrlMapValidationResult `json:"result,omitempty"`
  24005. // ServerResponse contains the HTTP response code and headers from the
  24006. // server.
  24007. googleapi.ServerResponse `json:"-"`
  24008. // ForceSendFields is a list of field names (e.g. "Result") to
  24009. // unconditionally include in API requests. By default, fields with
  24010. // empty values are omitted from API requests. However, any non-pointer,
  24011. // non-interface field appearing in ForceSendFields will be sent to the
  24012. // server regardless of whether the field is empty or not. This may be
  24013. // used to include empty fields in Patch requests.
  24014. ForceSendFields []string `json:"-"`
  24015. // NullFields is a list of field names (e.g. "Result") to include in API
  24016. // requests with the JSON null value. By default, fields with empty
  24017. // values are omitted from API requests. However, any field with an
  24018. // empty value appearing in NullFields will be sent to the server as
  24019. // null. It is an error if a field in this list has a non-empty value.
  24020. // This may be used to include null fields in Patch requests.
  24021. NullFields []string `json:"-"`
  24022. }
  24023. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  24024. type NoMethod UrlMapsValidateResponse
  24025. raw := NoMethod(*s)
  24026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24027. }
  24028. // UsableSubnetwork: Subnetwork which the current user has
  24029. // compute.subnetworks.use permission on.
  24030. type UsableSubnetwork struct {
  24031. // IpCidrRange: The range of internal addresses that are owned by this
  24032. // subnetwork.
  24033. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24034. // Network: Network URL.
  24035. Network string `json:"network,omitempty"`
  24036. // SecondaryIpRanges: Secondary IP ranges.
  24037. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  24038. // Subnetwork: Subnetwork URL.
  24039. Subnetwork string `json:"subnetwork,omitempty"`
  24040. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  24041. // unconditionally include in API requests. By default, fields with
  24042. // empty values are omitted from API requests. However, any non-pointer,
  24043. // non-interface field appearing in ForceSendFields will be sent to the
  24044. // server regardless of whether the field is empty or not. This may be
  24045. // used to include empty fields in Patch requests.
  24046. ForceSendFields []string `json:"-"`
  24047. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  24048. // in API requests with the JSON null value. By default, fields with
  24049. // empty values are omitted from API requests. However, any field with
  24050. // an empty value appearing in NullFields will be sent to the server as
  24051. // null. It is an error if a field in this list has a non-empty value.
  24052. // This may be used to include null fields in Patch requests.
  24053. NullFields []string `json:"-"`
  24054. }
  24055. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  24056. type NoMethod UsableSubnetwork
  24057. raw := NoMethod(*s)
  24058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24059. }
  24060. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  24061. // subnetwork.
  24062. type UsableSubnetworkSecondaryRange struct {
  24063. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  24064. // secondary range.
  24065. IpCidrRange string `json:"ipCidrRange,omitempty"`
  24066. // RangeName: The name associated with this subnetwork secondary range,
  24067. // used when adding an alias IP range to a VM instance. The name must be
  24068. // 1-63 characters long, and comply with RFC1035. The name must be
  24069. // unique within the subnetwork.
  24070. RangeName string `json:"rangeName,omitempty"`
  24071. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  24072. // unconditionally include in API requests. By default, fields with
  24073. // empty values are omitted from API requests. However, any non-pointer,
  24074. // non-interface field appearing in ForceSendFields will be sent to the
  24075. // server regardless of whether the field is empty or not. This may be
  24076. // used to include empty fields in Patch requests.
  24077. ForceSendFields []string `json:"-"`
  24078. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  24079. // in API requests with the JSON null value. By default, fields with
  24080. // empty values are omitted from API requests. However, any field with
  24081. // an empty value appearing in NullFields will be sent to the server as
  24082. // null. It is an error if a field in this list has a non-empty value.
  24083. // This may be used to include null fields in Patch requests.
  24084. NullFields []string `json:"-"`
  24085. }
  24086. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  24087. type NoMethod UsableSubnetworkSecondaryRange
  24088. raw := NoMethod(*s)
  24089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24090. }
  24091. type UsableSubnetworksAggregatedList struct {
  24092. // Id: [Output Only] The unique identifier for the resource. This
  24093. // identifier is defined by the server.
  24094. Id string `json:"id,omitempty"`
  24095. // Items: [Output] A list of usable subnetwork URLs.
  24096. Items []*UsableSubnetwork `json:"items,omitempty"`
  24097. // Kind: [Output Only] Type of resource. Always
  24098. // compute#usableSubnetworksAggregatedList for aggregated lists of
  24099. // usable subnetworks.
  24100. Kind string `json:"kind,omitempty"`
  24101. // NextPageToken: [Output Only] This token allows you to get the next
  24102. // page of results for list requests. If the number of results is larger
  24103. // than maxResults, use the nextPageToken as a value for the query
  24104. // parameter pageToken in the next list request. Subsequent list
  24105. // requests will have their own nextPageToken to continue paging through
  24106. // the results.
  24107. NextPageToken string `json:"nextPageToken,omitempty"`
  24108. // SelfLink: [Output Only] Server-defined URL for this resource.
  24109. SelfLink string `json:"selfLink,omitempty"`
  24110. // Warning: [Output Only] Informational warning message.
  24111. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  24112. // ServerResponse contains the HTTP response code and headers from the
  24113. // server.
  24114. googleapi.ServerResponse `json:"-"`
  24115. // ForceSendFields is a list of field names (e.g. "Id") to
  24116. // unconditionally include in API requests. By default, fields with
  24117. // empty values are omitted from API requests. However, any non-pointer,
  24118. // non-interface field appearing in ForceSendFields will be sent to the
  24119. // server regardless of whether the field is empty or not. This may be
  24120. // used to include empty fields in Patch requests.
  24121. ForceSendFields []string `json:"-"`
  24122. // NullFields is a list of field names (e.g. "Id") to include in API
  24123. // requests with the JSON null value. By default, fields with empty
  24124. // values are omitted from API requests. However, any field with an
  24125. // empty value appearing in NullFields will be sent to the server as
  24126. // null. It is an error if a field in this list has a non-empty value.
  24127. // This may be used to include null fields in Patch requests.
  24128. NullFields []string `json:"-"`
  24129. }
  24130. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  24131. type NoMethod UsableSubnetworksAggregatedList
  24132. raw := NoMethod(*s)
  24133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24134. }
  24135. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  24136. // warning message.
  24137. type UsableSubnetworksAggregatedListWarning struct {
  24138. // Code: [Output Only] A warning code, if applicable. For example,
  24139. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24140. // the response.
  24141. //
  24142. // Possible values:
  24143. // "CLEANUP_FAILED"
  24144. // "DEPRECATED_RESOURCE_USED"
  24145. // "DEPRECATED_TYPE_USED"
  24146. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24147. // "EXPERIMENTAL_TYPE_USED"
  24148. // "EXTERNAL_API_WARNING"
  24149. // "FIELD_VALUE_OVERRIDEN"
  24150. // "INJECTED_KERNELS_DEPRECATED"
  24151. // "MISSING_TYPE_DEPENDENCY"
  24152. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24153. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24154. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24155. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24156. // "NEXT_HOP_NOT_RUNNING"
  24157. // "NOT_CRITICAL_ERROR"
  24158. // "NO_RESULTS_ON_PAGE"
  24159. // "REQUIRED_TOS_AGREEMENT"
  24160. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24161. // "RESOURCE_NOT_DELETED"
  24162. // "SCHEMA_VALIDATION_IGNORED"
  24163. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24164. // "UNDECLARED_PROPERTIES"
  24165. // "UNREACHABLE"
  24166. Code string `json:"code,omitempty"`
  24167. // Data: [Output Only] Metadata about this warning in key: value format.
  24168. // For example:
  24169. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24170. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  24171. // Message: [Output Only] A human-readable description of the warning
  24172. // code.
  24173. Message string `json:"message,omitempty"`
  24174. // ForceSendFields is a list of field names (e.g. "Code") to
  24175. // unconditionally include in API requests. By default, fields with
  24176. // empty values are omitted from API requests. However, any non-pointer,
  24177. // non-interface field appearing in ForceSendFields will be sent to the
  24178. // server regardless of whether the field is empty or not. This may be
  24179. // used to include empty fields in Patch requests.
  24180. ForceSendFields []string `json:"-"`
  24181. // NullFields is a list of field names (e.g. "Code") to include in API
  24182. // requests with the JSON null value. By default, fields with empty
  24183. // values are omitted from API requests. However, any field with an
  24184. // empty value appearing in NullFields will be sent to the server as
  24185. // null. It is an error if a field in this list has a non-empty value.
  24186. // This may be used to include null fields in Patch requests.
  24187. NullFields []string `json:"-"`
  24188. }
  24189. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  24190. type NoMethod UsableSubnetworksAggregatedListWarning
  24191. raw := NoMethod(*s)
  24192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24193. }
  24194. type UsableSubnetworksAggregatedListWarningData struct {
  24195. // Key: [Output Only] A key that provides more detail on the warning
  24196. // being returned. For example, for warnings where there are no results
  24197. // in a list request for a particular zone, this key might be scope and
  24198. // the key value might be the zone name. Other examples might be a key
  24199. // indicating a deprecated resource and a suggested replacement, or a
  24200. // warning about invalid network settings (for example, if an instance
  24201. // attempts to perform IP forwarding but is not enabled for IP
  24202. // forwarding).
  24203. Key string `json:"key,omitempty"`
  24204. // Value: [Output Only] A warning data value corresponding to the key.
  24205. Value string `json:"value,omitempty"`
  24206. // ForceSendFields is a list of field names (e.g. "Key") to
  24207. // unconditionally include in API requests. By default, fields with
  24208. // empty values are omitted from API requests. However, any non-pointer,
  24209. // non-interface field appearing in ForceSendFields will be sent to the
  24210. // server regardless of whether the field is empty or not. This may be
  24211. // used to include empty fields in Patch requests.
  24212. ForceSendFields []string `json:"-"`
  24213. // NullFields is a list of field names (e.g. "Key") to include in API
  24214. // requests with the JSON null value. By default, fields with empty
  24215. // values are omitted from API requests. However, any field with an
  24216. // empty value appearing in NullFields will be sent to the server as
  24217. // null. It is an error if a field in this list has a non-empty value.
  24218. // This may be used to include null fields in Patch requests.
  24219. NullFields []string `json:"-"`
  24220. }
  24221. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  24222. type NoMethod UsableSubnetworksAggregatedListWarningData
  24223. raw := NoMethod(*s)
  24224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24225. }
  24226. // UsageExportLocation: The location in Cloud Storage and naming method
  24227. // of the daily usage report. Contains bucket_name and report_name
  24228. // prefix.
  24229. type UsageExportLocation struct {
  24230. // BucketName: The name of an existing bucket in Cloud Storage where the
  24231. // usage report object is stored. The Google Service Account is granted
  24232. // write access to this bucket. This can either be the bucket name by
  24233. // itself, such as example-bucket, or the bucket name with gs:// or
  24234. // https://storage.googleapis.com/ in front of it, such as
  24235. // gs://example-bucket.
  24236. BucketName string `json:"bucketName,omitempty"`
  24237. // ReportNamePrefix: An optional prefix for the name of the usage report
  24238. // object stored in bucketName. If not supplied, defaults to usage. The
  24239. // report is stored as a CSV file named
  24240. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  24241. // usage according to Pacific Time. If you supply a prefix, it should
  24242. // conform to Cloud Storage object naming conventions.
  24243. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  24244. // ForceSendFields is a list of field names (e.g. "BucketName") to
  24245. // unconditionally include in API requests. By default, fields with
  24246. // empty values are omitted from API requests. However, any non-pointer,
  24247. // non-interface field appearing in ForceSendFields will be sent to the
  24248. // server regardless of whether the field is empty or not. This may be
  24249. // used to include empty fields in Patch requests.
  24250. ForceSendFields []string `json:"-"`
  24251. // NullFields is a list of field names (e.g. "BucketName") to include in
  24252. // API requests with the JSON null value. By default, fields with empty
  24253. // values are omitted from API requests. However, any field with an
  24254. // empty value appearing in NullFields will be sent to the server as
  24255. // null. It is an error if a field in this list has a non-empty value.
  24256. // This may be used to include null fields in Patch requests.
  24257. NullFields []string `json:"-"`
  24258. }
  24259. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  24260. type NoMethod UsageExportLocation
  24261. raw := NoMethod(*s)
  24262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24263. }
  24264. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  24265. // endpoint (i.e., NIC).
  24266. type VmEndpointNatMappings struct {
  24267. // InstanceName: Name of the VM instance which the endpoint belongs to
  24268. InstanceName string `json:"instanceName,omitempty"`
  24269. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  24270. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  24271. // unconditionally include in API requests. By default, fields with
  24272. // empty values are omitted from API requests. However, any non-pointer,
  24273. // non-interface field appearing in ForceSendFields will be sent to the
  24274. // server regardless of whether the field is empty or not. This may be
  24275. // used to include empty fields in Patch requests.
  24276. ForceSendFields []string `json:"-"`
  24277. // NullFields is a list of field names (e.g. "InstanceName") to include
  24278. // in API requests with the JSON null value. By default, fields with
  24279. // empty values are omitted from API requests. However, any field with
  24280. // an empty value appearing in NullFields will be sent to the server as
  24281. // null. It is an error if a field in this list has a non-empty value.
  24282. // This may be used to include null fields in Patch requests.
  24283. NullFields []string `json:"-"`
  24284. }
  24285. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  24286. type NoMethod VmEndpointNatMappings
  24287. raw := NoMethod(*s)
  24288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24289. }
  24290. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  24291. // mapping for an interface of this endpoint.
  24292. type VmEndpointNatMappingsInterfaceNatMappings struct {
  24293. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  24294. // this interface. These ranges are inclusive, that is, both the first
  24295. // and the last ports can be used for NAT. Example:
  24296. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  24297. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  24298. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  24299. // to this interface. It equals to the aggregated port number in the
  24300. // field nat_ip_port_ranges.
  24301. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  24302. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  24303. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  24304. // "192.168.5.0/24".
  24305. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  24306. // SourceVirtualIp: Primary IP of the VM for this NIC.
  24307. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  24308. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  24309. // unconditionally include in API requests. By default, fields with
  24310. // empty values are omitted from API requests. However, any non-pointer,
  24311. // non-interface field appearing in ForceSendFields will be sent to the
  24312. // server regardless of whether the field is empty or not. This may be
  24313. // used to include empty fields in Patch requests.
  24314. ForceSendFields []string `json:"-"`
  24315. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  24316. // include in API requests with the JSON null value. By default, fields
  24317. // with empty values are omitted from API requests. However, any field
  24318. // with an empty value appearing in NullFields will be sent to the
  24319. // server as null. It is an error if a field in this list has a
  24320. // non-empty value. This may be used to include null fields in Patch
  24321. // requests.
  24322. NullFields []string `json:"-"`
  24323. }
  24324. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  24325. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  24326. raw := NoMethod(*s)
  24327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24328. }
  24329. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  24330. type VmEndpointNatMappingsList struct {
  24331. // Id: [Output Only] The unique identifier for the resource. This
  24332. // identifier is defined by the server.
  24333. Id string `json:"id,omitempty"`
  24334. // Kind: [Output Only] Type of resource. Always
  24335. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  24336. // endpoints.
  24337. Kind string `json:"kind,omitempty"`
  24338. // NextPageToken: [Output Only] This token allows you to get the next
  24339. // page of results for list requests. If the number of results is larger
  24340. // than maxResults, use the nextPageToken as a value for the query
  24341. // parameter pageToken in the next list request. Subsequent list
  24342. // requests will have their own nextPageToken to continue paging through
  24343. // the results.
  24344. NextPageToken string `json:"nextPageToken,omitempty"`
  24345. // Result: [Output Only] A list of Nat mapping information of VM
  24346. // endpoints.
  24347. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  24348. // SelfLink: [Output Only] Server-defined URL for this resource.
  24349. SelfLink string `json:"selfLink,omitempty"`
  24350. // Warning: [Output Only] Informational warning message.
  24351. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  24352. // ServerResponse contains the HTTP response code and headers from the
  24353. // server.
  24354. googleapi.ServerResponse `json:"-"`
  24355. // ForceSendFields is a list of field names (e.g. "Id") to
  24356. // unconditionally include in API requests. By default, fields with
  24357. // empty values are omitted from API requests. However, any non-pointer,
  24358. // non-interface field appearing in ForceSendFields will be sent to the
  24359. // server regardless of whether the field is empty or not. This may be
  24360. // used to include empty fields in Patch requests.
  24361. ForceSendFields []string `json:"-"`
  24362. // NullFields is a list of field names (e.g. "Id") to include in API
  24363. // requests with the JSON null value. By default, fields with empty
  24364. // values are omitted from API requests. However, any field with an
  24365. // empty value appearing in NullFields will be sent to the server as
  24366. // null. It is an error if a field in this list has a non-empty value.
  24367. // This may be used to include null fields in Patch requests.
  24368. NullFields []string `json:"-"`
  24369. }
  24370. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  24371. type NoMethod VmEndpointNatMappingsList
  24372. raw := NoMethod(*s)
  24373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24374. }
  24375. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  24376. // message.
  24377. type VmEndpointNatMappingsListWarning struct {
  24378. // Code: [Output Only] A warning code, if applicable. For example,
  24379. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24380. // the response.
  24381. //
  24382. // Possible values:
  24383. // "CLEANUP_FAILED"
  24384. // "DEPRECATED_RESOURCE_USED"
  24385. // "DEPRECATED_TYPE_USED"
  24386. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24387. // "EXPERIMENTAL_TYPE_USED"
  24388. // "EXTERNAL_API_WARNING"
  24389. // "FIELD_VALUE_OVERRIDEN"
  24390. // "INJECTED_KERNELS_DEPRECATED"
  24391. // "MISSING_TYPE_DEPENDENCY"
  24392. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24393. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24394. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24395. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24396. // "NEXT_HOP_NOT_RUNNING"
  24397. // "NOT_CRITICAL_ERROR"
  24398. // "NO_RESULTS_ON_PAGE"
  24399. // "REQUIRED_TOS_AGREEMENT"
  24400. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24401. // "RESOURCE_NOT_DELETED"
  24402. // "SCHEMA_VALIDATION_IGNORED"
  24403. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24404. // "UNDECLARED_PROPERTIES"
  24405. // "UNREACHABLE"
  24406. Code string `json:"code,omitempty"`
  24407. // Data: [Output Only] Metadata about this warning in key: value format.
  24408. // For example:
  24409. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24410. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  24411. // Message: [Output Only] A human-readable description of the warning
  24412. // code.
  24413. Message string `json:"message,omitempty"`
  24414. // ForceSendFields is a list of field names (e.g. "Code") to
  24415. // unconditionally include in API requests. By default, fields with
  24416. // empty values are omitted from API requests. However, any non-pointer,
  24417. // non-interface field appearing in ForceSendFields will be sent to the
  24418. // server regardless of whether the field is empty or not. This may be
  24419. // used to include empty fields in Patch requests.
  24420. ForceSendFields []string `json:"-"`
  24421. // NullFields is a list of field names (e.g. "Code") to include in API
  24422. // requests with the JSON null value. By default, fields with empty
  24423. // values are omitted from API requests. However, any field with an
  24424. // empty value appearing in NullFields will be sent to the server as
  24425. // null. It is an error if a field in this list has a non-empty value.
  24426. // This may be used to include null fields in Patch requests.
  24427. NullFields []string `json:"-"`
  24428. }
  24429. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  24430. type NoMethod VmEndpointNatMappingsListWarning
  24431. raw := NoMethod(*s)
  24432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24433. }
  24434. type VmEndpointNatMappingsListWarningData struct {
  24435. // Key: [Output Only] A key that provides more detail on the warning
  24436. // being returned. For example, for warnings where there are no results
  24437. // in a list request for a particular zone, this key might be scope and
  24438. // the key value might be the zone name. Other examples might be a key
  24439. // indicating a deprecated resource and a suggested replacement, or a
  24440. // warning about invalid network settings (for example, if an instance
  24441. // attempts to perform IP forwarding but is not enabled for IP
  24442. // forwarding).
  24443. Key string `json:"key,omitempty"`
  24444. // Value: [Output Only] A warning data value corresponding to the key.
  24445. Value string `json:"value,omitempty"`
  24446. // ForceSendFields is a list of field names (e.g. "Key") to
  24447. // unconditionally include in API requests. By default, fields with
  24448. // empty values are omitted from API requests. However, any non-pointer,
  24449. // non-interface field appearing in ForceSendFields will be sent to the
  24450. // server regardless of whether the field is empty or not. This may be
  24451. // used to include empty fields in Patch requests.
  24452. ForceSendFields []string `json:"-"`
  24453. // NullFields is a list of field names (e.g. "Key") to include in API
  24454. // requests with the JSON null value. By default, fields with empty
  24455. // values are omitted from API requests. However, any field with an
  24456. // empty value appearing in NullFields will be sent to the server as
  24457. // null. It is an error if a field in this list has a non-empty value.
  24458. // This may be used to include null fields in Patch requests.
  24459. NullFields []string `json:"-"`
  24460. }
  24461. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  24462. type NoMethod VmEndpointNatMappingsListWarningData
  24463. raw := NoMethod(*s)
  24464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24465. }
  24466. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  24467. // (== resource_for v1.vpnTunnels ==)
  24468. type VpnTunnel struct {
  24469. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24470. // format.
  24471. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24472. // Description: An optional description of this resource. Provide this
  24473. // property when you create the resource.
  24474. Description string `json:"description,omitempty"`
  24475. // DetailedStatus: [Output Only] Detailed status message for the VPN
  24476. // tunnel.
  24477. DetailedStatus string `json:"detailedStatus,omitempty"`
  24478. // Id: [Output Only] The unique identifier for the resource. This
  24479. // identifier is defined by the server.
  24480. Id uint64 `json:"id,omitempty,string"`
  24481. // IkeVersion: IKE protocol version to use when establishing the VPN
  24482. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  24483. // Default version is 2.
  24484. IkeVersion int64 `json:"ikeVersion,omitempty"`
  24485. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  24486. // VPN tunnels.
  24487. Kind string `json:"kind,omitempty"`
  24488. // LocalTrafficSelector: Local traffic selector to use when establishing
  24489. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  24490. // formatted string, for example: 192.168.0.0/16. The ranges should be
  24491. // disjoint. Only IPv4 is supported.
  24492. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  24493. // Name: Name of the resource. Provided by the client when the resource
  24494. // is created. The name must be 1-63 characters long, and comply with
  24495. // RFC1035. Specifically, the name must be 1-63 characters long and
  24496. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24497. // the first character must be a lowercase letter, and all following
  24498. // characters must be a dash, lowercase letter, or digit, except the
  24499. // last character, which cannot be a dash.
  24500. Name string `json:"name,omitempty"`
  24501. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  24502. PeerIp string `json:"peerIp,omitempty"`
  24503. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  24504. // You must specify this field as part of the HTTP request URL. It is
  24505. // not settable as a field in the request body.
  24506. Region string `json:"region,omitempty"`
  24507. // RemoteTrafficSelector: Remote traffic selectors to use when
  24508. // establishing the VPN tunnel with peer VPN gateway. The value should
  24509. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  24510. // should be disjoint. Only IPv4 is supported.
  24511. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  24512. // Router: URL of router resource to be used for dynamic routing.
  24513. Router string `json:"router,omitempty"`
  24514. // SelfLink: [Output Only] Server-defined URL for the resource.
  24515. SelfLink string `json:"selfLink,omitempty"`
  24516. // SharedSecret: Shared secret used to set the secure session between
  24517. // the Cloud VPN gateway and the peer VPN gateway.
  24518. SharedSecret string `json:"sharedSecret,omitempty"`
  24519. // SharedSecretHash: Hash of the shared secret.
  24520. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  24521. // Status: [Output Only] The status of the VPN tunnel.
  24522. //
  24523. // Possible values:
  24524. // "ALLOCATING_RESOURCES"
  24525. // "AUTHORIZATION_ERROR"
  24526. // "DEPROVISIONING"
  24527. // "ESTABLISHED"
  24528. // "FAILED"
  24529. // "FIRST_HANDSHAKE"
  24530. // "NEGOTIATION_FAILURE"
  24531. // "NETWORK_ERROR"
  24532. // "NO_INCOMING_PACKETS"
  24533. // "PROVISIONING"
  24534. // "REJECTED"
  24535. // "WAITING_FOR_FULL_CONFIG"
  24536. Status string `json:"status,omitempty"`
  24537. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  24538. // tunnel is associated. Provided by the client when the VPN tunnel is
  24539. // created.
  24540. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  24541. // ServerResponse contains the HTTP response code and headers from the
  24542. // server.
  24543. googleapi.ServerResponse `json:"-"`
  24544. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24545. // to unconditionally include in API requests. By default, fields with
  24546. // empty values are omitted from API requests. However, any non-pointer,
  24547. // non-interface field appearing in ForceSendFields will be sent to the
  24548. // server regardless of whether the field is empty or not. This may be
  24549. // used to include empty fields in Patch requests.
  24550. ForceSendFields []string `json:"-"`
  24551. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24552. // include in API requests with the JSON null value. By default, fields
  24553. // with empty values are omitted from API requests. However, any field
  24554. // with an empty value appearing in NullFields will be sent to the
  24555. // server as null. It is an error if a field in this list has a
  24556. // non-empty value. This may be used to include null fields in Patch
  24557. // requests.
  24558. NullFields []string `json:"-"`
  24559. }
  24560. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  24561. type NoMethod VpnTunnel
  24562. raw := NoMethod(*s)
  24563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24564. }
  24565. type VpnTunnelAggregatedList struct {
  24566. // Id: [Output Only] Unique identifier for the resource; defined by the
  24567. // server.
  24568. Id string `json:"id,omitempty"`
  24569. // Items: A list of VpnTunnelsScopedList resources.
  24570. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  24571. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  24572. // VPN tunnels.
  24573. Kind string `json:"kind,omitempty"`
  24574. // NextPageToken: [Output Only] This token allows you to get the next
  24575. // page of results for list requests. If the number of results is larger
  24576. // than maxResults, use the nextPageToken as a value for the query
  24577. // parameter pageToken in the next list request. Subsequent list
  24578. // requests will have their own nextPageToken to continue paging through
  24579. // the results.
  24580. NextPageToken string `json:"nextPageToken,omitempty"`
  24581. // SelfLink: [Output Only] Server-defined URL for this resource.
  24582. SelfLink string `json:"selfLink,omitempty"`
  24583. // Warning: [Output Only] Informational warning message.
  24584. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  24585. // ServerResponse contains the HTTP response code and headers from the
  24586. // server.
  24587. googleapi.ServerResponse `json:"-"`
  24588. // ForceSendFields is a list of field names (e.g. "Id") to
  24589. // unconditionally include in API requests. By default, fields with
  24590. // empty values are omitted from API requests. However, any non-pointer,
  24591. // non-interface field appearing in ForceSendFields will be sent to the
  24592. // server regardless of whether the field is empty or not. This may be
  24593. // used to include empty fields in Patch requests.
  24594. ForceSendFields []string `json:"-"`
  24595. // NullFields is a list of field names (e.g. "Id") to include in API
  24596. // requests with the JSON null value. By default, fields with empty
  24597. // values are omitted from API requests. However, any field with an
  24598. // empty value appearing in NullFields will be sent to the server as
  24599. // null. It is an error if a field in this list has a non-empty value.
  24600. // This may be used to include null fields in Patch requests.
  24601. NullFields []string `json:"-"`
  24602. }
  24603. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  24604. type NoMethod VpnTunnelAggregatedList
  24605. raw := NoMethod(*s)
  24606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24607. }
  24608. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  24609. // message.
  24610. type VpnTunnelAggregatedListWarning struct {
  24611. // Code: [Output Only] A warning code, if applicable. For example,
  24612. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24613. // the response.
  24614. //
  24615. // Possible values:
  24616. // "CLEANUP_FAILED"
  24617. // "DEPRECATED_RESOURCE_USED"
  24618. // "DEPRECATED_TYPE_USED"
  24619. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24620. // "EXPERIMENTAL_TYPE_USED"
  24621. // "EXTERNAL_API_WARNING"
  24622. // "FIELD_VALUE_OVERRIDEN"
  24623. // "INJECTED_KERNELS_DEPRECATED"
  24624. // "MISSING_TYPE_DEPENDENCY"
  24625. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24626. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24627. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24628. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24629. // "NEXT_HOP_NOT_RUNNING"
  24630. // "NOT_CRITICAL_ERROR"
  24631. // "NO_RESULTS_ON_PAGE"
  24632. // "REQUIRED_TOS_AGREEMENT"
  24633. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24634. // "RESOURCE_NOT_DELETED"
  24635. // "SCHEMA_VALIDATION_IGNORED"
  24636. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24637. // "UNDECLARED_PROPERTIES"
  24638. // "UNREACHABLE"
  24639. Code string `json:"code,omitempty"`
  24640. // Data: [Output Only] Metadata about this warning in key: value format.
  24641. // For example:
  24642. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24643. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  24644. // Message: [Output Only] A human-readable description of the warning
  24645. // code.
  24646. Message string `json:"message,omitempty"`
  24647. // ForceSendFields is a list of field names (e.g. "Code") to
  24648. // unconditionally include in API requests. By default, fields with
  24649. // empty values are omitted from API requests. However, any non-pointer,
  24650. // non-interface field appearing in ForceSendFields will be sent to the
  24651. // server regardless of whether the field is empty or not. This may be
  24652. // used to include empty fields in Patch requests.
  24653. ForceSendFields []string `json:"-"`
  24654. // NullFields is a list of field names (e.g. "Code") to include in API
  24655. // requests with the JSON null value. By default, fields with empty
  24656. // values are omitted from API requests. However, any field with an
  24657. // empty value appearing in NullFields will be sent to the server as
  24658. // null. It is an error if a field in this list has a non-empty value.
  24659. // This may be used to include null fields in Patch requests.
  24660. NullFields []string `json:"-"`
  24661. }
  24662. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  24663. type NoMethod VpnTunnelAggregatedListWarning
  24664. raw := NoMethod(*s)
  24665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24666. }
  24667. type VpnTunnelAggregatedListWarningData struct {
  24668. // Key: [Output Only] A key that provides more detail on the warning
  24669. // being returned. For example, for warnings where there are no results
  24670. // in a list request for a particular zone, this key might be scope and
  24671. // the key value might be the zone name. Other examples might be a key
  24672. // indicating a deprecated resource and a suggested replacement, or a
  24673. // warning about invalid network settings (for example, if an instance
  24674. // attempts to perform IP forwarding but is not enabled for IP
  24675. // forwarding).
  24676. Key string `json:"key,omitempty"`
  24677. // Value: [Output Only] A warning data value corresponding to the key.
  24678. Value string `json:"value,omitempty"`
  24679. // ForceSendFields is a list of field names (e.g. "Key") to
  24680. // unconditionally include in API requests. By default, fields with
  24681. // empty values are omitted from API requests. However, any non-pointer,
  24682. // non-interface field appearing in ForceSendFields will be sent to the
  24683. // server regardless of whether the field is empty or not. This may be
  24684. // used to include empty fields in Patch requests.
  24685. ForceSendFields []string `json:"-"`
  24686. // NullFields is a list of field names (e.g. "Key") to include in API
  24687. // requests with the JSON null value. By default, fields with empty
  24688. // values are omitted from API requests. However, any field with an
  24689. // empty value appearing in NullFields will be sent to the server as
  24690. // null. It is an error if a field in this list has a non-empty value.
  24691. // This may be used to include null fields in Patch requests.
  24692. NullFields []string `json:"-"`
  24693. }
  24694. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  24695. type NoMethod VpnTunnelAggregatedListWarningData
  24696. raw := NoMethod(*s)
  24697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24698. }
  24699. // VpnTunnelList: Contains a list of VpnTunnel resources.
  24700. type VpnTunnelList struct {
  24701. // Id: [Output Only] Unique identifier for the resource; defined by the
  24702. // server.
  24703. Id string `json:"id,omitempty"`
  24704. // Items: A list of VpnTunnel resources.
  24705. Items []*VpnTunnel `json:"items,omitempty"`
  24706. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  24707. // VPN tunnels.
  24708. Kind string `json:"kind,omitempty"`
  24709. // NextPageToken: [Output Only] This token allows you to get the next
  24710. // page of results for list requests. If the number of results is larger
  24711. // than maxResults, use the nextPageToken as a value for the query
  24712. // parameter pageToken in the next list request. Subsequent list
  24713. // requests will have their own nextPageToken to continue paging through
  24714. // the results.
  24715. NextPageToken string `json:"nextPageToken,omitempty"`
  24716. // SelfLink: [Output Only] Server-defined URL for this resource.
  24717. SelfLink string `json:"selfLink,omitempty"`
  24718. // Warning: [Output Only] Informational warning message.
  24719. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  24720. // ServerResponse contains the HTTP response code and headers from the
  24721. // server.
  24722. googleapi.ServerResponse `json:"-"`
  24723. // ForceSendFields is a list of field names (e.g. "Id") to
  24724. // unconditionally include in API requests. By default, fields with
  24725. // empty values are omitted from API requests. However, any non-pointer,
  24726. // non-interface field appearing in ForceSendFields will be sent to the
  24727. // server regardless of whether the field is empty or not. This may be
  24728. // used to include empty fields in Patch requests.
  24729. ForceSendFields []string `json:"-"`
  24730. // NullFields is a list of field names (e.g. "Id") to include in API
  24731. // requests with the JSON null value. By default, fields with empty
  24732. // values are omitted from API requests. However, any field with an
  24733. // empty value appearing in NullFields will be sent to the server as
  24734. // null. It is an error if a field in this list has a non-empty value.
  24735. // This may be used to include null fields in Patch requests.
  24736. NullFields []string `json:"-"`
  24737. }
  24738. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  24739. type NoMethod VpnTunnelList
  24740. raw := NoMethod(*s)
  24741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24742. }
  24743. // VpnTunnelListWarning: [Output Only] Informational warning message.
  24744. type VpnTunnelListWarning struct {
  24745. // Code: [Output Only] A warning code, if applicable. For example,
  24746. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24747. // the response.
  24748. //
  24749. // Possible values:
  24750. // "CLEANUP_FAILED"
  24751. // "DEPRECATED_RESOURCE_USED"
  24752. // "DEPRECATED_TYPE_USED"
  24753. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24754. // "EXPERIMENTAL_TYPE_USED"
  24755. // "EXTERNAL_API_WARNING"
  24756. // "FIELD_VALUE_OVERRIDEN"
  24757. // "INJECTED_KERNELS_DEPRECATED"
  24758. // "MISSING_TYPE_DEPENDENCY"
  24759. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24760. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24761. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24762. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24763. // "NEXT_HOP_NOT_RUNNING"
  24764. // "NOT_CRITICAL_ERROR"
  24765. // "NO_RESULTS_ON_PAGE"
  24766. // "REQUIRED_TOS_AGREEMENT"
  24767. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24768. // "RESOURCE_NOT_DELETED"
  24769. // "SCHEMA_VALIDATION_IGNORED"
  24770. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24771. // "UNDECLARED_PROPERTIES"
  24772. // "UNREACHABLE"
  24773. Code string `json:"code,omitempty"`
  24774. // Data: [Output Only] Metadata about this warning in key: value format.
  24775. // For example:
  24776. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24777. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  24778. // Message: [Output Only] A human-readable description of the warning
  24779. // code.
  24780. Message string `json:"message,omitempty"`
  24781. // ForceSendFields is a list of field names (e.g. "Code") to
  24782. // unconditionally include in API requests. By default, fields with
  24783. // empty values are omitted from API requests. However, any non-pointer,
  24784. // non-interface field appearing in ForceSendFields will be sent to the
  24785. // server regardless of whether the field is empty or not. This may be
  24786. // used to include empty fields in Patch requests.
  24787. ForceSendFields []string `json:"-"`
  24788. // NullFields is a list of field names (e.g. "Code") to include in API
  24789. // requests with the JSON null value. By default, fields with empty
  24790. // values are omitted from API requests. However, any field with an
  24791. // empty value appearing in NullFields will be sent to the server as
  24792. // null. It is an error if a field in this list has a non-empty value.
  24793. // This may be used to include null fields in Patch requests.
  24794. NullFields []string `json:"-"`
  24795. }
  24796. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  24797. type NoMethod VpnTunnelListWarning
  24798. raw := NoMethod(*s)
  24799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24800. }
  24801. type VpnTunnelListWarningData struct {
  24802. // Key: [Output Only] A key that provides more detail on the warning
  24803. // being returned. For example, for warnings where there are no results
  24804. // in a list request for a particular zone, this key might be scope and
  24805. // the key value might be the zone name. Other examples might be a key
  24806. // indicating a deprecated resource and a suggested replacement, or a
  24807. // warning about invalid network settings (for example, if an instance
  24808. // attempts to perform IP forwarding but is not enabled for IP
  24809. // forwarding).
  24810. Key string `json:"key,omitempty"`
  24811. // Value: [Output Only] A warning data value corresponding to the key.
  24812. Value string `json:"value,omitempty"`
  24813. // ForceSendFields is a list of field names (e.g. "Key") to
  24814. // unconditionally include in API requests. By default, fields with
  24815. // empty values are omitted from API requests. However, any non-pointer,
  24816. // non-interface field appearing in ForceSendFields will be sent to the
  24817. // server regardless of whether the field is empty or not. This may be
  24818. // used to include empty fields in Patch requests.
  24819. ForceSendFields []string `json:"-"`
  24820. // NullFields is a list of field names (e.g. "Key") to include in API
  24821. // requests with the JSON null value. By default, fields with empty
  24822. // values are omitted from API requests. However, any field with an
  24823. // empty value appearing in NullFields will be sent to the server as
  24824. // null. It is an error if a field in this list has a non-empty value.
  24825. // This may be used to include null fields in Patch requests.
  24826. NullFields []string `json:"-"`
  24827. }
  24828. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  24829. type NoMethod VpnTunnelListWarningData
  24830. raw := NoMethod(*s)
  24831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24832. }
  24833. type VpnTunnelsScopedList struct {
  24834. // VpnTunnels: A list of vpn tunnels contained in this scope.
  24835. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  24836. // Warning: Informational warning which replaces the list of addresses
  24837. // when the list is empty.
  24838. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  24839. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  24840. // unconditionally include in API requests. By default, fields with
  24841. // empty values are omitted from API requests. However, any non-pointer,
  24842. // non-interface field appearing in ForceSendFields will be sent to the
  24843. // server regardless of whether the field is empty or not. This may be
  24844. // used to include empty fields in Patch requests.
  24845. ForceSendFields []string `json:"-"`
  24846. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  24847. // API requests with the JSON null value. By default, fields with empty
  24848. // values are omitted from API requests. However, any field with an
  24849. // empty value appearing in NullFields will be sent to the server as
  24850. // null. It is an error if a field in this list has a non-empty value.
  24851. // This may be used to include null fields in Patch requests.
  24852. NullFields []string `json:"-"`
  24853. }
  24854. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  24855. type NoMethod VpnTunnelsScopedList
  24856. raw := NoMethod(*s)
  24857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24858. }
  24859. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  24860. // list of addresses when the list is empty.
  24861. type VpnTunnelsScopedListWarning struct {
  24862. // Code: [Output Only] A warning code, if applicable. For example,
  24863. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24864. // the response.
  24865. //
  24866. // Possible values:
  24867. // "CLEANUP_FAILED"
  24868. // "DEPRECATED_RESOURCE_USED"
  24869. // "DEPRECATED_TYPE_USED"
  24870. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24871. // "EXPERIMENTAL_TYPE_USED"
  24872. // "EXTERNAL_API_WARNING"
  24873. // "FIELD_VALUE_OVERRIDEN"
  24874. // "INJECTED_KERNELS_DEPRECATED"
  24875. // "MISSING_TYPE_DEPENDENCY"
  24876. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24877. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24878. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24879. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24880. // "NEXT_HOP_NOT_RUNNING"
  24881. // "NOT_CRITICAL_ERROR"
  24882. // "NO_RESULTS_ON_PAGE"
  24883. // "REQUIRED_TOS_AGREEMENT"
  24884. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24885. // "RESOURCE_NOT_DELETED"
  24886. // "SCHEMA_VALIDATION_IGNORED"
  24887. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24888. // "UNDECLARED_PROPERTIES"
  24889. // "UNREACHABLE"
  24890. Code string `json:"code,omitempty"`
  24891. // Data: [Output Only] Metadata about this warning in key: value format.
  24892. // For example:
  24893. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24894. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  24895. // Message: [Output Only] A human-readable description of the warning
  24896. // code.
  24897. Message string `json:"message,omitempty"`
  24898. // ForceSendFields is a list of field names (e.g. "Code") to
  24899. // unconditionally include in API requests. By default, fields with
  24900. // empty values are omitted from API requests. However, any non-pointer,
  24901. // non-interface field appearing in ForceSendFields will be sent to the
  24902. // server regardless of whether the field is empty or not. This may be
  24903. // used to include empty fields in Patch requests.
  24904. ForceSendFields []string `json:"-"`
  24905. // NullFields is a list of field names (e.g. "Code") to include in API
  24906. // requests with the JSON null value. By default, fields with empty
  24907. // values are omitted from API requests. However, any field with an
  24908. // empty value appearing in NullFields will be sent to the server as
  24909. // null. It is an error if a field in this list has a non-empty value.
  24910. // This may be used to include null fields in Patch requests.
  24911. NullFields []string `json:"-"`
  24912. }
  24913. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  24914. type NoMethod VpnTunnelsScopedListWarning
  24915. raw := NoMethod(*s)
  24916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24917. }
  24918. type VpnTunnelsScopedListWarningData struct {
  24919. // Key: [Output Only] A key that provides more detail on the warning
  24920. // being returned. For example, for warnings where there are no results
  24921. // in a list request for a particular zone, this key might be scope and
  24922. // the key value might be the zone name. Other examples might be a key
  24923. // indicating a deprecated resource and a suggested replacement, or a
  24924. // warning about invalid network settings (for example, if an instance
  24925. // attempts to perform IP forwarding but is not enabled for IP
  24926. // forwarding).
  24927. Key string `json:"key,omitempty"`
  24928. // Value: [Output Only] A warning data value corresponding to the key.
  24929. Value string `json:"value,omitempty"`
  24930. // ForceSendFields is a list of field names (e.g. "Key") to
  24931. // unconditionally include in API requests. By default, fields with
  24932. // empty values are omitted from API requests. However, any non-pointer,
  24933. // non-interface field appearing in ForceSendFields will be sent to the
  24934. // server regardless of whether the field is empty or not. This may be
  24935. // used to include empty fields in Patch requests.
  24936. ForceSendFields []string `json:"-"`
  24937. // NullFields is a list of field names (e.g. "Key") to include in API
  24938. // requests with the JSON null value. By default, fields with empty
  24939. // values are omitted from API requests. However, any field with an
  24940. // empty value appearing in NullFields will be sent to the server as
  24941. // null. It is an error if a field in this list has a non-empty value.
  24942. // This may be used to include null fields in Patch requests.
  24943. NullFields []string `json:"-"`
  24944. }
  24945. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  24946. type NoMethod VpnTunnelsScopedListWarningData
  24947. raw := NoMethod(*s)
  24948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24949. }
  24950. type XpnHostList struct {
  24951. // Id: [Output Only] Unique identifier for the resource; defined by the
  24952. // server.
  24953. Id string `json:"id,omitempty"`
  24954. // Items: [Output Only] A list of shared VPC host project URLs.
  24955. Items []*Project `json:"items,omitempty"`
  24956. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  24957. // lists of shared VPC hosts.
  24958. Kind string `json:"kind,omitempty"`
  24959. // NextPageToken: [Output Only] This token allows you to get the next
  24960. // page of results for list requests. If the number of results is larger
  24961. // than maxResults, use the nextPageToken as a value for the query
  24962. // parameter pageToken in the next list request. Subsequent list
  24963. // requests will have their own nextPageToken to continue paging through
  24964. // the results.
  24965. NextPageToken string `json:"nextPageToken,omitempty"`
  24966. // SelfLink: [Output Only] Server-defined URL for this resource.
  24967. SelfLink string `json:"selfLink,omitempty"`
  24968. // Warning: [Output Only] Informational warning message.
  24969. Warning *XpnHostListWarning `json:"warning,omitempty"`
  24970. // ServerResponse contains the HTTP response code and headers from the
  24971. // server.
  24972. googleapi.ServerResponse `json:"-"`
  24973. // ForceSendFields is a list of field names (e.g. "Id") to
  24974. // unconditionally include in API requests. By default, fields with
  24975. // empty values are omitted from API requests. However, any non-pointer,
  24976. // non-interface field appearing in ForceSendFields will be sent to the
  24977. // server regardless of whether the field is empty or not. This may be
  24978. // used to include empty fields in Patch requests.
  24979. ForceSendFields []string `json:"-"`
  24980. // NullFields is a list of field names (e.g. "Id") to include in API
  24981. // requests with the JSON null value. By default, fields with empty
  24982. // values are omitted from API requests. However, any field with an
  24983. // empty value appearing in NullFields will be sent to the server as
  24984. // null. It is an error if a field in this list has a non-empty value.
  24985. // This may be used to include null fields in Patch requests.
  24986. NullFields []string `json:"-"`
  24987. }
  24988. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  24989. type NoMethod XpnHostList
  24990. raw := NoMethod(*s)
  24991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24992. }
  24993. // XpnHostListWarning: [Output Only] Informational warning message.
  24994. type XpnHostListWarning struct {
  24995. // Code: [Output Only] A warning code, if applicable. For example,
  24996. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24997. // the response.
  24998. //
  24999. // Possible values:
  25000. // "CLEANUP_FAILED"
  25001. // "DEPRECATED_RESOURCE_USED"
  25002. // "DEPRECATED_TYPE_USED"
  25003. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25004. // "EXPERIMENTAL_TYPE_USED"
  25005. // "EXTERNAL_API_WARNING"
  25006. // "FIELD_VALUE_OVERRIDEN"
  25007. // "INJECTED_KERNELS_DEPRECATED"
  25008. // "MISSING_TYPE_DEPENDENCY"
  25009. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25010. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25011. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25012. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25013. // "NEXT_HOP_NOT_RUNNING"
  25014. // "NOT_CRITICAL_ERROR"
  25015. // "NO_RESULTS_ON_PAGE"
  25016. // "REQUIRED_TOS_AGREEMENT"
  25017. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25018. // "RESOURCE_NOT_DELETED"
  25019. // "SCHEMA_VALIDATION_IGNORED"
  25020. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25021. // "UNDECLARED_PROPERTIES"
  25022. // "UNREACHABLE"
  25023. Code string `json:"code,omitempty"`
  25024. // Data: [Output Only] Metadata about this warning in key: value format.
  25025. // For example:
  25026. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25027. Data []*XpnHostListWarningData `json:"data,omitempty"`
  25028. // Message: [Output Only] A human-readable description of the warning
  25029. // code.
  25030. Message string `json:"message,omitempty"`
  25031. // ForceSendFields is a list of field names (e.g. "Code") to
  25032. // unconditionally include in API requests. By default, fields with
  25033. // empty values are omitted from API requests. However, any non-pointer,
  25034. // non-interface field appearing in ForceSendFields will be sent to the
  25035. // server regardless of whether the field is empty or not. This may be
  25036. // used to include empty fields in Patch requests.
  25037. ForceSendFields []string `json:"-"`
  25038. // NullFields is a list of field names (e.g. "Code") to include in API
  25039. // requests with the JSON null value. By default, fields with empty
  25040. // values are omitted from API requests. However, any field with an
  25041. // empty value appearing in NullFields will be sent to the server as
  25042. // null. It is an error if a field in this list has a non-empty value.
  25043. // This may be used to include null fields in Patch requests.
  25044. NullFields []string `json:"-"`
  25045. }
  25046. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  25047. type NoMethod XpnHostListWarning
  25048. raw := NoMethod(*s)
  25049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25050. }
  25051. type XpnHostListWarningData struct {
  25052. // Key: [Output Only] A key that provides more detail on the warning
  25053. // being returned. For example, for warnings where there are no results
  25054. // in a list request for a particular zone, this key might be scope and
  25055. // the key value might be the zone name. Other examples might be a key
  25056. // indicating a deprecated resource and a suggested replacement, or a
  25057. // warning about invalid network settings (for example, if an instance
  25058. // attempts to perform IP forwarding but is not enabled for IP
  25059. // forwarding).
  25060. Key string `json:"key,omitempty"`
  25061. // Value: [Output Only] A warning data value corresponding to the key.
  25062. Value string `json:"value,omitempty"`
  25063. // ForceSendFields is a list of field names (e.g. "Key") to
  25064. // unconditionally include in API requests. By default, fields with
  25065. // empty values are omitted from API requests. However, any non-pointer,
  25066. // non-interface field appearing in ForceSendFields will be sent to the
  25067. // server regardless of whether the field is empty or not. This may be
  25068. // used to include empty fields in Patch requests.
  25069. ForceSendFields []string `json:"-"`
  25070. // NullFields is a list of field names (e.g. "Key") to include in API
  25071. // requests with the JSON null value. By default, fields with empty
  25072. // values are omitted from API requests. However, any field with an
  25073. // empty value appearing in NullFields will be sent to the server as
  25074. // null. It is an error if a field in this list has a non-empty value.
  25075. // This may be used to include null fields in Patch requests.
  25076. NullFields []string `json:"-"`
  25077. }
  25078. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  25079. type NoMethod XpnHostListWarningData
  25080. raw := NoMethod(*s)
  25081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25082. }
  25083. // XpnResourceId: Service resource (a.k.a service project) ID.
  25084. type XpnResourceId struct {
  25085. // Id: The ID of the service resource. In the case of projects, this
  25086. // field supports project id (e.g., my-project-123) and project number
  25087. // (e.g. 12345678).
  25088. Id string `json:"id,omitempty"`
  25089. // Type: The type of the service resource.
  25090. //
  25091. // Possible values:
  25092. // "PROJECT"
  25093. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  25094. Type string `json:"type,omitempty"`
  25095. // ForceSendFields is a list of field names (e.g. "Id") to
  25096. // unconditionally include in API requests. By default, fields with
  25097. // empty values are omitted from API requests. However, any non-pointer,
  25098. // non-interface field appearing in ForceSendFields will be sent to the
  25099. // server regardless of whether the field is empty or not. This may be
  25100. // used to include empty fields in Patch requests.
  25101. ForceSendFields []string `json:"-"`
  25102. // NullFields is a list of field names (e.g. "Id") to include in API
  25103. // requests with the JSON null value. By default, fields with empty
  25104. // values are omitted from API requests. However, any field with an
  25105. // empty value appearing in NullFields will be sent to the server as
  25106. // null. It is an error if a field in this list has a non-empty value.
  25107. // This may be used to include null fields in Patch requests.
  25108. NullFields []string `json:"-"`
  25109. }
  25110. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  25111. type NoMethod XpnResourceId
  25112. raw := NoMethod(*s)
  25113. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25114. }
  25115. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  25116. // resource_for v1.zones ==)
  25117. type Zone struct {
  25118. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  25119. // selections for the zone.
  25120. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  25121. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25122. // format.
  25123. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25124. // Deprecated: [Output Only] The deprecation status associated with this
  25125. // zone.
  25126. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  25127. // Description: [Output Only] Textual description of the resource.
  25128. Description string `json:"description,omitempty"`
  25129. // Id: [Output Only] The unique identifier for the resource. This
  25130. // identifier is defined by the server.
  25131. Id uint64 `json:"id,omitempty,string"`
  25132. // Kind: [Output Only] Type of the resource. Always compute#zone for
  25133. // zones.
  25134. Kind string `json:"kind,omitempty"`
  25135. // Name: [Output Only] Name of the resource.
  25136. Name string `json:"name,omitempty"`
  25137. // Region: [Output Only] Full URL reference to the region which hosts
  25138. // the zone.
  25139. Region string `json:"region,omitempty"`
  25140. // SelfLink: [Output Only] Server-defined URL for the resource.
  25141. SelfLink string `json:"selfLink,omitempty"`
  25142. // Status: [Output Only] Status of the zone, either UP or DOWN.
  25143. //
  25144. // Possible values:
  25145. // "DOWN"
  25146. // "UP"
  25147. Status string `json:"status,omitempty"`
  25148. // ServerResponse contains the HTTP response code and headers from the
  25149. // server.
  25150. googleapi.ServerResponse `json:"-"`
  25151. // ForceSendFields is a list of field names (e.g.
  25152. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  25153. // By default, fields with empty values are omitted from API requests.
  25154. // However, any non-pointer, non-interface field appearing in
  25155. // ForceSendFields will be sent to the server regardless of whether the
  25156. // field is empty or not. This may be used to include empty fields in
  25157. // Patch requests.
  25158. ForceSendFields []string `json:"-"`
  25159. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  25160. // include in API requests with the JSON null value. By default, fields
  25161. // with empty values are omitted from API requests. However, any field
  25162. // with an empty value appearing in NullFields will be sent to the
  25163. // server as null. It is an error if a field in this list has a
  25164. // non-empty value. This may be used to include null fields in Patch
  25165. // requests.
  25166. NullFields []string `json:"-"`
  25167. }
  25168. func (s *Zone) MarshalJSON() ([]byte, error) {
  25169. type NoMethod Zone
  25170. raw := NoMethod(*s)
  25171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25172. }
  25173. // ZoneList: Contains a list of zone resources.
  25174. type ZoneList struct {
  25175. // Id: [Output Only] Unique identifier for the resource; defined by the
  25176. // server.
  25177. Id string `json:"id,omitempty"`
  25178. // Items: A list of Zone resources.
  25179. Items []*Zone `json:"items,omitempty"`
  25180. // Kind: Type of resource.
  25181. Kind string `json:"kind,omitempty"`
  25182. // NextPageToken: [Output Only] This token allows you to get the next
  25183. // page of results for list requests. If the number of results is larger
  25184. // than maxResults, use the nextPageToken as a value for the query
  25185. // parameter pageToken in the next list request. Subsequent list
  25186. // requests will have their own nextPageToken to continue paging through
  25187. // the results.
  25188. NextPageToken string `json:"nextPageToken,omitempty"`
  25189. // SelfLink: [Output Only] Server-defined URL for this resource.
  25190. SelfLink string `json:"selfLink,omitempty"`
  25191. // Warning: [Output Only] Informational warning message.
  25192. Warning *ZoneListWarning `json:"warning,omitempty"`
  25193. // ServerResponse contains the HTTP response code and headers from the
  25194. // server.
  25195. googleapi.ServerResponse `json:"-"`
  25196. // ForceSendFields is a list of field names (e.g. "Id") to
  25197. // unconditionally include in API requests. By default, fields with
  25198. // empty values are omitted from API requests. However, any non-pointer,
  25199. // non-interface field appearing in ForceSendFields will be sent to the
  25200. // server regardless of whether the field is empty or not. This may be
  25201. // used to include empty fields in Patch requests.
  25202. ForceSendFields []string `json:"-"`
  25203. // NullFields is a list of field names (e.g. "Id") to include in API
  25204. // requests with the JSON null value. By default, fields with empty
  25205. // values are omitted from API requests. However, any field with an
  25206. // empty value appearing in NullFields will be sent to the server as
  25207. // null. It is an error if a field in this list has a non-empty value.
  25208. // This may be used to include null fields in Patch requests.
  25209. NullFields []string `json:"-"`
  25210. }
  25211. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  25212. type NoMethod ZoneList
  25213. raw := NoMethod(*s)
  25214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25215. }
  25216. // ZoneListWarning: [Output Only] Informational warning message.
  25217. type ZoneListWarning struct {
  25218. // Code: [Output Only] A warning code, if applicable. For example,
  25219. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25220. // the response.
  25221. //
  25222. // Possible values:
  25223. // "CLEANUP_FAILED"
  25224. // "DEPRECATED_RESOURCE_USED"
  25225. // "DEPRECATED_TYPE_USED"
  25226. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25227. // "EXPERIMENTAL_TYPE_USED"
  25228. // "EXTERNAL_API_WARNING"
  25229. // "FIELD_VALUE_OVERRIDEN"
  25230. // "INJECTED_KERNELS_DEPRECATED"
  25231. // "MISSING_TYPE_DEPENDENCY"
  25232. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25233. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25234. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25235. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25236. // "NEXT_HOP_NOT_RUNNING"
  25237. // "NOT_CRITICAL_ERROR"
  25238. // "NO_RESULTS_ON_PAGE"
  25239. // "REQUIRED_TOS_AGREEMENT"
  25240. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25241. // "RESOURCE_NOT_DELETED"
  25242. // "SCHEMA_VALIDATION_IGNORED"
  25243. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25244. // "UNDECLARED_PROPERTIES"
  25245. // "UNREACHABLE"
  25246. Code string `json:"code,omitempty"`
  25247. // Data: [Output Only] Metadata about this warning in key: value format.
  25248. // For example:
  25249. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25250. Data []*ZoneListWarningData `json:"data,omitempty"`
  25251. // Message: [Output Only] A human-readable description of the warning
  25252. // code.
  25253. Message string `json:"message,omitempty"`
  25254. // ForceSendFields is a list of field names (e.g. "Code") to
  25255. // unconditionally include in API requests. By default, fields with
  25256. // empty values are omitted from API requests. However, any non-pointer,
  25257. // non-interface field appearing in ForceSendFields will be sent to the
  25258. // server regardless of whether the field is empty or not. This may be
  25259. // used to include empty fields in Patch requests.
  25260. ForceSendFields []string `json:"-"`
  25261. // NullFields is a list of field names (e.g. "Code") to include in API
  25262. // requests with the JSON null value. By default, fields with empty
  25263. // values are omitted from API requests. However, any field with an
  25264. // empty value appearing in NullFields will be sent to the server as
  25265. // null. It is an error if a field in this list has a non-empty value.
  25266. // This may be used to include null fields in Patch requests.
  25267. NullFields []string `json:"-"`
  25268. }
  25269. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  25270. type NoMethod ZoneListWarning
  25271. raw := NoMethod(*s)
  25272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25273. }
  25274. type ZoneListWarningData struct {
  25275. // Key: [Output Only] A key that provides more detail on the warning
  25276. // being returned. For example, for warnings where there are no results
  25277. // in a list request for a particular zone, this key might be scope and
  25278. // the key value might be the zone name. Other examples might be a key
  25279. // indicating a deprecated resource and a suggested replacement, or a
  25280. // warning about invalid network settings (for example, if an instance
  25281. // attempts to perform IP forwarding but is not enabled for IP
  25282. // forwarding).
  25283. Key string `json:"key,omitempty"`
  25284. // Value: [Output Only] A warning data value corresponding to the key.
  25285. Value string `json:"value,omitempty"`
  25286. // ForceSendFields is a list of field names (e.g. "Key") to
  25287. // unconditionally include in API requests. By default, fields with
  25288. // empty values are omitted from API requests. However, any non-pointer,
  25289. // non-interface field appearing in ForceSendFields will be sent to the
  25290. // server regardless of whether the field is empty or not. This may be
  25291. // used to include empty fields in Patch requests.
  25292. ForceSendFields []string `json:"-"`
  25293. // NullFields is a list of field names (e.g. "Key") to include in API
  25294. // requests with the JSON null value. By default, fields with empty
  25295. // values are omitted from API requests. However, any field with an
  25296. // empty value appearing in NullFields will be sent to the server as
  25297. // null. It is an error if a field in this list has a non-empty value.
  25298. // This may be used to include null fields in Patch requests.
  25299. NullFields []string `json:"-"`
  25300. }
  25301. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  25302. type NoMethod ZoneListWarningData
  25303. raw := NoMethod(*s)
  25304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25305. }
  25306. type ZoneSetLabelsRequest struct {
  25307. // LabelFingerprint: The fingerprint of the previous set of labels for
  25308. // this resource, used to detect conflicts. The fingerprint is initially
  25309. // generated by Compute Engine and changes after every request to modify
  25310. // or update labels. You must always provide an up-to-date fingerprint
  25311. // hash in order to update or change labels. Make a get() request to the
  25312. // resource to get the latest fingerprint.
  25313. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25314. // Labels: The labels to set for this resource.
  25315. Labels map[string]string `json:"labels,omitempty"`
  25316. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  25317. // unconditionally include in API requests. By default, fields with
  25318. // empty values are omitted from API requests. However, any non-pointer,
  25319. // non-interface field appearing in ForceSendFields will be sent to the
  25320. // server regardless of whether the field is empty or not. This may be
  25321. // used to include empty fields in Patch requests.
  25322. ForceSendFields []string `json:"-"`
  25323. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  25324. // include in API requests with the JSON null value. By default, fields
  25325. // with empty values are omitted from API requests. However, any field
  25326. // with an empty value appearing in NullFields will be sent to the
  25327. // server as null. It is an error if a field in this list has a
  25328. // non-empty value. This may be used to include null fields in Patch
  25329. // requests.
  25330. NullFields []string `json:"-"`
  25331. }
  25332. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  25333. type NoMethod ZoneSetLabelsRequest
  25334. raw := NoMethod(*s)
  25335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25336. }
  25337. type ZoneSetPolicyRequest struct {
  25338. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  25339. // Deprecated. Use 'policy' to specify bindings.
  25340. Bindings []*Binding `json:"bindings,omitempty"`
  25341. // Etag: Flatten Policy to create a backward compatible wire-format.
  25342. // Deprecated. Use 'policy' to specify the etag.
  25343. Etag string `json:"etag,omitempty"`
  25344. // Policy: REQUIRED: The complete policy to be applied to the
  25345. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  25346. // empty policy is in general a valid policy but certain services (like
  25347. // Projects) might reject them.
  25348. Policy *Policy `json:"policy,omitempty"`
  25349. // ForceSendFields is a list of field names (e.g. "Bindings") to
  25350. // unconditionally include in API requests. By default, fields with
  25351. // empty values are omitted from API requests. However, any non-pointer,
  25352. // non-interface field appearing in ForceSendFields will be sent to the
  25353. // server regardless of whether the field is empty or not. This may be
  25354. // used to include empty fields in Patch requests.
  25355. ForceSendFields []string `json:"-"`
  25356. // NullFields is a list of field names (e.g. "Bindings") to include in
  25357. // API requests with the JSON null value. By default, fields with empty
  25358. // values are omitted from API requests. However, any field with an
  25359. // empty value appearing in NullFields will be sent to the server as
  25360. // null. It is an error if a field in this list has a non-empty value.
  25361. // This may be used to include null fields in Patch requests.
  25362. NullFields []string `json:"-"`
  25363. }
  25364. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  25365. type NoMethod ZoneSetPolicyRequest
  25366. raw := NoMethod(*s)
  25367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25368. }
  25369. // method id "compute.acceleratorTypes.aggregatedList":
  25370. type AcceleratorTypesAggregatedListCall struct {
  25371. s *Service
  25372. project string
  25373. urlParams_ gensupport.URLParams
  25374. ifNoneMatch_ string
  25375. ctx_ context.Context
  25376. header_ http.Header
  25377. }
  25378. // AggregatedList: Retrieves an aggregated list of accelerator types.
  25379. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  25380. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25381. c.project = project
  25382. return c
  25383. }
  25384. // Filter sets the optional parameter "filter": A filter expression that
  25385. // filters resources listed in the response. The expression must specify
  25386. // the field name, a comparison operator, and the value that you want to
  25387. // use for filtering. The value must be a string, a number, or a
  25388. // boolean. The comparison operator must be either =, !=, >, or <.
  25389. //
  25390. // For example, if you are filtering Compute Engine instances, you can
  25391. // exclude instances named example-instance by specifying name !=
  25392. // example-instance.
  25393. //
  25394. // You can also filter nested fields. For example, you could specify
  25395. // scheduling.automaticRestart = false to include instances only if they
  25396. // are not scheduled for automatic restarts. You can use filtering on
  25397. // nested fields to filter based on resource labels.
  25398. //
  25399. // To filter on multiple expressions, provide each separate expression
  25400. // within parentheses. For example, (scheduling.automaticRestart = true)
  25401. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  25402. // AND expression. However, you can include AND and OR expressions
  25403. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  25404. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  25405. // true).
  25406. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  25407. c.urlParams_.Set("filter", filter)
  25408. return c
  25409. }
  25410. // MaxResults sets the optional parameter "maxResults": The maximum
  25411. // number of results per page that should be returned. If the number of
  25412. // available results is larger than maxResults, Compute Engine returns a
  25413. // nextPageToken that can be used to get the next page of results in
  25414. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  25415. // (Default: 500)
  25416. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  25417. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25418. return c
  25419. }
  25420. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25421. // a certain order. By default, results are returned in alphanumerical
  25422. // order based on the resource name.
  25423. //
  25424. // You can also sort results in descending order based on the creation
  25425. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25426. // based on the creationTimestamp field in reverse chronological order
  25427. // (newest result first). Use this to sort resources like operations so
  25428. // that the newest operation is returned first.
  25429. //
  25430. // Currently, only sorting by name or creationTimestamp desc is
  25431. // supported.
  25432. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  25433. c.urlParams_.Set("orderBy", orderBy)
  25434. return c
  25435. }
  25436. // PageToken sets the optional parameter "pageToken": Specifies a page
  25437. // token to use. Set pageToken to the nextPageToken returned by a
  25438. // previous list request to get the next page of results.
  25439. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  25440. c.urlParams_.Set("pageToken", pageToken)
  25441. return c
  25442. }
  25443. // Fields allows partial responses to be retrieved. See
  25444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25445. // for more information.
  25446. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  25447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25448. return c
  25449. }
  25450. // IfNoneMatch sets the optional parameter which makes the operation
  25451. // fail if the object's ETag matches the given value. This is useful for
  25452. // getting updates only after the object has changed since the last
  25453. // request. Use googleapi.IsNotModified to check whether the response
  25454. // error from Do is the result of In-None-Match.
  25455. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  25456. c.ifNoneMatch_ = entityTag
  25457. return c
  25458. }
  25459. // Context sets the context to be used in this call's Do method. Any
  25460. // pending HTTP request will be aborted if the provided context is
  25461. // canceled.
  25462. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  25463. c.ctx_ = ctx
  25464. return c
  25465. }
  25466. // Header returns an http.Header that can be modified by the caller to
  25467. // add HTTP headers to the request.
  25468. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  25469. if c.header_ == nil {
  25470. c.header_ = make(http.Header)
  25471. }
  25472. return c.header_
  25473. }
  25474. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  25475. reqHeaders := make(http.Header)
  25476. for k, v := range c.header_ {
  25477. reqHeaders[k] = v
  25478. }
  25479. reqHeaders.Set("User-Agent", c.s.userAgent())
  25480. if c.ifNoneMatch_ != "" {
  25481. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25482. }
  25483. var body io.Reader = nil
  25484. c.urlParams_.Set("alt", alt)
  25485. c.urlParams_.Set("prettyPrint", "false")
  25486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  25487. urls += "?" + c.urlParams_.Encode()
  25488. req, err := http.NewRequest("GET", urls, body)
  25489. if err != nil {
  25490. return nil, err
  25491. }
  25492. req.Header = reqHeaders
  25493. googleapi.Expand(req.URL, map[string]string{
  25494. "project": c.project,
  25495. })
  25496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25497. }
  25498. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  25499. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  25500. // non-nil. Any non-2xx status code is an error. Response headers are in
  25501. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  25502. // response was returned at all) in error.(*googleapi.Error).Header. Use
  25503. // googleapi.IsNotModified to check whether the returned error was
  25504. // because http.StatusNotModified was returned.
  25505. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  25506. gensupport.SetOptions(c.urlParams_, opts...)
  25507. res, err := c.doRequest("json")
  25508. if res != nil && res.StatusCode == http.StatusNotModified {
  25509. if res.Body != nil {
  25510. res.Body.Close()
  25511. }
  25512. return nil, &googleapi.Error{
  25513. Code: res.StatusCode,
  25514. Header: res.Header,
  25515. }
  25516. }
  25517. if err != nil {
  25518. return nil, err
  25519. }
  25520. defer googleapi.CloseBody(res)
  25521. if err := googleapi.CheckResponse(res); err != nil {
  25522. return nil, err
  25523. }
  25524. ret := &AcceleratorTypeAggregatedList{
  25525. ServerResponse: googleapi.ServerResponse{
  25526. Header: res.Header,
  25527. HTTPStatusCode: res.StatusCode,
  25528. },
  25529. }
  25530. target := &ret
  25531. if err := gensupport.DecodeResponse(target, res); err != nil {
  25532. return nil, err
  25533. }
  25534. return ret, nil
  25535. // {
  25536. // "description": "Retrieves an aggregated list of accelerator types.",
  25537. // "httpMethod": "GET",
  25538. // "id": "compute.acceleratorTypes.aggregatedList",
  25539. // "parameterOrder": [
  25540. // "project"
  25541. // ],
  25542. // "parameters": {
  25543. // "filter": {
  25544. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  25545. // "location": "query",
  25546. // "type": "string"
  25547. // },
  25548. // "maxResults": {
  25549. // "default": "500",
  25550. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  25551. // "format": "uint32",
  25552. // "location": "query",
  25553. // "minimum": "0",
  25554. // "type": "integer"
  25555. // },
  25556. // "orderBy": {
  25557. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  25558. // "location": "query",
  25559. // "type": "string"
  25560. // },
  25561. // "pageToken": {
  25562. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  25563. // "location": "query",
  25564. // "type": "string"
  25565. // },
  25566. // "project": {
  25567. // "description": "Project ID for this request.",
  25568. // "location": "path",
  25569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25570. // "required": true,
  25571. // "type": "string"
  25572. // }
  25573. // },
  25574. // "path": "{project}/aggregated/acceleratorTypes",
  25575. // "response": {
  25576. // "$ref": "AcceleratorTypeAggregatedList"
  25577. // },
  25578. // "scopes": [
  25579. // "https://www.googleapis.com/auth/cloud-platform",
  25580. // "https://www.googleapis.com/auth/compute",
  25581. // "https://www.googleapis.com/auth/compute.readonly"
  25582. // ]
  25583. // }
  25584. }
  25585. // Pages invokes f for each page of results.
  25586. // A non-nil error returned from f will halt the iteration.
  25587. // The provided context supersedes any context provided to the Context method.
  25588. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  25589. c.ctx_ = ctx
  25590. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25591. for {
  25592. x, err := c.Do()
  25593. if err != nil {
  25594. return err
  25595. }
  25596. if err := f(x); err != nil {
  25597. return err
  25598. }
  25599. if x.NextPageToken == "" {
  25600. return nil
  25601. }
  25602. c.PageToken(x.NextPageToken)
  25603. }
  25604. }
  25605. // method id "compute.acceleratorTypes.get":
  25606. type AcceleratorTypesGetCall struct {
  25607. s *Service
  25608. project string
  25609. zone string
  25610. acceleratorType string
  25611. urlParams_ gensupport.URLParams
  25612. ifNoneMatch_ string
  25613. ctx_ context.Context
  25614. header_ http.Header
  25615. }
  25616. // Get: Returns the specified accelerator type.
  25617. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  25618. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25619. c.project = project
  25620. c.zone = zone
  25621. c.acceleratorType = acceleratorType
  25622. return c
  25623. }
  25624. // Fields allows partial responses to be retrieved. See
  25625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25626. // for more information.
  25627. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  25628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25629. return c
  25630. }
  25631. // IfNoneMatch sets the optional parameter which makes the operation
  25632. // fail if the object's ETag matches the given value. This is useful for
  25633. // getting updates only after the object has changed since the last
  25634. // request. Use googleapi.IsNotModified to check whether the response
  25635. // error from Do is the result of In-None-Match.
  25636. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  25637. c.ifNoneMatch_ = entityTag
  25638. return c
  25639. }
  25640. // Context sets the context to be used in this call's Do method. Any
  25641. // pending HTTP request will be aborted if the provided context is
  25642. // canceled.
  25643. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  25644. c.ctx_ = ctx
  25645. return c
  25646. }
  25647. // Header returns an http.Header that can be modified by the caller to
  25648. // add HTTP headers to the request.
  25649. func (c *AcceleratorTypesGetCall) Header() http.Header {
  25650. if c.header_ == nil {
  25651. c.header_ = make(http.Header)
  25652. }
  25653. return c.header_
  25654. }
  25655. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  25656. reqHeaders := make(http.Header)
  25657. for k, v := range c.header_ {
  25658. reqHeaders[k] = v
  25659. }
  25660. reqHeaders.Set("User-Agent", c.s.userAgent())
  25661. if c.ifNoneMatch_ != "" {
  25662. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25663. }
  25664. var body io.Reader = nil
  25665. c.urlParams_.Set("alt", alt)
  25666. c.urlParams_.Set("prettyPrint", "false")
  25667. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  25668. urls += "?" + c.urlParams_.Encode()
  25669. req, err := http.NewRequest("GET", urls, body)
  25670. if err != nil {
  25671. return nil, err
  25672. }
  25673. req.Header = reqHeaders
  25674. googleapi.Expand(req.URL, map[string]string{
  25675. "project": c.project,
  25676. "zone": c.zone,
  25677. "acceleratorType": c.acceleratorType,
  25678. })
  25679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25680. }
  25681. // Do executes the "compute.acceleratorTypes.get" call.
  25682. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  25683. // status code is an error. Response headers are in either
  25684. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  25685. // at all) in error.(*googleapi.Error).Header. Use
  25686. // googleapi.IsNotModified to check whether the returned error was
  25687. // because http.StatusNotModified was returned.
  25688. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  25689. gensupport.SetOptions(c.urlParams_, opts...)
  25690. res, err := c.doRequest("json")
  25691. if res != nil && res.StatusCode == http.StatusNotModified {
  25692. if res.Body != nil {
  25693. res.Body.Close()
  25694. }
  25695. return nil, &googleapi.Error{
  25696. Code: res.StatusCode,
  25697. Header: res.Header,
  25698. }
  25699. }
  25700. if err != nil {
  25701. return nil, err
  25702. }
  25703. defer googleapi.CloseBody(res)
  25704. if err := googleapi.CheckResponse(res); err != nil {
  25705. return nil, err
  25706. }
  25707. ret := &AcceleratorType{
  25708. ServerResponse: googleapi.ServerResponse{
  25709. Header: res.Header,
  25710. HTTPStatusCode: res.StatusCode,
  25711. },
  25712. }
  25713. target := &ret
  25714. if err := gensupport.DecodeResponse(target, res); err != nil {
  25715. return nil, err
  25716. }
  25717. return ret, nil
  25718. // {
  25719. // "description": "Returns the specified accelerator type.",
  25720. // "httpMethod": "GET",
  25721. // "id": "compute.acceleratorTypes.get",
  25722. // "parameterOrder": [
  25723. // "project",
  25724. // "zone",
  25725. // "acceleratorType"
  25726. // ],
  25727. // "parameters": {
  25728. // "acceleratorType": {
  25729. // "description": "Name of the accelerator type to return.",
  25730. // "location": "path",
  25731. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25732. // "required": true,
  25733. // "type": "string"
  25734. // },
  25735. // "project": {
  25736. // "description": "Project ID for this request.",
  25737. // "location": "path",
  25738. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25739. // "required": true,
  25740. // "type": "string"
  25741. // },
  25742. // "zone": {
  25743. // "description": "The name of the zone for this request.",
  25744. // "location": "path",
  25745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25746. // "required": true,
  25747. // "type": "string"
  25748. // }
  25749. // },
  25750. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  25751. // "response": {
  25752. // "$ref": "AcceleratorType"
  25753. // },
  25754. // "scopes": [
  25755. // "https://www.googleapis.com/auth/cloud-platform",
  25756. // "https://www.googleapis.com/auth/compute",
  25757. // "https://www.googleapis.com/auth/compute.readonly"
  25758. // ]
  25759. // }
  25760. }
  25761. // method id "compute.acceleratorTypes.list":
  25762. type AcceleratorTypesListCall struct {
  25763. s *Service
  25764. project string
  25765. zone string
  25766. urlParams_ gensupport.URLParams
  25767. ifNoneMatch_ string
  25768. ctx_ context.Context
  25769. header_ http.Header
  25770. }
  25771. // List: Retrieves a list of accelerator types available to the
  25772. // specified project.
  25773. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  25774. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25775. c.project = project
  25776. c.zone = zone
  25777. return c
  25778. }
  25779. // Filter sets the optional parameter "filter": A filter expression that
  25780. // filters resources listed in the response. The expression must specify
  25781. // the field name, a comparison operator, and the value that you want to
  25782. // use for filtering. The value must be a string, a number, or a
  25783. // boolean. The comparison operator must be either =, !=, >, or <.
  25784. //
  25785. // For example, if you are filtering Compute Engine instances, you can
  25786. // exclude instances named example-instance by specifying name !=
  25787. // example-instance.
  25788. //
  25789. // You can also filter nested fields. For example, you could specify
  25790. // scheduling.automaticRestart = false to include instances only if they
  25791. // are not scheduled for automatic restarts. You can use filtering on
  25792. // nested fields to filter based on resource labels.
  25793. //
  25794. // To filter on multiple expressions, provide each separate expression
  25795. // within parentheses. For example, (scheduling.automaticRestart = true)
  25796. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  25797. // AND expression. However, you can include AND and OR expressions
  25798. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  25799. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  25800. // true).
  25801. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  25802. c.urlParams_.Set("filter", filter)
  25803. return c
  25804. }
  25805. // MaxResults sets the optional parameter "maxResults": The maximum
  25806. // number of results per page that should be returned. If the number of
  25807. // available results is larger than maxResults, Compute Engine returns a
  25808. // nextPageToken that can be used to get the next page of results in
  25809. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  25810. // (Default: 500)
  25811. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  25812. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25813. return c
  25814. }
  25815. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25816. // a certain order. By default, results are returned in alphanumerical
  25817. // order based on the resource name.
  25818. //
  25819. // You can also sort results in descending order based on the creation
  25820. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25821. // based on the creationTimestamp field in reverse chronological order
  25822. // (newest result first). Use this to sort resources like operations so
  25823. // that the newest operation is returned first.
  25824. //
  25825. // Currently, only sorting by name or creationTimestamp desc is
  25826. // supported.
  25827. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  25828. c.urlParams_.Set("orderBy", orderBy)
  25829. return c
  25830. }
  25831. // PageToken sets the optional parameter "pageToken": Specifies a page
  25832. // token to use. Set pageToken to the nextPageToken returned by a
  25833. // previous list request to get the next page of results.
  25834. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  25835. c.urlParams_.Set("pageToken", pageToken)
  25836. return c
  25837. }
  25838. // Fields allows partial responses to be retrieved. See
  25839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25840. // for more information.
  25841. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  25842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25843. return c
  25844. }
  25845. // IfNoneMatch sets the optional parameter which makes the operation
  25846. // fail if the object's ETag matches the given value. This is useful for
  25847. // getting updates only after the object has changed since the last
  25848. // request. Use googleapi.IsNotModified to check whether the response
  25849. // error from Do is the result of In-None-Match.
  25850. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  25851. c.ifNoneMatch_ = entityTag
  25852. return c
  25853. }
  25854. // Context sets the context to be used in this call's Do method. Any
  25855. // pending HTTP request will be aborted if the provided context is
  25856. // canceled.
  25857. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  25858. c.ctx_ = ctx
  25859. return c
  25860. }
  25861. // Header returns an http.Header that can be modified by the caller to
  25862. // add HTTP headers to the request.
  25863. func (c *AcceleratorTypesListCall) Header() http.Header {
  25864. if c.header_ == nil {
  25865. c.header_ = make(http.Header)
  25866. }
  25867. return c.header_
  25868. }
  25869. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  25870. reqHeaders := make(http.Header)
  25871. for k, v := range c.header_ {
  25872. reqHeaders[k] = v
  25873. }
  25874. reqHeaders.Set("User-Agent", c.s.userAgent())
  25875. if c.ifNoneMatch_ != "" {
  25876. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25877. }
  25878. var body io.Reader = nil
  25879. c.urlParams_.Set("alt", alt)
  25880. c.urlParams_.Set("prettyPrint", "false")
  25881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  25882. urls += "?" + c.urlParams_.Encode()
  25883. req, err := http.NewRequest("GET", urls, body)
  25884. if err != nil {
  25885. return nil, err
  25886. }
  25887. req.Header = reqHeaders
  25888. googleapi.Expand(req.URL, map[string]string{
  25889. "project": c.project,
  25890. "zone": c.zone,
  25891. })
  25892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25893. }
  25894. // Do executes the "compute.acceleratorTypes.list" call.
  25895. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  25896. // non-2xx status code is an error. Response headers are in either
  25897. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  25898. // returned at all) in error.(*googleapi.Error).Header. Use
  25899. // googleapi.IsNotModified to check whether the returned error was
  25900. // because http.StatusNotModified was returned.
  25901. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  25902. gensupport.SetOptions(c.urlParams_, opts...)
  25903. res, err := c.doRequest("json")
  25904. if res != nil && res.StatusCode == http.StatusNotModified {
  25905. if res.Body != nil {
  25906. res.Body.Close()
  25907. }
  25908. return nil, &googleapi.Error{
  25909. Code: res.StatusCode,
  25910. Header: res.Header,
  25911. }
  25912. }
  25913. if err != nil {
  25914. return nil, err
  25915. }
  25916. defer googleapi.CloseBody(res)
  25917. if err := googleapi.CheckResponse(res); err != nil {
  25918. return nil, err
  25919. }
  25920. ret := &AcceleratorTypeList{
  25921. ServerResponse: googleapi.ServerResponse{
  25922. Header: res.Header,
  25923. HTTPStatusCode: res.StatusCode,
  25924. },
  25925. }
  25926. target := &ret
  25927. if err := gensupport.DecodeResponse(target, res); err != nil {
  25928. return nil, err
  25929. }
  25930. return ret, nil
  25931. // {
  25932. // "description": "Retrieves a list of accelerator types available to the specified project.",
  25933. // "httpMethod": "GET",
  25934. // "id": "compute.acceleratorTypes.list",
  25935. // "parameterOrder": [
  25936. // "project",
  25937. // "zone"
  25938. // ],
  25939. // "parameters": {
  25940. // "filter": {
  25941. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  25942. // "location": "query",
  25943. // "type": "string"
  25944. // },
  25945. // "maxResults": {
  25946. // "default": "500",
  25947. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  25948. // "format": "uint32",
  25949. // "location": "query",
  25950. // "minimum": "0",
  25951. // "type": "integer"
  25952. // },
  25953. // "orderBy": {
  25954. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  25955. // "location": "query",
  25956. // "type": "string"
  25957. // },
  25958. // "pageToken": {
  25959. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  25960. // "location": "query",
  25961. // "type": "string"
  25962. // },
  25963. // "project": {
  25964. // "description": "Project ID for this request.",
  25965. // "location": "path",
  25966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25967. // "required": true,
  25968. // "type": "string"
  25969. // },
  25970. // "zone": {
  25971. // "description": "The name of the zone for this request.",
  25972. // "location": "path",
  25973. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25974. // "required": true,
  25975. // "type": "string"
  25976. // }
  25977. // },
  25978. // "path": "{project}/zones/{zone}/acceleratorTypes",
  25979. // "response": {
  25980. // "$ref": "AcceleratorTypeList"
  25981. // },
  25982. // "scopes": [
  25983. // "https://www.googleapis.com/auth/cloud-platform",
  25984. // "https://www.googleapis.com/auth/compute",
  25985. // "https://www.googleapis.com/auth/compute.readonly"
  25986. // ]
  25987. // }
  25988. }
  25989. // Pages invokes f for each page of results.
  25990. // A non-nil error returned from f will halt the iteration.
  25991. // The provided context supersedes any context provided to the Context method.
  25992. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  25993. c.ctx_ = ctx
  25994. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25995. for {
  25996. x, err := c.Do()
  25997. if err != nil {
  25998. return err
  25999. }
  26000. if err := f(x); err != nil {
  26001. return err
  26002. }
  26003. if x.NextPageToken == "" {
  26004. return nil
  26005. }
  26006. c.PageToken(x.NextPageToken)
  26007. }
  26008. }
  26009. // method id "compute.addresses.aggregatedList":
  26010. type AddressesAggregatedListCall struct {
  26011. s *Service
  26012. project string
  26013. urlParams_ gensupport.URLParams
  26014. ifNoneMatch_ string
  26015. ctx_ context.Context
  26016. header_ http.Header
  26017. }
  26018. // AggregatedList: Retrieves an aggregated list of addresses.
  26019. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  26020. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  26021. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26022. c.project = project
  26023. return c
  26024. }
  26025. // Filter sets the optional parameter "filter": A filter expression that
  26026. // filters resources listed in the response. The expression must specify
  26027. // the field name, a comparison operator, and the value that you want to
  26028. // use for filtering. The value must be a string, a number, or a
  26029. // boolean. The comparison operator must be either =, !=, >, or <.
  26030. //
  26031. // For example, if you are filtering Compute Engine instances, you can
  26032. // exclude instances named example-instance by specifying name !=
  26033. // example-instance.
  26034. //
  26035. // You can also filter nested fields. For example, you could specify
  26036. // scheduling.automaticRestart = false to include instances only if they
  26037. // are not scheduled for automatic restarts. You can use filtering on
  26038. // nested fields to filter based on resource labels.
  26039. //
  26040. // To filter on multiple expressions, provide each separate expression
  26041. // within parentheses. For example, (scheduling.automaticRestart = true)
  26042. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26043. // AND expression. However, you can include AND and OR expressions
  26044. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26045. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26046. // true).
  26047. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  26048. c.urlParams_.Set("filter", filter)
  26049. return c
  26050. }
  26051. // MaxResults sets the optional parameter "maxResults": The maximum
  26052. // number of results per page that should be returned. If the number of
  26053. // available results is larger than maxResults, Compute Engine returns a
  26054. // nextPageToken that can be used to get the next page of results in
  26055. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26056. // (Default: 500)
  26057. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  26058. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26059. return c
  26060. }
  26061. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26062. // a certain order. By default, results are returned in alphanumerical
  26063. // order based on the resource name.
  26064. //
  26065. // You can also sort results in descending order based on the creation
  26066. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26067. // based on the creationTimestamp field in reverse chronological order
  26068. // (newest result first). Use this to sort resources like operations so
  26069. // that the newest operation is returned first.
  26070. //
  26071. // Currently, only sorting by name or creationTimestamp desc is
  26072. // supported.
  26073. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  26074. c.urlParams_.Set("orderBy", orderBy)
  26075. return c
  26076. }
  26077. // PageToken sets the optional parameter "pageToken": Specifies a page
  26078. // token to use. Set pageToken to the nextPageToken returned by a
  26079. // previous list request to get the next page of results.
  26080. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  26081. c.urlParams_.Set("pageToken", pageToken)
  26082. return c
  26083. }
  26084. // Fields allows partial responses to be retrieved. See
  26085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26086. // for more information.
  26087. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  26088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26089. return c
  26090. }
  26091. // IfNoneMatch sets the optional parameter which makes the operation
  26092. // fail if the object's ETag matches the given value. This is useful for
  26093. // getting updates only after the object has changed since the last
  26094. // request. Use googleapi.IsNotModified to check whether the response
  26095. // error from Do is the result of In-None-Match.
  26096. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  26097. c.ifNoneMatch_ = entityTag
  26098. return c
  26099. }
  26100. // Context sets the context to be used in this call's Do method. Any
  26101. // pending HTTP request will be aborted if the provided context is
  26102. // canceled.
  26103. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  26104. c.ctx_ = ctx
  26105. return c
  26106. }
  26107. // Header returns an http.Header that can be modified by the caller to
  26108. // add HTTP headers to the request.
  26109. func (c *AddressesAggregatedListCall) Header() http.Header {
  26110. if c.header_ == nil {
  26111. c.header_ = make(http.Header)
  26112. }
  26113. return c.header_
  26114. }
  26115. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  26116. reqHeaders := make(http.Header)
  26117. for k, v := range c.header_ {
  26118. reqHeaders[k] = v
  26119. }
  26120. reqHeaders.Set("User-Agent", c.s.userAgent())
  26121. if c.ifNoneMatch_ != "" {
  26122. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26123. }
  26124. var body io.Reader = nil
  26125. c.urlParams_.Set("alt", alt)
  26126. c.urlParams_.Set("prettyPrint", "false")
  26127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  26128. urls += "?" + c.urlParams_.Encode()
  26129. req, err := http.NewRequest("GET", urls, body)
  26130. if err != nil {
  26131. return nil, err
  26132. }
  26133. req.Header = reqHeaders
  26134. googleapi.Expand(req.URL, map[string]string{
  26135. "project": c.project,
  26136. })
  26137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26138. }
  26139. // Do executes the "compute.addresses.aggregatedList" call.
  26140. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  26141. // non-2xx status code is an error. Response headers are in either
  26142. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  26143. // returned at all) in error.(*googleapi.Error).Header. Use
  26144. // googleapi.IsNotModified to check whether the returned error was
  26145. // because http.StatusNotModified was returned.
  26146. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  26147. gensupport.SetOptions(c.urlParams_, opts...)
  26148. res, err := c.doRequest("json")
  26149. if res != nil && res.StatusCode == http.StatusNotModified {
  26150. if res.Body != nil {
  26151. res.Body.Close()
  26152. }
  26153. return nil, &googleapi.Error{
  26154. Code: res.StatusCode,
  26155. Header: res.Header,
  26156. }
  26157. }
  26158. if err != nil {
  26159. return nil, err
  26160. }
  26161. defer googleapi.CloseBody(res)
  26162. if err := googleapi.CheckResponse(res); err != nil {
  26163. return nil, err
  26164. }
  26165. ret := &AddressAggregatedList{
  26166. ServerResponse: googleapi.ServerResponse{
  26167. Header: res.Header,
  26168. HTTPStatusCode: res.StatusCode,
  26169. },
  26170. }
  26171. target := &ret
  26172. if err := gensupport.DecodeResponse(target, res); err != nil {
  26173. return nil, err
  26174. }
  26175. return ret, nil
  26176. // {
  26177. // "description": "Retrieves an aggregated list of addresses.",
  26178. // "httpMethod": "GET",
  26179. // "id": "compute.addresses.aggregatedList",
  26180. // "parameterOrder": [
  26181. // "project"
  26182. // ],
  26183. // "parameters": {
  26184. // "filter": {
  26185. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26186. // "location": "query",
  26187. // "type": "string"
  26188. // },
  26189. // "maxResults": {
  26190. // "default": "500",
  26191. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26192. // "format": "uint32",
  26193. // "location": "query",
  26194. // "minimum": "0",
  26195. // "type": "integer"
  26196. // },
  26197. // "orderBy": {
  26198. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26199. // "location": "query",
  26200. // "type": "string"
  26201. // },
  26202. // "pageToken": {
  26203. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26204. // "location": "query",
  26205. // "type": "string"
  26206. // },
  26207. // "project": {
  26208. // "description": "Project ID for this request.",
  26209. // "location": "path",
  26210. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26211. // "required": true,
  26212. // "type": "string"
  26213. // }
  26214. // },
  26215. // "path": "{project}/aggregated/addresses",
  26216. // "response": {
  26217. // "$ref": "AddressAggregatedList"
  26218. // },
  26219. // "scopes": [
  26220. // "https://www.googleapis.com/auth/cloud-platform",
  26221. // "https://www.googleapis.com/auth/compute",
  26222. // "https://www.googleapis.com/auth/compute.readonly"
  26223. // ]
  26224. // }
  26225. }
  26226. // Pages invokes f for each page of results.
  26227. // A non-nil error returned from f will halt the iteration.
  26228. // The provided context supersedes any context provided to the Context method.
  26229. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  26230. c.ctx_ = ctx
  26231. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26232. for {
  26233. x, err := c.Do()
  26234. if err != nil {
  26235. return err
  26236. }
  26237. if err := f(x); err != nil {
  26238. return err
  26239. }
  26240. if x.NextPageToken == "" {
  26241. return nil
  26242. }
  26243. c.PageToken(x.NextPageToken)
  26244. }
  26245. }
  26246. // method id "compute.addresses.delete":
  26247. type AddressesDeleteCall struct {
  26248. s *Service
  26249. project string
  26250. region string
  26251. address string
  26252. urlParams_ gensupport.URLParams
  26253. ctx_ context.Context
  26254. header_ http.Header
  26255. }
  26256. // Delete: Deletes the specified address resource.
  26257. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  26258. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  26259. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26260. c.project = project
  26261. c.region = region
  26262. c.address = address
  26263. return c
  26264. }
  26265. // RequestId sets the optional parameter "requestId": An optional
  26266. // request ID to identify requests. Specify a unique request ID so that
  26267. // if you must retry your request, the server will know to ignore the
  26268. // request if it has already been completed.
  26269. //
  26270. // For example, consider a situation where you make an initial request
  26271. // and the request times out. If you make the request again with the
  26272. // same request ID, the server can check if original operation with the
  26273. // same request ID was received, and if so, will ignore the second
  26274. // request. This prevents clients from accidentally creating duplicate
  26275. // commitments.
  26276. //
  26277. // The request ID must be a valid UUID with the exception that zero UUID
  26278. // is not supported (00000000-0000-0000-0000-000000000000).
  26279. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  26280. c.urlParams_.Set("requestId", requestId)
  26281. return c
  26282. }
  26283. // Fields allows partial responses to be retrieved. See
  26284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26285. // for more information.
  26286. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  26287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26288. return c
  26289. }
  26290. // Context sets the context to be used in this call's Do method. Any
  26291. // pending HTTP request will be aborted if the provided context is
  26292. // canceled.
  26293. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  26294. c.ctx_ = ctx
  26295. return c
  26296. }
  26297. // Header returns an http.Header that can be modified by the caller to
  26298. // add HTTP headers to the request.
  26299. func (c *AddressesDeleteCall) Header() http.Header {
  26300. if c.header_ == nil {
  26301. c.header_ = make(http.Header)
  26302. }
  26303. return c.header_
  26304. }
  26305. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  26306. reqHeaders := make(http.Header)
  26307. for k, v := range c.header_ {
  26308. reqHeaders[k] = v
  26309. }
  26310. reqHeaders.Set("User-Agent", c.s.userAgent())
  26311. var body io.Reader = nil
  26312. c.urlParams_.Set("alt", alt)
  26313. c.urlParams_.Set("prettyPrint", "false")
  26314. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  26315. urls += "?" + c.urlParams_.Encode()
  26316. req, err := http.NewRequest("DELETE", urls, body)
  26317. if err != nil {
  26318. return nil, err
  26319. }
  26320. req.Header = reqHeaders
  26321. googleapi.Expand(req.URL, map[string]string{
  26322. "project": c.project,
  26323. "region": c.region,
  26324. "address": c.address,
  26325. })
  26326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26327. }
  26328. // Do executes the "compute.addresses.delete" call.
  26329. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26330. // status code is an error. Response headers are in either
  26331. // *Operation.ServerResponse.Header or (if a response was returned at
  26332. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26333. // to check whether the returned error was because
  26334. // http.StatusNotModified was returned.
  26335. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26336. gensupport.SetOptions(c.urlParams_, opts...)
  26337. res, err := c.doRequest("json")
  26338. if res != nil && res.StatusCode == http.StatusNotModified {
  26339. if res.Body != nil {
  26340. res.Body.Close()
  26341. }
  26342. return nil, &googleapi.Error{
  26343. Code: res.StatusCode,
  26344. Header: res.Header,
  26345. }
  26346. }
  26347. if err != nil {
  26348. return nil, err
  26349. }
  26350. defer googleapi.CloseBody(res)
  26351. if err := googleapi.CheckResponse(res); err != nil {
  26352. return nil, err
  26353. }
  26354. ret := &Operation{
  26355. ServerResponse: googleapi.ServerResponse{
  26356. Header: res.Header,
  26357. HTTPStatusCode: res.StatusCode,
  26358. },
  26359. }
  26360. target := &ret
  26361. if err := gensupport.DecodeResponse(target, res); err != nil {
  26362. return nil, err
  26363. }
  26364. return ret, nil
  26365. // {
  26366. // "description": "Deletes the specified address resource.",
  26367. // "httpMethod": "DELETE",
  26368. // "id": "compute.addresses.delete",
  26369. // "parameterOrder": [
  26370. // "project",
  26371. // "region",
  26372. // "address"
  26373. // ],
  26374. // "parameters": {
  26375. // "address": {
  26376. // "description": "Name of the address resource to delete.",
  26377. // "location": "path",
  26378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26379. // "required": true,
  26380. // "type": "string"
  26381. // },
  26382. // "project": {
  26383. // "description": "Project ID for this request.",
  26384. // "location": "path",
  26385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26386. // "required": true,
  26387. // "type": "string"
  26388. // },
  26389. // "region": {
  26390. // "description": "Name of the region for this request.",
  26391. // "location": "path",
  26392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26393. // "required": true,
  26394. // "type": "string"
  26395. // },
  26396. // "requestId": {
  26397. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  26398. // "location": "query",
  26399. // "type": "string"
  26400. // }
  26401. // },
  26402. // "path": "{project}/regions/{region}/addresses/{address}",
  26403. // "response": {
  26404. // "$ref": "Operation"
  26405. // },
  26406. // "scopes": [
  26407. // "https://www.googleapis.com/auth/cloud-platform",
  26408. // "https://www.googleapis.com/auth/compute"
  26409. // ]
  26410. // }
  26411. }
  26412. // method id "compute.addresses.get":
  26413. type AddressesGetCall struct {
  26414. s *Service
  26415. project string
  26416. region string
  26417. address string
  26418. urlParams_ gensupport.URLParams
  26419. ifNoneMatch_ string
  26420. ctx_ context.Context
  26421. header_ http.Header
  26422. }
  26423. // Get: Returns the specified address resource.
  26424. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  26425. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  26426. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26427. c.project = project
  26428. c.region = region
  26429. c.address = address
  26430. return c
  26431. }
  26432. // Fields allows partial responses to be retrieved. See
  26433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26434. // for more information.
  26435. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  26436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26437. return c
  26438. }
  26439. // IfNoneMatch sets the optional parameter which makes the operation
  26440. // fail if the object's ETag matches the given value. This is useful for
  26441. // getting updates only after the object has changed since the last
  26442. // request. Use googleapi.IsNotModified to check whether the response
  26443. // error from Do is the result of In-None-Match.
  26444. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  26445. c.ifNoneMatch_ = entityTag
  26446. return c
  26447. }
  26448. // Context sets the context to be used in this call's Do method. Any
  26449. // pending HTTP request will be aborted if the provided context is
  26450. // canceled.
  26451. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  26452. c.ctx_ = ctx
  26453. return c
  26454. }
  26455. // Header returns an http.Header that can be modified by the caller to
  26456. // add HTTP headers to the request.
  26457. func (c *AddressesGetCall) Header() http.Header {
  26458. if c.header_ == nil {
  26459. c.header_ = make(http.Header)
  26460. }
  26461. return c.header_
  26462. }
  26463. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  26464. reqHeaders := make(http.Header)
  26465. for k, v := range c.header_ {
  26466. reqHeaders[k] = v
  26467. }
  26468. reqHeaders.Set("User-Agent", c.s.userAgent())
  26469. if c.ifNoneMatch_ != "" {
  26470. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26471. }
  26472. var body io.Reader = nil
  26473. c.urlParams_.Set("alt", alt)
  26474. c.urlParams_.Set("prettyPrint", "false")
  26475. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  26476. urls += "?" + c.urlParams_.Encode()
  26477. req, err := http.NewRequest("GET", urls, body)
  26478. if err != nil {
  26479. return nil, err
  26480. }
  26481. req.Header = reqHeaders
  26482. googleapi.Expand(req.URL, map[string]string{
  26483. "project": c.project,
  26484. "region": c.region,
  26485. "address": c.address,
  26486. })
  26487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26488. }
  26489. // Do executes the "compute.addresses.get" call.
  26490. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  26491. // code is an error. Response headers are in either
  26492. // *Address.ServerResponse.Header or (if a response was returned at all)
  26493. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  26494. // check whether the returned error was because http.StatusNotModified
  26495. // was returned.
  26496. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  26497. gensupport.SetOptions(c.urlParams_, opts...)
  26498. res, err := c.doRequest("json")
  26499. if res != nil && res.StatusCode == http.StatusNotModified {
  26500. if res.Body != nil {
  26501. res.Body.Close()
  26502. }
  26503. return nil, &googleapi.Error{
  26504. Code: res.StatusCode,
  26505. Header: res.Header,
  26506. }
  26507. }
  26508. if err != nil {
  26509. return nil, err
  26510. }
  26511. defer googleapi.CloseBody(res)
  26512. if err := googleapi.CheckResponse(res); err != nil {
  26513. return nil, err
  26514. }
  26515. ret := &Address{
  26516. ServerResponse: googleapi.ServerResponse{
  26517. Header: res.Header,
  26518. HTTPStatusCode: res.StatusCode,
  26519. },
  26520. }
  26521. target := &ret
  26522. if err := gensupport.DecodeResponse(target, res); err != nil {
  26523. return nil, err
  26524. }
  26525. return ret, nil
  26526. // {
  26527. // "description": "Returns the specified address resource.",
  26528. // "httpMethod": "GET",
  26529. // "id": "compute.addresses.get",
  26530. // "parameterOrder": [
  26531. // "project",
  26532. // "region",
  26533. // "address"
  26534. // ],
  26535. // "parameters": {
  26536. // "address": {
  26537. // "description": "Name of the address resource to return.",
  26538. // "location": "path",
  26539. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26540. // "required": true,
  26541. // "type": "string"
  26542. // },
  26543. // "project": {
  26544. // "description": "Project ID for this request.",
  26545. // "location": "path",
  26546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26547. // "required": true,
  26548. // "type": "string"
  26549. // },
  26550. // "region": {
  26551. // "description": "Name of the region for this request.",
  26552. // "location": "path",
  26553. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26554. // "required": true,
  26555. // "type": "string"
  26556. // }
  26557. // },
  26558. // "path": "{project}/regions/{region}/addresses/{address}",
  26559. // "response": {
  26560. // "$ref": "Address"
  26561. // },
  26562. // "scopes": [
  26563. // "https://www.googleapis.com/auth/cloud-platform",
  26564. // "https://www.googleapis.com/auth/compute",
  26565. // "https://www.googleapis.com/auth/compute.readonly"
  26566. // ]
  26567. // }
  26568. }
  26569. // method id "compute.addresses.insert":
  26570. type AddressesInsertCall struct {
  26571. s *Service
  26572. project string
  26573. region string
  26574. address *Address
  26575. urlParams_ gensupport.URLParams
  26576. ctx_ context.Context
  26577. header_ http.Header
  26578. }
  26579. // Insert: Creates an address resource in the specified project using
  26580. // the data included in the request.
  26581. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  26582. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  26583. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26584. c.project = project
  26585. c.region = region
  26586. c.address = address
  26587. return c
  26588. }
  26589. // RequestId sets the optional parameter "requestId": An optional
  26590. // request ID to identify requests. Specify a unique request ID so that
  26591. // if you must retry your request, the server will know to ignore the
  26592. // request if it has already been completed.
  26593. //
  26594. // For example, consider a situation where you make an initial request
  26595. // and the request times out. If you make the request again with the
  26596. // same request ID, the server can check if original operation with the
  26597. // same request ID was received, and if so, will ignore the second
  26598. // request. This prevents clients from accidentally creating duplicate
  26599. // commitments.
  26600. //
  26601. // The request ID must be a valid UUID with the exception that zero UUID
  26602. // is not supported (00000000-0000-0000-0000-000000000000).
  26603. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  26604. c.urlParams_.Set("requestId", requestId)
  26605. return c
  26606. }
  26607. // Fields allows partial responses to be retrieved. See
  26608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26609. // for more information.
  26610. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  26611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26612. return c
  26613. }
  26614. // Context sets the context to be used in this call's Do method. Any
  26615. // pending HTTP request will be aborted if the provided context is
  26616. // canceled.
  26617. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  26618. c.ctx_ = ctx
  26619. return c
  26620. }
  26621. // Header returns an http.Header that can be modified by the caller to
  26622. // add HTTP headers to the request.
  26623. func (c *AddressesInsertCall) Header() http.Header {
  26624. if c.header_ == nil {
  26625. c.header_ = make(http.Header)
  26626. }
  26627. return c.header_
  26628. }
  26629. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  26630. reqHeaders := make(http.Header)
  26631. for k, v := range c.header_ {
  26632. reqHeaders[k] = v
  26633. }
  26634. reqHeaders.Set("User-Agent", c.s.userAgent())
  26635. var body io.Reader = nil
  26636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  26637. if err != nil {
  26638. return nil, err
  26639. }
  26640. reqHeaders.Set("Content-Type", "application/json")
  26641. c.urlParams_.Set("alt", alt)
  26642. c.urlParams_.Set("prettyPrint", "false")
  26643. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  26644. urls += "?" + c.urlParams_.Encode()
  26645. req, err := http.NewRequest("POST", urls, body)
  26646. if err != nil {
  26647. return nil, err
  26648. }
  26649. req.Header = reqHeaders
  26650. googleapi.Expand(req.URL, map[string]string{
  26651. "project": c.project,
  26652. "region": c.region,
  26653. })
  26654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26655. }
  26656. // Do executes the "compute.addresses.insert" call.
  26657. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26658. // status code is an error. Response headers are in either
  26659. // *Operation.ServerResponse.Header or (if a response was returned at
  26660. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26661. // to check whether the returned error was because
  26662. // http.StatusNotModified was returned.
  26663. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26664. gensupport.SetOptions(c.urlParams_, opts...)
  26665. res, err := c.doRequest("json")
  26666. if res != nil && res.StatusCode == http.StatusNotModified {
  26667. if res.Body != nil {
  26668. res.Body.Close()
  26669. }
  26670. return nil, &googleapi.Error{
  26671. Code: res.StatusCode,
  26672. Header: res.Header,
  26673. }
  26674. }
  26675. if err != nil {
  26676. return nil, err
  26677. }
  26678. defer googleapi.CloseBody(res)
  26679. if err := googleapi.CheckResponse(res); err != nil {
  26680. return nil, err
  26681. }
  26682. ret := &Operation{
  26683. ServerResponse: googleapi.ServerResponse{
  26684. Header: res.Header,
  26685. HTTPStatusCode: res.StatusCode,
  26686. },
  26687. }
  26688. target := &ret
  26689. if err := gensupport.DecodeResponse(target, res); err != nil {
  26690. return nil, err
  26691. }
  26692. return ret, nil
  26693. // {
  26694. // "description": "Creates an address resource in the specified project using the data included in the request.",
  26695. // "httpMethod": "POST",
  26696. // "id": "compute.addresses.insert",
  26697. // "parameterOrder": [
  26698. // "project",
  26699. // "region"
  26700. // ],
  26701. // "parameters": {
  26702. // "project": {
  26703. // "description": "Project ID for this request.",
  26704. // "location": "path",
  26705. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26706. // "required": true,
  26707. // "type": "string"
  26708. // },
  26709. // "region": {
  26710. // "description": "Name of the region for this request.",
  26711. // "location": "path",
  26712. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26713. // "required": true,
  26714. // "type": "string"
  26715. // },
  26716. // "requestId": {
  26717. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  26718. // "location": "query",
  26719. // "type": "string"
  26720. // }
  26721. // },
  26722. // "path": "{project}/regions/{region}/addresses",
  26723. // "request": {
  26724. // "$ref": "Address"
  26725. // },
  26726. // "response": {
  26727. // "$ref": "Operation"
  26728. // },
  26729. // "scopes": [
  26730. // "https://www.googleapis.com/auth/cloud-platform",
  26731. // "https://www.googleapis.com/auth/compute"
  26732. // ]
  26733. // }
  26734. }
  26735. // method id "compute.addresses.list":
  26736. type AddressesListCall struct {
  26737. s *Service
  26738. project string
  26739. region string
  26740. urlParams_ gensupport.URLParams
  26741. ifNoneMatch_ string
  26742. ctx_ context.Context
  26743. header_ http.Header
  26744. }
  26745. // List: Retrieves a list of addresses contained within the specified
  26746. // region.
  26747. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  26748. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  26749. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26750. c.project = project
  26751. c.region = region
  26752. return c
  26753. }
  26754. // Filter sets the optional parameter "filter": A filter expression that
  26755. // filters resources listed in the response. The expression must specify
  26756. // the field name, a comparison operator, and the value that you want to
  26757. // use for filtering. The value must be a string, a number, or a
  26758. // boolean. The comparison operator must be either =, !=, >, or <.
  26759. //
  26760. // For example, if you are filtering Compute Engine instances, you can
  26761. // exclude instances named example-instance by specifying name !=
  26762. // example-instance.
  26763. //
  26764. // You can also filter nested fields. For example, you could specify
  26765. // scheduling.automaticRestart = false to include instances only if they
  26766. // are not scheduled for automatic restarts. You can use filtering on
  26767. // nested fields to filter based on resource labels.
  26768. //
  26769. // To filter on multiple expressions, provide each separate expression
  26770. // within parentheses. For example, (scheduling.automaticRestart = true)
  26771. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26772. // AND expression. However, you can include AND and OR expressions
  26773. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26774. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26775. // true).
  26776. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  26777. c.urlParams_.Set("filter", filter)
  26778. return c
  26779. }
  26780. // MaxResults sets the optional parameter "maxResults": The maximum
  26781. // number of results per page that should be returned. If the number of
  26782. // available results is larger than maxResults, Compute Engine returns a
  26783. // nextPageToken that can be used to get the next page of results in
  26784. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26785. // (Default: 500)
  26786. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  26787. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26788. return c
  26789. }
  26790. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26791. // a certain order. By default, results are returned in alphanumerical
  26792. // order based on the resource name.
  26793. //
  26794. // You can also sort results in descending order based on the creation
  26795. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26796. // based on the creationTimestamp field in reverse chronological order
  26797. // (newest result first). Use this to sort resources like operations so
  26798. // that the newest operation is returned first.
  26799. //
  26800. // Currently, only sorting by name or creationTimestamp desc is
  26801. // supported.
  26802. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  26803. c.urlParams_.Set("orderBy", orderBy)
  26804. return c
  26805. }
  26806. // PageToken sets the optional parameter "pageToken": Specifies a page
  26807. // token to use. Set pageToken to the nextPageToken returned by a
  26808. // previous list request to get the next page of results.
  26809. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  26810. c.urlParams_.Set("pageToken", pageToken)
  26811. return c
  26812. }
  26813. // Fields allows partial responses to be retrieved. See
  26814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26815. // for more information.
  26816. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  26817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26818. return c
  26819. }
  26820. // IfNoneMatch sets the optional parameter which makes the operation
  26821. // fail if the object's ETag matches the given value. This is useful for
  26822. // getting updates only after the object has changed since the last
  26823. // request. Use googleapi.IsNotModified to check whether the response
  26824. // error from Do is the result of In-None-Match.
  26825. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  26826. c.ifNoneMatch_ = entityTag
  26827. return c
  26828. }
  26829. // Context sets the context to be used in this call's Do method. Any
  26830. // pending HTTP request will be aborted if the provided context is
  26831. // canceled.
  26832. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  26833. c.ctx_ = ctx
  26834. return c
  26835. }
  26836. // Header returns an http.Header that can be modified by the caller to
  26837. // add HTTP headers to the request.
  26838. func (c *AddressesListCall) Header() http.Header {
  26839. if c.header_ == nil {
  26840. c.header_ = make(http.Header)
  26841. }
  26842. return c.header_
  26843. }
  26844. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  26845. reqHeaders := make(http.Header)
  26846. for k, v := range c.header_ {
  26847. reqHeaders[k] = v
  26848. }
  26849. reqHeaders.Set("User-Agent", c.s.userAgent())
  26850. if c.ifNoneMatch_ != "" {
  26851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26852. }
  26853. var body io.Reader = nil
  26854. c.urlParams_.Set("alt", alt)
  26855. c.urlParams_.Set("prettyPrint", "false")
  26856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  26857. urls += "?" + c.urlParams_.Encode()
  26858. req, err := http.NewRequest("GET", urls, body)
  26859. if err != nil {
  26860. return nil, err
  26861. }
  26862. req.Header = reqHeaders
  26863. googleapi.Expand(req.URL, map[string]string{
  26864. "project": c.project,
  26865. "region": c.region,
  26866. })
  26867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26868. }
  26869. // Do executes the "compute.addresses.list" call.
  26870. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  26871. // status code is an error. Response headers are in either
  26872. // *AddressList.ServerResponse.Header or (if a response was returned at
  26873. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26874. // to check whether the returned error was because
  26875. // http.StatusNotModified was returned.
  26876. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  26877. gensupport.SetOptions(c.urlParams_, opts...)
  26878. res, err := c.doRequest("json")
  26879. if res != nil && res.StatusCode == http.StatusNotModified {
  26880. if res.Body != nil {
  26881. res.Body.Close()
  26882. }
  26883. return nil, &googleapi.Error{
  26884. Code: res.StatusCode,
  26885. Header: res.Header,
  26886. }
  26887. }
  26888. if err != nil {
  26889. return nil, err
  26890. }
  26891. defer googleapi.CloseBody(res)
  26892. if err := googleapi.CheckResponse(res); err != nil {
  26893. return nil, err
  26894. }
  26895. ret := &AddressList{
  26896. ServerResponse: googleapi.ServerResponse{
  26897. Header: res.Header,
  26898. HTTPStatusCode: res.StatusCode,
  26899. },
  26900. }
  26901. target := &ret
  26902. if err := gensupport.DecodeResponse(target, res); err != nil {
  26903. return nil, err
  26904. }
  26905. return ret, nil
  26906. // {
  26907. // "description": "Retrieves a list of addresses contained within the specified region.",
  26908. // "httpMethod": "GET",
  26909. // "id": "compute.addresses.list",
  26910. // "parameterOrder": [
  26911. // "project",
  26912. // "region"
  26913. // ],
  26914. // "parameters": {
  26915. // "filter": {
  26916. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26917. // "location": "query",
  26918. // "type": "string"
  26919. // },
  26920. // "maxResults": {
  26921. // "default": "500",
  26922. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26923. // "format": "uint32",
  26924. // "location": "query",
  26925. // "minimum": "0",
  26926. // "type": "integer"
  26927. // },
  26928. // "orderBy": {
  26929. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26930. // "location": "query",
  26931. // "type": "string"
  26932. // },
  26933. // "pageToken": {
  26934. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26935. // "location": "query",
  26936. // "type": "string"
  26937. // },
  26938. // "project": {
  26939. // "description": "Project ID for this request.",
  26940. // "location": "path",
  26941. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26942. // "required": true,
  26943. // "type": "string"
  26944. // },
  26945. // "region": {
  26946. // "description": "Name of the region for this request.",
  26947. // "location": "path",
  26948. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26949. // "required": true,
  26950. // "type": "string"
  26951. // }
  26952. // },
  26953. // "path": "{project}/regions/{region}/addresses",
  26954. // "response": {
  26955. // "$ref": "AddressList"
  26956. // },
  26957. // "scopes": [
  26958. // "https://www.googleapis.com/auth/cloud-platform",
  26959. // "https://www.googleapis.com/auth/compute",
  26960. // "https://www.googleapis.com/auth/compute.readonly"
  26961. // ]
  26962. // }
  26963. }
  26964. // Pages invokes f for each page of results.
  26965. // A non-nil error returned from f will halt the iteration.
  26966. // The provided context supersedes any context provided to the Context method.
  26967. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  26968. c.ctx_ = ctx
  26969. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26970. for {
  26971. x, err := c.Do()
  26972. if err != nil {
  26973. return err
  26974. }
  26975. if err := f(x); err != nil {
  26976. return err
  26977. }
  26978. if x.NextPageToken == "" {
  26979. return nil
  26980. }
  26981. c.PageToken(x.NextPageToken)
  26982. }
  26983. }
  26984. // method id "compute.autoscalers.aggregatedList":
  26985. type AutoscalersAggregatedListCall struct {
  26986. s *Service
  26987. project string
  26988. urlParams_ gensupport.URLParams
  26989. ifNoneMatch_ string
  26990. ctx_ context.Context
  26991. header_ http.Header
  26992. }
  26993. // AggregatedList: Retrieves an aggregated list of autoscalers.
  26994. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  26995. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26996. c.project = project
  26997. return c
  26998. }
  26999. // Filter sets the optional parameter "filter": A filter expression that
  27000. // filters resources listed in the response. The expression must specify
  27001. // the field name, a comparison operator, and the value that you want to
  27002. // use for filtering. The value must be a string, a number, or a
  27003. // boolean. The comparison operator must be either =, !=, >, or <.
  27004. //
  27005. // For example, if you are filtering Compute Engine instances, you can
  27006. // exclude instances named example-instance by specifying name !=
  27007. // example-instance.
  27008. //
  27009. // You can also filter nested fields. For example, you could specify
  27010. // scheduling.automaticRestart = false to include instances only if they
  27011. // are not scheduled for automatic restarts. You can use filtering on
  27012. // nested fields to filter based on resource labels.
  27013. //
  27014. // To filter on multiple expressions, provide each separate expression
  27015. // within parentheses. For example, (scheduling.automaticRestart = true)
  27016. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27017. // AND expression. However, you can include AND and OR expressions
  27018. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27019. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27020. // true).
  27021. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  27022. c.urlParams_.Set("filter", filter)
  27023. return c
  27024. }
  27025. // MaxResults sets the optional parameter "maxResults": The maximum
  27026. // number of results per page that should be returned. If the number of
  27027. // available results is larger than maxResults, Compute Engine returns a
  27028. // nextPageToken that can be used to get the next page of results in
  27029. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27030. // (Default: 500)
  27031. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  27032. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27033. return c
  27034. }
  27035. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27036. // a certain order. By default, results are returned in alphanumerical
  27037. // order based on the resource name.
  27038. //
  27039. // You can also sort results in descending order based on the creation
  27040. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27041. // based on the creationTimestamp field in reverse chronological order
  27042. // (newest result first). Use this to sort resources like operations so
  27043. // that the newest operation is returned first.
  27044. //
  27045. // Currently, only sorting by name or creationTimestamp desc is
  27046. // supported.
  27047. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  27048. c.urlParams_.Set("orderBy", orderBy)
  27049. return c
  27050. }
  27051. // PageToken sets the optional parameter "pageToken": Specifies a page
  27052. // token to use. Set pageToken to the nextPageToken returned by a
  27053. // previous list request to get the next page of results.
  27054. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  27055. c.urlParams_.Set("pageToken", pageToken)
  27056. return c
  27057. }
  27058. // Fields allows partial responses to be retrieved. See
  27059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27060. // for more information.
  27061. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  27062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27063. return c
  27064. }
  27065. // IfNoneMatch sets the optional parameter which makes the operation
  27066. // fail if the object's ETag matches the given value. This is useful for
  27067. // getting updates only after the object has changed since the last
  27068. // request. Use googleapi.IsNotModified to check whether the response
  27069. // error from Do is the result of In-None-Match.
  27070. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  27071. c.ifNoneMatch_ = entityTag
  27072. return c
  27073. }
  27074. // Context sets the context to be used in this call's Do method. Any
  27075. // pending HTTP request will be aborted if the provided context is
  27076. // canceled.
  27077. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  27078. c.ctx_ = ctx
  27079. return c
  27080. }
  27081. // Header returns an http.Header that can be modified by the caller to
  27082. // add HTTP headers to the request.
  27083. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  27084. if c.header_ == nil {
  27085. c.header_ = make(http.Header)
  27086. }
  27087. return c.header_
  27088. }
  27089. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  27090. reqHeaders := make(http.Header)
  27091. for k, v := range c.header_ {
  27092. reqHeaders[k] = v
  27093. }
  27094. reqHeaders.Set("User-Agent", c.s.userAgent())
  27095. if c.ifNoneMatch_ != "" {
  27096. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27097. }
  27098. var body io.Reader = nil
  27099. c.urlParams_.Set("alt", alt)
  27100. c.urlParams_.Set("prettyPrint", "false")
  27101. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  27102. urls += "?" + c.urlParams_.Encode()
  27103. req, err := http.NewRequest("GET", urls, body)
  27104. if err != nil {
  27105. return nil, err
  27106. }
  27107. req.Header = reqHeaders
  27108. googleapi.Expand(req.URL, map[string]string{
  27109. "project": c.project,
  27110. })
  27111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27112. }
  27113. // Do executes the "compute.autoscalers.aggregatedList" call.
  27114. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  27115. // Any non-2xx status code is an error. Response headers are in either
  27116. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  27117. // returned at all) in error.(*googleapi.Error).Header. Use
  27118. // googleapi.IsNotModified to check whether the returned error was
  27119. // because http.StatusNotModified was returned.
  27120. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  27121. gensupport.SetOptions(c.urlParams_, opts...)
  27122. res, err := c.doRequest("json")
  27123. if res != nil && res.StatusCode == http.StatusNotModified {
  27124. if res.Body != nil {
  27125. res.Body.Close()
  27126. }
  27127. return nil, &googleapi.Error{
  27128. Code: res.StatusCode,
  27129. Header: res.Header,
  27130. }
  27131. }
  27132. if err != nil {
  27133. return nil, err
  27134. }
  27135. defer googleapi.CloseBody(res)
  27136. if err := googleapi.CheckResponse(res); err != nil {
  27137. return nil, err
  27138. }
  27139. ret := &AutoscalerAggregatedList{
  27140. ServerResponse: googleapi.ServerResponse{
  27141. Header: res.Header,
  27142. HTTPStatusCode: res.StatusCode,
  27143. },
  27144. }
  27145. target := &ret
  27146. if err := gensupport.DecodeResponse(target, res); err != nil {
  27147. return nil, err
  27148. }
  27149. return ret, nil
  27150. // {
  27151. // "description": "Retrieves an aggregated list of autoscalers.",
  27152. // "httpMethod": "GET",
  27153. // "id": "compute.autoscalers.aggregatedList",
  27154. // "parameterOrder": [
  27155. // "project"
  27156. // ],
  27157. // "parameters": {
  27158. // "filter": {
  27159. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  27160. // "location": "query",
  27161. // "type": "string"
  27162. // },
  27163. // "maxResults": {
  27164. // "default": "500",
  27165. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27166. // "format": "uint32",
  27167. // "location": "query",
  27168. // "minimum": "0",
  27169. // "type": "integer"
  27170. // },
  27171. // "orderBy": {
  27172. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27173. // "location": "query",
  27174. // "type": "string"
  27175. // },
  27176. // "pageToken": {
  27177. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27178. // "location": "query",
  27179. // "type": "string"
  27180. // },
  27181. // "project": {
  27182. // "description": "Project ID for this request.",
  27183. // "location": "path",
  27184. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27185. // "required": true,
  27186. // "type": "string"
  27187. // }
  27188. // },
  27189. // "path": "{project}/aggregated/autoscalers",
  27190. // "response": {
  27191. // "$ref": "AutoscalerAggregatedList"
  27192. // },
  27193. // "scopes": [
  27194. // "https://www.googleapis.com/auth/cloud-platform",
  27195. // "https://www.googleapis.com/auth/compute",
  27196. // "https://www.googleapis.com/auth/compute.readonly"
  27197. // ]
  27198. // }
  27199. }
  27200. // Pages invokes f for each page of results.
  27201. // A non-nil error returned from f will halt the iteration.
  27202. // The provided context supersedes any context provided to the Context method.
  27203. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  27204. c.ctx_ = ctx
  27205. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27206. for {
  27207. x, err := c.Do()
  27208. if err != nil {
  27209. return err
  27210. }
  27211. if err := f(x); err != nil {
  27212. return err
  27213. }
  27214. if x.NextPageToken == "" {
  27215. return nil
  27216. }
  27217. c.PageToken(x.NextPageToken)
  27218. }
  27219. }
  27220. // method id "compute.autoscalers.delete":
  27221. type AutoscalersDeleteCall struct {
  27222. s *Service
  27223. project string
  27224. zone string
  27225. autoscaler string
  27226. urlParams_ gensupport.URLParams
  27227. ctx_ context.Context
  27228. header_ http.Header
  27229. }
  27230. // Delete: Deletes the specified autoscaler.
  27231. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  27232. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27233. c.project = project
  27234. c.zone = zone
  27235. c.autoscaler = autoscaler
  27236. return c
  27237. }
  27238. // RequestId sets the optional parameter "requestId": An optional
  27239. // request ID to identify requests. Specify a unique request ID so that
  27240. // if you must retry your request, the server will know to ignore the
  27241. // request if it has already been completed.
  27242. //
  27243. // For example, consider a situation where you make an initial request
  27244. // and the request times out. If you make the request again with the
  27245. // same request ID, the server can check if original operation with the
  27246. // same request ID was received, and if so, will ignore the second
  27247. // request. This prevents clients from accidentally creating duplicate
  27248. // commitments.
  27249. //
  27250. // The request ID must be a valid UUID with the exception that zero UUID
  27251. // is not supported (00000000-0000-0000-0000-000000000000).
  27252. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  27253. c.urlParams_.Set("requestId", requestId)
  27254. return c
  27255. }
  27256. // Fields allows partial responses to be retrieved. See
  27257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27258. // for more information.
  27259. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  27260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27261. return c
  27262. }
  27263. // Context sets the context to be used in this call's Do method. Any
  27264. // pending HTTP request will be aborted if the provided context is
  27265. // canceled.
  27266. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  27267. c.ctx_ = ctx
  27268. return c
  27269. }
  27270. // Header returns an http.Header that can be modified by the caller to
  27271. // add HTTP headers to the request.
  27272. func (c *AutoscalersDeleteCall) Header() http.Header {
  27273. if c.header_ == nil {
  27274. c.header_ = make(http.Header)
  27275. }
  27276. return c.header_
  27277. }
  27278. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  27279. reqHeaders := make(http.Header)
  27280. for k, v := range c.header_ {
  27281. reqHeaders[k] = v
  27282. }
  27283. reqHeaders.Set("User-Agent", c.s.userAgent())
  27284. var body io.Reader = nil
  27285. c.urlParams_.Set("alt", alt)
  27286. c.urlParams_.Set("prettyPrint", "false")
  27287. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  27288. urls += "?" + c.urlParams_.Encode()
  27289. req, err := http.NewRequest("DELETE", urls, body)
  27290. if err != nil {
  27291. return nil, err
  27292. }
  27293. req.Header = reqHeaders
  27294. googleapi.Expand(req.URL, map[string]string{
  27295. "project": c.project,
  27296. "zone": c.zone,
  27297. "autoscaler": c.autoscaler,
  27298. })
  27299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27300. }
  27301. // Do executes the "compute.autoscalers.delete" call.
  27302. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27303. // status code is an error. Response headers are in either
  27304. // *Operation.ServerResponse.Header or (if a response was returned at
  27305. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27306. // to check whether the returned error was because
  27307. // http.StatusNotModified was returned.
  27308. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27309. gensupport.SetOptions(c.urlParams_, opts...)
  27310. res, err := c.doRequest("json")
  27311. if res != nil && res.StatusCode == http.StatusNotModified {
  27312. if res.Body != nil {
  27313. res.Body.Close()
  27314. }
  27315. return nil, &googleapi.Error{
  27316. Code: res.StatusCode,
  27317. Header: res.Header,
  27318. }
  27319. }
  27320. if err != nil {
  27321. return nil, err
  27322. }
  27323. defer googleapi.CloseBody(res)
  27324. if err := googleapi.CheckResponse(res); err != nil {
  27325. return nil, err
  27326. }
  27327. ret := &Operation{
  27328. ServerResponse: googleapi.ServerResponse{
  27329. Header: res.Header,
  27330. HTTPStatusCode: res.StatusCode,
  27331. },
  27332. }
  27333. target := &ret
  27334. if err := gensupport.DecodeResponse(target, res); err != nil {
  27335. return nil, err
  27336. }
  27337. return ret, nil
  27338. // {
  27339. // "description": "Deletes the specified autoscaler.",
  27340. // "httpMethod": "DELETE",
  27341. // "id": "compute.autoscalers.delete",
  27342. // "parameterOrder": [
  27343. // "project",
  27344. // "zone",
  27345. // "autoscaler"
  27346. // ],
  27347. // "parameters": {
  27348. // "autoscaler": {
  27349. // "description": "Name of the autoscaler to delete.",
  27350. // "location": "path",
  27351. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27352. // "required": true,
  27353. // "type": "string"
  27354. // },
  27355. // "project": {
  27356. // "description": "Project ID for this request.",
  27357. // "location": "path",
  27358. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27359. // "required": true,
  27360. // "type": "string"
  27361. // },
  27362. // "requestId": {
  27363. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  27364. // "location": "query",
  27365. // "type": "string"
  27366. // },
  27367. // "zone": {
  27368. // "description": "Name of the zone for this request.",
  27369. // "location": "path",
  27370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27371. // "required": true,
  27372. // "type": "string"
  27373. // }
  27374. // },
  27375. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  27376. // "response": {
  27377. // "$ref": "Operation"
  27378. // },
  27379. // "scopes": [
  27380. // "https://www.googleapis.com/auth/cloud-platform",
  27381. // "https://www.googleapis.com/auth/compute"
  27382. // ]
  27383. // }
  27384. }
  27385. // method id "compute.autoscalers.get":
  27386. type AutoscalersGetCall struct {
  27387. s *Service
  27388. project string
  27389. zone string
  27390. autoscaler string
  27391. urlParams_ gensupport.URLParams
  27392. ifNoneMatch_ string
  27393. ctx_ context.Context
  27394. header_ http.Header
  27395. }
  27396. // Get: Returns the specified autoscaler resource. Gets a list of
  27397. // available autoscalers by making a list() request.
  27398. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  27399. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27400. c.project = project
  27401. c.zone = zone
  27402. c.autoscaler = autoscaler
  27403. return c
  27404. }
  27405. // Fields allows partial responses to be retrieved. See
  27406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27407. // for more information.
  27408. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  27409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27410. return c
  27411. }
  27412. // IfNoneMatch sets the optional parameter which makes the operation
  27413. // fail if the object's ETag matches the given value. This is useful for
  27414. // getting updates only after the object has changed since the last
  27415. // request. Use googleapi.IsNotModified to check whether the response
  27416. // error from Do is the result of In-None-Match.
  27417. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  27418. c.ifNoneMatch_ = entityTag
  27419. return c
  27420. }
  27421. // Context sets the context to be used in this call's Do method. Any
  27422. // pending HTTP request will be aborted if the provided context is
  27423. // canceled.
  27424. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  27425. c.ctx_ = ctx
  27426. return c
  27427. }
  27428. // Header returns an http.Header that can be modified by the caller to
  27429. // add HTTP headers to the request.
  27430. func (c *AutoscalersGetCall) Header() http.Header {
  27431. if c.header_ == nil {
  27432. c.header_ = make(http.Header)
  27433. }
  27434. return c.header_
  27435. }
  27436. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  27437. reqHeaders := make(http.Header)
  27438. for k, v := range c.header_ {
  27439. reqHeaders[k] = v
  27440. }
  27441. reqHeaders.Set("User-Agent", c.s.userAgent())
  27442. if c.ifNoneMatch_ != "" {
  27443. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27444. }
  27445. var body io.Reader = nil
  27446. c.urlParams_.Set("alt", alt)
  27447. c.urlParams_.Set("prettyPrint", "false")
  27448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  27449. urls += "?" + c.urlParams_.Encode()
  27450. req, err := http.NewRequest("GET", urls, body)
  27451. if err != nil {
  27452. return nil, err
  27453. }
  27454. req.Header = reqHeaders
  27455. googleapi.Expand(req.URL, map[string]string{
  27456. "project": c.project,
  27457. "zone": c.zone,
  27458. "autoscaler": c.autoscaler,
  27459. })
  27460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27461. }
  27462. // Do executes the "compute.autoscalers.get" call.
  27463. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  27464. // status code is an error. Response headers are in either
  27465. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  27466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27467. // to check whether the returned error was because
  27468. // http.StatusNotModified was returned.
  27469. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  27470. gensupport.SetOptions(c.urlParams_, opts...)
  27471. res, err := c.doRequest("json")
  27472. if res != nil && res.StatusCode == http.StatusNotModified {
  27473. if res.Body != nil {
  27474. res.Body.Close()
  27475. }
  27476. return nil, &googleapi.Error{
  27477. Code: res.StatusCode,
  27478. Header: res.Header,
  27479. }
  27480. }
  27481. if err != nil {
  27482. return nil, err
  27483. }
  27484. defer googleapi.CloseBody(res)
  27485. if err := googleapi.CheckResponse(res); err != nil {
  27486. return nil, err
  27487. }
  27488. ret := &Autoscaler{
  27489. ServerResponse: googleapi.ServerResponse{
  27490. Header: res.Header,
  27491. HTTPStatusCode: res.StatusCode,
  27492. },
  27493. }
  27494. target := &ret
  27495. if err := gensupport.DecodeResponse(target, res); err != nil {
  27496. return nil, err
  27497. }
  27498. return ret, nil
  27499. // {
  27500. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  27501. // "httpMethod": "GET",
  27502. // "id": "compute.autoscalers.get",
  27503. // "parameterOrder": [
  27504. // "project",
  27505. // "zone",
  27506. // "autoscaler"
  27507. // ],
  27508. // "parameters": {
  27509. // "autoscaler": {
  27510. // "description": "Name of the autoscaler to return.",
  27511. // "location": "path",
  27512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27513. // "required": true,
  27514. // "type": "string"
  27515. // },
  27516. // "project": {
  27517. // "description": "Project ID for this request.",
  27518. // "location": "path",
  27519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27520. // "required": true,
  27521. // "type": "string"
  27522. // },
  27523. // "zone": {
  27524. // "description": "Name of the zone for this request.",
  27525. // "location": "path",
  27526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27527. // "required": true,
  27528. // "type": "string"
  27529. // }
  27530. // },
  27531. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  27532. // "response": {
  27533. // "$ref": "Autoscaler"
  27534. // },
  27535. // "scopes": [
  27536. // "https://www.googleapis.com/auth/cloud-platform",
  27537. // "https://www.googleapis.com/auth/compute",
  27538. // "https://www.googleapis.com/auth/compute.readonly"
  27539. // ]
  27540. // }
  27541. }
  27542. // method id "compute.autoscalers.insert":
  27543. type AutoscalersInsertCall struct {
  27544. s *Service
  27545. project string
  27546. zone string
  27547. autoscaler *Autoscaler
  27548. urlParams_ gensupport.URLParams
  27549. ctx_ context.Context
  27550. header_ http.Header
  27551. }
  27552. // Insert: Creates an autoscaler in the specified project using the data
  27553. // included in the request.
  27554. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  27555. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27556. c.project = project
  27557. c.zone = zone
  27558. c.autoscaler = autoscaler
  27559. return c
  27560. }
  27561. // RequestId sets the optional parameter "requestId": An optional
  27562. // request ID to identify requests. Specify a unique request ID so that
  27563. // if you must retry your request, the server will know to ignore the
  27564. // request if it has already been completed.
  27565. //
  27566. // For example, consider a situation where you make an initial request
  27567. // and the request times out. If you make the request again with the
  27568. // same request ID, the server can check if original operation with the
  27569. // same request ID was received, and if so, will ignore the second
  27570. // request. This prevents clients from accidentally creating duplicate
  27571. // commitments.
  27572. //
  27573. // The request ID must be a valid UUID with the exception that zero UUID
  27574. // is not supported (00000000-0000-0000-0000-000000000000).
  27575. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  27576. c.urlParams_.Set("requestId", requestId)
  27577. return c
  27578. }
  27579. // Fields allows partial responses to be retrieved. See
  27580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27581. // for more information.
  27582. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  27583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27584. return c
  27585. }
  27586. // Context sets the context to be used in this call's Do method. Any
  27587. // pending HTTP request will be aborted if the provided context is
  27588. // canceled.
  27589. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  27590. c.ctx_ = ctx
  27591. return c
  27592. }
  27593. // Header returns an http.Header that can be modified by the caller to
  27594. // add HTTP headers to the request.
  27595. func (c *AutoscalersInsertCall) Header() http.Header {
  27596. if c.header_ == nil {
  27597. c.header_ = make(http.Header)
  27598. }
  27599. return c.header_
  27600. }
  27601. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  27602. reqHeaders := make(http.Header)
  27603. for k, v := range c.header_ {
  27604. reqHeaders[k] = v
  27605. }
  27606. reqHeaders.Set("User-Agent", c.s.userAgent())
  27607. var body io.Reader = nil
  27608. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  27609. if err != nil {
  27610. return nil, err
  27611. }
  27612. reqHeaders.Set("Content-Type", "application/json")
  27613. c.urlParams_.Set("alt", alt)
  27614. c.urlParams_.Set("prettyPrint", "false")
  27615. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  27616. urls += "?" + c.urlParams_.Encode()
  27617. req, err := http.NewRequest("POST", urls, body)
  27618. if err != nil {
  27619. return nil, err
  27620. }
  27621. req.Header = reqHeaders
  27622. googleapi.Expand(req.URL, map[string]string{
  27623. "project": c.project,
  27624. "zone": c.zone,
  27625. })
  27626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27627. }
  27628. // Do executes the "compute.autoscalers.insert" call.
  27629. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27630. // status code is an error. Response headers are in either
  27631. // *Operation.ServerResponse.Header or (if a response was returned at
  27632. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27633. // to check whether the returned error was because
  27634. // http.StatusNotModified was returned.
  27635. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27636. gensupport.SetOptions(c.urlParams_, opts...)
  27637. res, err := c.doRequest("json")
  27638. if res != nil && res.StatusCode == http.StatusNotModified {
  27639. if res.Body != nil {
  27640. res.Body.Close()
  27641. }
  27642. return nil, &googleapi.Error{
  27643. Code: res.StatusCode,
  27644. Header: res.Header,
  27645. }
  27646. }
  27647. if err != nil {
  27648. return nil, err
  27649. }
  27650. defer googleapi.CloseBody(res)
  27651. if err := googleapi.CheckResponse(res); err != nil {
  27652. return nil, err
  27653. }
  27654. ret := &Operation{
  27655. ServerResponse: googleapi.ServerResponse{
  27656. Header: res.Header,
  27657. HTTPStatusCode: res.StatusCode,
  27658. },
  27659. }
  27660. target := &ret
  27661. if err := gensupport.DecodeResponse(target, res); err != nil {
  27662. return nil, err
  27663. }
  27664. return ret, nil
  27665. // {
  27666. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  27667. // "httpMethod": "POST",
  27668. // "id": "compute.autoscalers.insert",
  27669. // "parameterOrder": [
  27670. // "project",
  27671. // "zone"
  27672. // ],
  27673. // "parameters": {
  27674. // "project": {
  27675. // "description": "Project ID for this request.",
  27676. // "location": "path",
  27677. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27678. // "required": true,
  27679. // "type": "string"
  27680. // },
  27681. // "requestId": {
  27682. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  27683. // "location": "query",
  27684. // "type": "string"
  27685. // },
  27686. // "zone": {
  27687. // "description": "Name of the zone for this request.",
  27688. // "location": "path",
  27689. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27690. // "required": true,
  27691. // "type": "string"
  27692. // }
  27693. // },
  27694. // "path": "{project}/zones/{zone}/autoscalers",
  27695. // "request": {
  27696. // "$ref": "Autoscaler"
  27697. // },
  27698. // "response": {
  27699. // "$ref": "Operation"
  27700. // },
  27701. // "scopes": [
  27702. // "https://www.googleapis.com/auth/cloud-platform",
  27703. // "https://www.googleapis.com/auth/compute"
  27704. // ]
  27705. // }
  27706. }
  27707. // method id "compute.autoscalers.list":
  27708. type AutoscalersListCall struct {
  27709. s *Service
  27710. project string
  27711. zone string
  27712. urlParams_ gensupport.URLParams
  27713. ifNoneMatch_ string
  27714. ctx_ context.Context
  27715. header_ http.Header
  27716. }
  27717. // List: Retrieves a list of autoscalers contained within the specified
  27718. // zone.
  27719. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  27720. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27721. c.project = project
  27722. c.zone = zone
  27723. return c
  27724. }
  27725. // Filter sets the optional parameter "filter": A filter expression that
  27726. // filters resources listed in the response. The expression must specify
  27727. // the field name, a comparison operator, and the value that you want to
  27728. // use for filtering. The value must be a string, a number, or a
  27729. // boolean. The comparison operator must be either =, !=, >, or <.
  27730. //
  27731. // For example, if you are filtering Compute Engine instances, you can
  27732. // exclude instances named example-instance by specifying name !=
  27733. // example-instance.
  27734. //
  27735. // You can also filter nested fields. For example, you could specify
  27736. // scheduling.automaticRestart = false to include instances only if they
  27737. // are not scheduled for automatic restarts. You can use filtering on
  27738. // nested fields to filter based on resource labels.
  27739. //
  27740. // To filter on multiple expressions, provide each separate expression
  27741. // within parentheses. For example, (scheduling.automaticRestart = true)
  27742. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27743. // AND expression. However, you can include AND and OR expressions
  27744. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27745. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27746. // true).
  27747. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  27748. c.urlParams_.Set("filter", filter)
  27749. return c
  27750. }
  27751. // MaxResults sets the optional parameter "maxResults": The maximum
  27752. // number of results per page that should be returned. If the number of
  27753. // available results is larger than maxResults, Compute Engine returns a
  27754. // nextPageToken that can be used to get the next page of results in
  27755. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27756. // (Default: 500)
  27757. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  27758. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27759. return c
  27760. }
  27761. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27762. // a certain order. By default, results are returned in alphanumerical
  27763. // order based on the resource name.
  27764. //
  27765. // You can also sort results in descending order based on the creation
  27766. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27767. // based on the creationTimestamp field in reverse chronological order
  27768. // (newest result first). Use this to sort resources like operations so
  27769. // that the newest operation is returned first.
  27770. //
  27771. // Currently, only sorting by name or creationTimestamp desc is
  27772. // supported.
  27773. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  27774. c.urlParams_.Set("orderBy", orderBy)
  27775. return c
  27776. }
  27777. // PageToken sets the optional parameter "pageToken": Specifies a page
  27778. // token to use. Set pageToken to the nextPageToken returned by a
  27779. // previous list request to get the next page of results.
  27780. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  27781. c.urlParams_.Set("pageToken", pageToken)
  27782. return c
  27783. }
  27784. // Fields allows partial responses to be retrieved. See
  27785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27786. // for more information.
  27787. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  27788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27789. return c
  27790. }
  27791. // IfNoneMatch sets the optional parameter which makes the operation
  27792. // fail if the object's ETag matches the given value. This is useful for
  27793. // getting updates only after the object has changed since the last
  27794. // request. Use googleapi.IsNotModified to check whether the response
  27795. // error from Do is the result of In-None-Match.
  27796. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  27797. c.ifNoneMatch_ = entityTag
  27798. return c
  27799. }
  27800. // Context sets the context to be used in this call's Do method. Any
  27801. // pending HTTP request will be aborted if the provided context is
  27802. // canceled.
  27803. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  27804. c.ctx_ = ctx
  27805. return c
  27806. }
  27807. // Header returns an http.Header that can be modified by the caller to
  27808. // add HTTP headers to the request.
  27809. func (c *AutoscalersListCall) Header() http.Header {
  27810. if c.header_ == nil {
  27811. c.header_ = make(http.Header)
  27812. }
  27813. return c.header_
  27814. }
  27815. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  27816. reqHeaders := make(http.Header)
  27817. for k, v := range c.header_ {
  27818. reqHeaders[k] = v
  27819. }
  27820. reqHeaders.Set("User-Agent", c.s.userAgent())
  27821. if c.ifNoneMatch_ != "" {
  27822. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27823. }
  27824. var body io.Reader = nil
  27825. c.urlParams_.Set("alt", alt)
  27826. c.urlParams_.Set("prettyPrint", "false")
  27827. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  27828. urls += "?" + c.urlParams_.Encode()
  27829. req, err := http.NewRequest("GET", urls, body)
  27830. if err != nil {
  27831. return nil, err
  27832. }
  27833. req.Header = reqHeaders
  27834. googleapi.Expand(req.URL, map[string]string{
  27835. "project": c.project,
  27836. "zone": c.zone,
  27837. })
  27838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27839. }
  27840. // Do executes the "compute.autoscalers.list" call.
  27841. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  27842. // status code is an error. Response headers are in either
  27843. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  27844. // at all) in error.(*googleapi.Error).Header. Use
  27845. // googleapi.IsNotModified to check whether the returned error was
  27846. // because http.StatusNotModified was returned.
  27847. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  27848. gensupport.SetOptions(c.urlParams_, opts...)
  27849. res, err := c.doRequest("json")
  27850. if res != nil && res.StatusCode == http.StatusNotModified {
  27851. if res.Body != nil {
  27852. res.Body.Close()
  27853. }
  27854. return nil, &googleapi.Error{
  27855. Code: res.StatusCode,
  27856. Header: res.Header,
  27857. }
  27858. }
  27859. if err != nil {
  27860. return nil, err
  27861. }
  27862. defer googleapi.CloseBody(res)
  27863. if err := googleapi.CheckResponse(res); err != nil {
  27864. return nil, err
  27865. }
  27866. ret := &AutoscalerList{
  27867. ServerResponse: googleapi.ServerResponse{
  27868. Header: res.Header,
  27869. HTTPStatusCode: res.StatusCode,
  27870. },
  27871. }
  27872. target := &ret
  27873. if err := gensupport.DecodeResponse(target, res); err != nil {
  27874. return nil, err
  27875. }
  27876. return ret, nil
  27877. // {
  27878. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  27879. // "httpMethod": "GET",
  27880. // "id": "compute.autoscalers.list",
  27881. // "parameterOrder": [
  27882. // "project",
  27883. // "zone"
  27884. // ],
  27885. // "parameters": {
  27886. // "filter": {
  27887. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  27888. // "location": "query",
  27889. // "type": "string"
  27890. // },
  27891. // "maxResults": {
  27892. // "default": "500",
  27893. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27894. // "format": "uint32",
  27895. // "location": "query",
  27896. // "minimum": "0",
  27897. // "type": "integer"
  27898. // },
  27899. // "orderBy": {
  27900. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27901. // "location": "query",
  27902. // "type": "string"
  27903. // },
  27904. // "pageToken": {
  27905. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27906. // "location": "query",
  27907. // "type": "string"
  27908. // },
  27909. // "project": {
  27910. // "description": "Project ID for this request.",
  27911. // "location": "path",
  27912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27913. // "required": true,
  27914. // "type": "string"
  27915. // },
  27916. // "zone": {
  27917. // "description": "Name of the zone for this request.",
  27918. // "location": "path",
  27919. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27920. // "required": true,
  27921. // "type": "string"
  27922. // }
  27923. // },
  27924. // "path": "{project}/zones/{zone}/autoscalers",
  27925. // "response": {
  27926. // "$ref": "AutoscalerList"
  27927. // },
  27928. // "scopes": [
  27929. // "https://www.googleapis.com/auth/cloud-platform",
  27930. // "https://www.googleapis.com/auth/compute",
  27931. // "https://www.googleapis.com/auth/compute.readonly"
  27932. // ]
  27933. // }
  27934. }
  27935. // Pages invokes f for each page of results.
  27936. // A non-nil error returned from f will halt the iteration.
  27937. // The provided context supersedes any context provided to the Context method.
  27938. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  27939. c.ctx_ = ctx
  27940. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27941. for {
  27942. x, err := c.Do()
  27943. if err != nil {
  27944. return err
  27945. }
  27946. if err := f(x); err != nil {
  27947. return err
  27948. }
  27949. if x.NextPageToken == "" {
  27950. return nil
  27951. }
  27952. c.PageToken(x.NextPageToken)
  27953. }
  27954. }
  27955. // method id "compute.autoscalers.patch":
  27956. type AutoscalersPatchCall struct {
  27957. s *Service
  27958. project string
  27959. zone string
  27960. autoscaler *Autoscaler
  27961. urlParams_ gensupport.URLParams
  27962. ctx_ context.Context
  27963. header_ http.Header
  27964. }
  27965. // Patch: Updates an autoscaler in the specified project using the data
  27966. // included in the request. This method supports PATCH semantics and
  27967. // uses the JSON merge patch format and processing rules.
  27968. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  27969. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27970. c.project = project
  27971. c.zone = zone
  27972. c.autoscaler = autoscaler
  27973. return c
  27974. }
  27975. // Autoscaler sets the optional parameter "autoscaler": Name of the
  27976. // autoscaler to patch.
  27977. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  27978. c.urlParams_.Set("autoscaler", autoscaler)
  27979. return c
  27980. }
  27981. // RequestId sets the optional parameter "requestId": An optional
  27982. // request ID to identify requests. Specify a unique request ID so that
  27983. // if you must retry your request, the server will know to ignore the
  27984. // request if it has already been completed.
  27985. //
  27986. // For example, consider a situation where you make an initial request
  27987. // and the request times out. If you make the request again with the
  27988. // same request ID, the server can check if original operation with the
  27989. // same request ID was received, and if so, will ignore the second
  27990. // request. This prevents clients from accidentally creating duplicate
  27991. // commitments.
  27992. //
  27993. // The request ID must be a valid UUID with the exception that zero UUID
  27994. // is not supported (00000000-0000-0000-0000-000000000000).
  27995. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  27996. c.urlParams_.Set("requestId", requestId)
  27997. return c
  27998. }
  27999. // Fields allows partial responses to be retrieved. See
  28000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28001. // for more information.
  28002. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  28003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28004. return c
  28005. }
  28006. // Context sets the context to be used in this call's Do method. Any
  28007. // pending HTTP request will be aborted if the provided context is
  28008. // canceled.
  28009. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  28010. c.ctx_ = ctx
  28011. return c
  28012. }
  28013. // Header returns an http.Header that can be modified by the caller to
  28014. // add HTTP headers to the request.
  28015. func (c *AutoscalersPatchCall) Header() http.Header {
  28016. if c.header_ == nil {
  28017. c.header_ = make(http.Header)
  28018. }
  28019. return c.header_
  28020. }
  28021. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  28022. reqHeaders := make(http.Header)
  28023. for k, v := range c.header_ {
  28024. reqHeaders[k] = v
  28025. }
  28026. reqHeaders.Set("User-Agent", c.s.userAgent())
  28027. var body io.Reader = nil
  28028. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  28029. if err != nil {
  28030. return nil, err
  28031. }
  28032. reqHeaders.Set("Content-Type", "application/json")
  28033. c.urlParams_.Set("alt", alt)
  28034. c.urlParams_.Set("prettyPrint", "false")
  28035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28036. urls += "?" + c.urlParams_.Encode()
  28037. req, err := http.NewRequest("PATCH", urls, body)
  28038. if err != nil {
  28039. return nil, err
  28040. }
  28041. req.Header = reqHeaders
  28042. googleapi.Expand(req.URL, map[string]string{
  28043. "project": c.project,
  28044. "zone": c.zone,
  28045. })
  28046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28047. }
  28048. // Do executes the "compute.autoscalers.patch" call.
  28049. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28050. // status code is an error. Response headers are in either
  28051. // *Operation.ServerResponse.Header or (if a response was returned at
  28052. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28053. // to check whether the returned error was because
  28054. // http.StatusNotModified was returned.
  28055. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28056. gensupport.SetOptions(c.urlParams_, opts...)
  28057. res, err := c.doRequest("json")
  28058. if res != nil && res.StatusCode == http.StatusNotModified {
  28059. if res.Body != nil {
  28060. res.Body.Close()
  28061. }
  28062. return nil, &googleapi.Error{
  28063. Code: res.StatusCode,
  28064. Header: res.Header,
  28065. }
  28066. }
  28067. if err != nil {
  28068. return nil, err
  28069. }
  28070. defer googleapi.CloseBody(res)
  28071. if err := googleapi.CheckResponse(res); err != nil {
  28072. return nil, err
  28073. }
  28074. ret := &Operation{
  28075. ServerResponse: googleapi.ServerResponse{
  28076. Header: res.Header,
  28077. HTTPStatusCode: res.StatusCode,
  28078. },
  28079. }
  28080. target := &ret
  28081. if err := gensupport.DecodeResponse(target, res); err != nil {
  28082. return nil, err
  28083. }
  28084. return ret, nil
  28085. // {
  28086. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  28087. // "httpMethod": "PATCH",
  28088. // "id": "compute.autoscalers.patch",
  28089. // "parameterOrder": [
  28090. // "project",
  28091. // "zone"
  28092. // ],
  28093. // "parameters": {
  28094. // "autoscaler": {
  28095. // "description": "Name of the autoscaler to patch.",
  28096. // "location": "query",
  28097. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28098. // "type": "string"
  28099. // },
  28100. // "project": {
  28101. // "description": "Project ID for this request.",
  28102. // "location": "path",
  28103. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28104. // "required": true,
  28105. // "type": "string"
  28106. // },
  28107. // "requestId": {
  28108. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28109. // "location": "query",
  28110. // "type": "string"
  28111. // },
  28112. // "zone": {
  28113. // "description": "Name of the zone for this request.",
  28114. // "location": "path",
  28115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28116. // "required": true,
  28117. // "type": "string"
  28118. // }
  28119. // },
  28120. // "path": "{project}/zones/{zone}/autoscalers",
  28121. // "request": {
  28122. // "$ref": "Autoscaler"
  28123. // },
  28124. // "response": {
  28125. // "$ref": "Operation"
  28126. // },
  28127. // "scopes": [
  28128. // "https://www.googleapis.com/auth/cloud-platform",
  28129. // "https://www.googleapis.com/auth/compute"
  28130. // ]
  28131. // }
  28132. }
  28133. // method id "compute.autoscalers.update":
  28134. type AutoscalersUpdateCall struct {
  28135. s *Service
  28136. project string
  28137. zone string
  28138. autoscaler *Autoscaler
  28139. urlParams_ gensupport.URLParams
  28140. ctx_ context.Context
  28141. header_ http.Header
  28142. }
  28143. // Update: Updates an autoscaler in the specified project using the data
  28144. // included in the request.
  28145. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  28146. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28147. c.project = project
  28148. c.zone = zone
  28149. c.autoscaler = autoscaler
  28150. return c
  28151. }
  28152. // Autoscaler sets the optional parameter "autoscaler": Name of the
  28153. // autoscaler to update.
  28154. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  28155. c.urlParams_.Set("autoscaler", autoscaler)
  28156. return c
  28157. }
  28158. // RequestId sets the optional parameter "requestId": An optional
  28159. // request ID to identify requests. Specify a unique request ID so that
  28160. // if you must retry your request, the server will know to ignore the
  28161. // request if it has already been completed.
  28162. //
  28163. // For example, consider a situation where you make an initial request
  28164. // and the request times out. If you make the request again with the
  28165. // same request ID, the server can check if original operation with the
  28166. // same request ID was received, and if so, will ignore the second
  28167. // request. This prevents clients from accidentally creating duplicate
  28168. // commitments.
  28169. //
  28170. // The request ID must be a valid UUID with the exception that zero UUID
  28171. // is not supported (00000000-0000-0000-0000-000000000000).
  28172. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  28173. c.urlParams_.Set("requestId", requestId)
  28174. return c
  28175. }
  28176. // Fields allows partial responses to be retrieved. See
  28177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28178. // for more information.
  28179. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  28180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28181. return c
  28182. }
  28183. // Context sets the context to be used in this call's Do method. Any
  28184. // pending HTTP request will be aborted if the provided context is
  28185. // canceled.
  28186. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  28187. c.ctx_ = ctx
  28188. return c
  28189. }
  28190. // Header returns an http.Header that can be modified by the caller to
  28191. // add HTTP headers to the request.
  28192. func (c *AutoscalersUpdateCall) Header() http.Header {
  28193. if c.header_ == nil {
  28194. c.header_ = make(http.Header)
  28195. }
  28196. return c.header_
  28197. }
  28198. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  28199. reqHeaders := make(http.Header)
  28200. for k, v := range c.header_ {
  28201. reqHeaders[k] = v
  28202. }
  28203. reqHeaders.Set("User-Agent", c.s.userAgent())
  28204. var body io.Reader = nil
  28205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  28206. if err != nil {
  28207. return nil, err
  28208. }
  28209. reqHeaders.Set("Content-Type", "application/json")
  28210. c.urlParams_.Set("alt", alt)
  28211. c.urlParams_.Set("prettyPrint", "false")
  28212. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28213. urls += "?" + c.urlParams_.Encode()
  28214. req, err := http.NewRequest("PUT", urls, body)
  28215. if err != nil {
  28216. return nil, err
  28217. }
  28218. req.Header = reqHeaders
  28219. googleapi.Expand(req.URL, map[string]string{
  28220. "project": c.project,
  28221. "zone": c.zone,
  28222. })
  28223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28224. }
  28225. // Do executes the "compute.autoscalers.update" call.
  28226. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28227. // status code is an error. Response headers are in either
  28228. // *Operation.ServerResponse.Header or (if a response was returned at
  28229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28230. // to check whether the returned error was because
  28231. // http.StatusNotModified was returned.
  28232. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28233. gensupport.SetOptions(c.urlParams_, opts...)
  28234. res, err := c.doRequest("json")
  28235. if res != nil && res.StatusCode == http.StatusNotModified {
  28236. if res.Body != nil {
  28237. res.Body.Close()
  28238. }
  28239. return nil, &googleapi.Error{
  28240. Code: res.StatusCode,
  28241. Header: res.Header,
  28242. }
  28243. }
  28244. if err != nil {
  28245. return nil, err
  28246. }
  28247. defer googleapi.CloseBody(res)
  28248. if err := googleapi.CheckResponse(res); err != nil {
  28249. return nil, err
  28250. }
  28251. ret := &Operation{
  28252. ServerResponse: googleapi.ServerResponse{
  28253. Header: res.Header,
  28254. HTTPStatusCode: res.StatusCode,
  28255. },
  28256. }
  28257. target := &ret
  28258. if err := gensupport.DecodeResponse(target, res); err != nil {
  28259. return nil, err
  28260. }
  28261. return ret, nil
  28262. // {
  28263. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  28264. // "httpMethod": "PUT",
  28265. // "id": "compute.autoscalers.update",
  28266. // "parameterOrder": [
  28267. // "project",
  28268. // "zone"
  28269. // ],
  28270. // "parameters": {
  28271. // "autoscaler": {
  28272. // "description": "Name of the autoscaler to update.",
  28273. // "location": "query",
  28274. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28275. // "type": "string"
  28276. // },
  28277. // "project": {
  28278. // "description": "Project ID for this request.",
  28279. // "location": "path",
  28280. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28281. // "required": true,
  28282. // "type": "string"
  28283. // },
  28284. // "requestId": {
  28285. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28286. // "location": "query",
  28287. // "type": "string"
  28288. // },
  28289. // "zone": {
  28290. // "description": "Name of the zone for this request.",
  28291. // "location": "path",
  28292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28293. // "required": true,
  28294. // "type": "string"
  28295. // }
  28296. // },
  28297. // "path": "{project}/zones/{zone}/autoscalers",
  28298. // "request": {
  28299. // "$ref": "Autoscaler"
  28300. // },
  28301. // "response": {
  28302. // "$ref": "Operation"
  28303. // },
  28304. // "scopes": [
  28305. // "https://www.googleapis.com/auth/cloud-platform",
  28306. // "https://www.googleapis.com/auth/compute"
  28307. // ]
  28308. // }
  28309. }
  28310. // method id "compute.backendBuckets.addSignedUrlKey":
  28311. type BackendBucketsAddSignedUrlKeyCall struct {
  28312. s *Service
  28313. project string
  28314. backendBucket string
  28315. signedurlkey *SignedUrlKey
  28316. urlParams_ gensupport.URLParams
  28317. ctx_ context.Context
  28318. header_ http.Header
  28319. }
  28320. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  28321. // for this backend bucket.
  28322. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  28323. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28324. c.project = project
  28325. c.backendBucket = backendBucket
  28326. c.signedurlkey = signedurlkey
  28327. return c
  28328. }
  28329. // RequestId sets the optional parameter "requestId": An optional
  28330. // request ID to identify requests. Specify a unique request ID so that
  28331. // if you must retry your request, the server will know to ignore the
  28332. // request if it has already been completed.
  28333. //
  28334. // For example, consider a situation where you make an initial request
  28335. // and the request times out. If you make the request again with the
  28336. // same request ID, the server can check if original operation with the
  28337. // same request ID was received, and if so, will ignore the second
  28338. // request. This prevents clients from accidentally creating duplicate
  28339. // commitments.
  28340. //
  28341. // The request ID must be a valid UUID with the exception that zero UUID
  28342. // is not supported (00000000-0000-0000-0000-000000000000).
  28343. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  28344. c.urlParams_.Set("requestId", requestId)
  28345. return c
  28346. }
  28347. // Fields allows partial responses to be retrieved. See
  28348. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28349. // for more information.
  28350. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  28351. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28352. return c
  28353. }
  28354. // Context sets the context to be used in this call's Do method. Any
  28355. // pending HTTP request will be aborted if the provided context is
  28356. // canceled.
  28357. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  28358. c.ctx_ = ctx
  28359. return c
  28360. }
  28361. // Header returns an http.Header that can be modified by the caller to
  28362. // add HTTP headers to the request.
  28363. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  28364. if c.header_ == nil {
  28365. c.header_ = make(http.Header)
  28366. }
  28367. return c.header_
  28368. }
  28369. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  28370. reqHeaders := make(http.Header)
  28371. for k, v := range c.header_ {
  28372. reqHeaders[k] = v
  28373. }
  28374. reqHeaders.Set("User-Agent", c.s.userAgent())
  28375. var body io.Reader = nil
  28376. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  28377. if err != nil {
  28378. return nil, err
  28379. }
  28380. reqHeaders.Set("Content-Type", "application/json")
  28381. c.urlParams_.Set("alt", alt)
  28382. c.urlParams_.Set("prettyPrint", "false")
  28383. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  28384. urls += "?" + c.urlParams_.Encode()
  28385. req, err := http.NewRequest("POST", urls, body)
  28386. if err != nil {
  28387. return nil, err
  28388. }
  28389. req.Header = reqHeaders
  28390. googleapi.Expand(req.URL, map[string]string{
  28391. "project": c.project,
  28392. "backendBucket": c.backendBucket,
  28393. })
  28394. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28395. }
  28396. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  28397. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28398. // status code is an error. Response headers are in either
  28399. // *Operation.ServerResponse.Header or (if a response was returned at
  28400. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28401. // to check whether the returned error was because
  28402. // http.StatusNotModified was returned.
  28403. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28404. gensupport.SetOptions(c.urlParams_, opts...)
  28405. res, err := c.doRequest("json")
  28406. if res != nil && res.StatusCode == http.StatusNotModified {
  28407. if res.Body != nil {
  28408. res.Body.Close()
  28409. }
  28410. return nil, &googleapi.Error{
  28411. Code: res.StatusCode,
  28412. Header: res.Header,
  28413. }
  28414. }
  28415. if err != nil {
  28416. return nil, err
  28417. }
  28418. defer googleapi.CloseBody(res)
  28419. if err := googleapi.CheckResponse(res); err != nil {
  28420. return nil, err
  28421. }
  28422. ret := &Operation{
  28423. ServerResponse: googleapi.ServerResponse{
  28424. Header: res.Header,
  28425. HTTPStatusCode: res.StatusCode,
  28426. },
  28427. }
  28428. target := &ret
  28429. if err := gensupport.DecodeResponse(target, res); err != nil {
  28430. return nil, err
  28431. }
  28432. return ret, nil
  28433. // {
  28434. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  28435. // "httpMethod": "POST",
  28436. // "id": "compute.backendBuckets.addSignedUrlKey",
  28437. // "parameterOrder": [
  28438. // "project",
  28439. // "backendBucket"
  28440. // ],
  28441. // "parameters": {
  28442. // "backendBucket": {
  28443. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  28444. // "location": "path",
  28445. // "required": true,
  28446. // "type": "string"
  28447. // },
  28448. // "project": {
  28449. // "description": "Project ID for this request.",
  28450. // "location": "path",
  28451. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28452. // "required": true,
  28453. // "type": "string"
  28454. // },
  28455. // "requestId": {
  28456. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28457. // "location": "query",
  28458. // "type": "string"
  28459. // }
  28460. // },
  28461. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  28462. // "request": {
  28463. // "$ref": "SignedUrlKey"
  28464. // },
  28465. // "response": {
  28466. // "$ref": "Operation"
  28467. // },
  28468. // "scopes": [
  28469. // "https://www.googleapis.com/auth/cloud-platform",
  28470. // "https://www.googleapis.com/auth/compute"
  28471. // ]
  28472. // }
  28473. }
  28474. // method id "compute.backendBuckets.delete":
  28475. type BackendBucketsDeleteCall struct {
  28476. s *Service
  28477. project string
  28478. backendBucket string
  28479. urlParams_ gensupport.URLParams
  28480. ctx_ context.Context
  28481. header_ http.Header
  28482. }
  28483. // Delete: Deletes the specified BackendBucket resource.
  28484. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  28485. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28486. c.project = project
  28487. c.backendBucket = backendBucket
  28488. return c
  28489. }
  28490. // RequestId sets the optional parameter "requestId": An optional
  28491. // request ID to identify requests. Specify a unique request ID so that
  28492. // if you must retry your request, the server will know to ignore the
  28493. // request if it has already been completed.
  28494. //
  28495. // For example, consider a situation where you make an initial request
  28496. // and the request times out. If you make the request again with the
  28497. // same request ID, the server can check if original operation with the
  28498. // same request ID was received, and if so, will ignore the second
  28499. // request. This prevents clients from accidentally creating duplicate
  28500. // commitments.
  28501. //
  28502. // The request ID must be a valid UUID with the exception that zero UUID
  28503. // is not supported (00000000-0000-0000-0000-000000000000).
  28504. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  28505. c.urlParams_.Set("requestId", requestId)
  28506. return c
  28507. }
  28508. // Fields allows partial responses to be retrieved. See
  28509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28510. // for more information.
  28511. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  28512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28513. return c
  28514. }
  28515. // Context sets the context to be used in this call's Do method. Any
  28516. // pending HTTP request will be aborted if the provided context is
  28517. // canceled.
  28518. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  28519. c.ctx_ = ctx
  28520. return c
  28521. }
  28522. // Header returns an http.Header that can be modified by the caller to
  28523. // add HTTP headers to the request.
  28524. func (c *BackendBucketsDeleteCall) Header() http.Header {
  28525. if c.header_ == nil {
  28526. c.header_ = make(http.Header)
  28527. }
  28528. return c.header_
  28529. }
  28530. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  28531. reqHeaders := make(http.Header)
  28532. for k, v := range c.header_ {
  28533. reqHeaders[k] = v
  28534. }
  28535. reqHeaders.Set("User-Agent", c.s.userAgent())
  28536. var body io.Reader = nil
  28537. c.urlParams_.Set("alt", alt)
  28538. c.urlParams_.Set("prettyPrint", "false")
  28539. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  28540. urls += "?" + c.urlParams_.Encode()
  28541. req, err := http.NewRequest("DELETE", urls, body)
  28542. if err != nil {
  28543. return nil, err
  28544. }
  28545. req.Header = reqHeaders
  28546. googleapi.Expand(req.URL, map[string]string{
  28547. "project": c.project,
  28548. "backendBucket": c.backendBucket,
  28549. })
  28550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28551. }
  28552. // Do executes the "compute.backendBuckets.delete" call.
  28553. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28554. // status code is an error. Response headers are in either
  28555. // *Operation.ServerResponse.Header or (if a response was returned at
  28556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28557. // to check whether the returned error was because
  28558. // http.StatusNotModified was returned.
  28559. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28560. gensupport.SetOptions(c.urlParams_, opts...)
  28561. res, err := c.doRequest("json")
  28562. if res != nil && res.StatusCode == http.StatusNotModified {
  28563. if res.Body != nil {
  28564. res.Body.Close()
  28565. }
  28566. return nil, &googleapi.Error{
  28567. Code: res.StatusCode,
  28568. Header: res.Header,
  28569. }
  28570. }
  28571. if err != nil {
  28572. return nil, err
  28573. }
  28574. defer googleapi.CloseBody(res)
  28575. if err := googleapi.CheckResponse(res); err != nil {
  28576. return nil, err
  28577. }
  28578. ret := &Operation{
  28579. ServerResponse: googleapi.ServerResponse{
  28580. Header: res.Header,
  28581. HTTPStatusCode: res.StatusCode,
  28582. },
  28583. }
  28584. target := &ret
  28585. if err := gensupport.DecodeResponse(target, res); err != nil {
  28586. return nil, err
  28587. }
  28588. return ret, nil
  28589. // {
  28590. // "description": "Deletes the specified BackendBucket resource.",
  28591. // "httpMethod": "DELETE",
  28592. // "id": "compute.backendBuckets.delete",
  28593. // "parameterOrder": [
  28594. // "project",
  28595. // "backendBucket"
  28596. // ],
  28597. // "parameters": {
  28598. // "backendBucket": {
  28599. // "description": "Name of the BackendBucket resource to delete.",
  28600. // "location": "path",
  28601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28602. // "required": true,
  28603. // "type": "string"
  28604. // },
  28605. // "project": {
  28606. // "description": "Project ID for this request.",
  28607. // "location": "path",
  28608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28609. // "required": true,
  28610. // "type": "string"
  28611. // },
  28612. // "requestId": {
  28613. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28614. // "location": "query",
  28615. // "type": "string"
  28616. // }
  28617. // },
  28618. // "path": "{project}/global/backendBuckets/{backendBucket}",
  28619. // "response": {
  28620. // "$ref": "Operation"
  28621. // },
  28622. // "scopes": [
  28623. // "https://www.googleapis.com/auth/cloud-platform",
  28624. // "https://www.googleapis.com/auth/compute"
  28625. // ]
  28626. // }
  28627. }
  28628. // method id "compute.backendBuckets.deleteSignedUrlKey":
  28629. type BackendBucketsDeleteSignedUrlKeyCall struct {
  28630. s *Service
  28631. project string
  28632. backendBucket string
  28633. urlParams_ gensupport.URLParams
  28634. ctx_ context.Context
  28635. header_ http.Header
  28636. }
  28637. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  28638. // URLs for this backend bucket.
  28639. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  28640. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28641. c.project = project
  28642. c.backendBucket = backendBucket
  28643. c.urlParams_.Set("keyName", keyName)
  28644. return c
  28645. }
  28646. // RequestId sets the optional parameter "requestId": An optional
  28647. // request ID to identify requests. Specify a unique request ID so that
  28648. // if you must retry your request, the server will know to ignore the
  28649. // request if it has already been completed.
  28650. //
  28651. // For example, consider a situation where you make an initial request
  28652. // and the request times out. If you make the request again with the
  28653. // same request ID, the server can check if original operation with the
  28654. // same request ID was received, and if so, will ignore the second
  28655. // request. This prevents clients from accidentally creating duplicate
  28656. // commitments.
  28657. //
  28658. // The request ID must be a valid UUID with the exception that zero UUID
  28659. // is not supported (00000000-0000-0000-0000-000000000000).
  28660. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  28661. c.urlParams_.Set("requestId", requestId)
  28662. return c
  28663. }
  28664. // Fields allows partial responses to be retrieved. See
  28665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28666. // for more information.
  28667. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  28668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28669. return c
  28670. }
  28671. // Context sets the context to be used in this call's Do method. Any
  28672. // pending HTTP request will be aborted if the provided context is
  28673. // canceled.
  28674. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  28675. c.ctx_ = ctx
  28676. return c
  28677. }
  28678. // Header returns an http.Header that can be modified by the caller to
  28679. // add HTTP headers to the request.
  28680. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  28681. if c.header_ == nil {
  28682. c.header_ = make(http.Header)
  28683. }
  28684. return c.header_
  28685. }
  28686. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  28687. reqHeaders := make(http.Header)
  28688. for k, v := range c.header_ {
  28689. reqHeaders[k] = v
  28690. }
  28691. reqHeaders.Set("User-Agent", c.s.userAgent())
  28692. var body io.Reader = nil
  28693. c.urlParams_.Set("alt", alt)
  28694. c.urlParams_.Set("prettyPrint", "false")
  28695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  28696. urls += "?" + c.urlParams_.Encode()
  28697. req, err := http.NewRequest("POST", urls, body)
  28698. if err != nil {
  28699. return nil, err
  28700. }
  28701. req.Header = reqHeaders
  28702. googleapi.Expand(req.URL, map[string]string{
  28703. "project": c.project,
  28704. "backendBucket": c.backendBucket,
  28705. })
  28706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28707. }
  28708. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  28709. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28710. // status code is an error. Response headers are in either
  28711. // *Operation.ServerResponse.Header or (if a response was returned at
  28712. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28713. // to check whether the returned error was because
  28714. // http.StatusNotModified was returned.
  28715. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28716. gensupport.SetOptions(c.urlParams_, opts...)
  28717. res, err := c.doRequest("json")
  28718. if res != nil && res.StatusCode == http.StatusNotModified {
  28719. if res.Body != nil {
  28720. res.Body.Close()
  28721. }
  28722. return nil, &googleapi.Error{
  28723. Code: res.StatusCode,
  28724. Header: res.Header,
  28725. }
  28726. }
  28727. if err != nil {
  28728. return nil, err
  28729. }
  28730. defer googleapi.CloseBody(res)
  28731. if err := googleapi.CheckResponse(res); err != nil {
  28732. return nil, err
  28733. }
  28734. ret := &Operation{
  28735. ServerResponse: googleapi.ServerResponse{
  28736. Header: res.Header,
  28737. HTTPStatusCode: res.StatusCode,
  28738. },
  28739. }
  28740. target := &ret
  28741. if err := gensupport.DecodeResponse(target, res); err != nil {
  28742. return nil, err
  28743. }
  28744. return ret, nil
  28745. // {
  28746. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  28747. // "httpMethod": "POST",
  28748. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  28749. // "parameterOrder": [
  28750. // "project",
  28751. // "backendBucket",
  28752. // "keyName"
  28753. // ],
  28754. // "parameters": {
  28755. // "backendBucket": {
  28756. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  28757. // "location": "path",
  28758. // "required": true,
  28759. // "type": "string"
  28760. // },
  28761. // "keyName": {
  28762. // "description": "The name of the Signed URL Key to delete.",
  28763. // "location": "query",
  28764. // "required": true,
  28765. // "type": "string"
  28766. // },
  28767. // "project": {
  28768. // "description": "Project ID for this request.",
  28769. // "location": "path",
  28770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28771. // "required": true,
  28772. // "type": "string"
  28773. // },
  28774. // "requestId": {
  28775. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28776. // "location": "query",
  28777. // "type": "string"
  28778. // }
  28779. // },
  28780. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  28781. // "response": {
  28782. // "$ref": "Operation"
  28783. // },
  28784. // "scopes": [
  28785. // "https://www.googleapis.com/auth/cloud-platform",
  28786. // "https://www.googleapis.com/auth/compute"
  28787. // ]
  28788. // }
  28789. }
  28790. // method id "compute.backendBuckets.get":
  28791. type BackendBucketsGetCall struct {
  28792. s *Service
  28793. project string
  28794. backendBucket string
  28795. urlParams_ gensupport.URLParams
  28796. ifNoneMatch_ string
  28797. ctx_ context.Context
  28798. header_ http.Header
  28799. }
  28800. // Get: Returns the specified BackendBucket resource. Gets a list of
  28801. // available backend buckets by making a list() request.
  28802. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  28803. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28804. c.project = project
  28805. c.backendBucket = backendBucket
  28806. return c
  28807. }
  28808. // Fields allows partial responses to be retrieved. See
  28809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28810. // for more information.
  28811. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  28812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28813. return c
  28814. }
  28815. // IfNoneMatch sets the optional parameter which makes the operation
  28816. // fail if the object's ETag matches the given value. This is useful for
  28817. // getting updates only after the object has changed since the last
  28818. // request. Use googleapi.IsNotModified to check whether the response
  28819. // error from Do is the result of In-None-Match.
  28820. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  28821. c.ifNoneMatch_ = entityTag
  28822. return c
  28823. }
  28824. // Context sets the context to be used in this call's Do method. Any
  28825. // pending HTTP request will be aborted if the provided context is
  28826. // canceled.
  28827. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  28828. c.ctx_ = ctx
  28829. return c
  28830. }
  28831. // Header returns an http.Header that can be modified by the caller to
  28832. // add HTTP headers to the request.
  28833. func (c *BackendBucketsGetCall) Header() http.Header {
  28834. if c.header_ == nil {
  28835. c.header_ = make(http.Header)
  28836. }
  28837. return c.header_
  28838. }
  28839. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  28840. reqHeaders := make(http.Header)
  28841. for k, v := range c.header_ {
  28842. reqHeaders[k] = v
  28843. }
  28844. reqHeaders.Set("User-Agent", c.s.userAgent())
  28845. if c.ifNoneMatch_ != "" {
  28846. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28847. }
  28848. var body io.Reader = nil
  28849. c.urlParams_.Set("alt", alt)
  28850. c.urlParams_.Set("prettyPrint", "false")
  28851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  28852. urls += "?" + c.urlParams_.Encode()
  28853. req, err := http.NewRequest("GET", urls, body)
  28854. if err != nil {
  28855. return nil, err
  28856. }
  28857. req.Header = reqHeaders
  28858. googleapi.Expand(req.URL, map[string]string{
  28859. "project": c.project,
  28860. "backendBucket": c.backendBucket,
  28861. })
  28862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28863. }
  28864. // Do executes the "compute.backendBuckets.get" call.
  28865. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  28866. // status code is an error. Response headers are in either
  28867. // *BackendBucket.ServerResponse.Header or (if a response was returned
  28868. // at all) in error.(*googleapi.Error).Header. Use
  28869. // googleapi.IsNotModified to check whether the returned error was
  28870. // because http.StatusNotModified was returned.
  28871. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  28872. gensupport.SetOptions(c.urlParams_, opts...)
  28873. res, err := c.doRequest("json")
  28874. if res != nil && res.StatusCode == http.StatusNotModified {
  28875. if res.Body != nil {
  28876. res.Body.Close()
  28877. }
  28878. return nil, &googleapi.Error{
  28879. Code: res.StatusCode,
  28880. Header: res.Header,
  28881. }
  28882. }
  28883. if err != nil {
  28884. return nil, err
  28885. }
  28886. defer googleapi.CloseBody(res)
  28887. if err := googleapi.CheckResponse(res); err != nil {
  28888. return nil, err
  28889. }
  28890. ret := &BackendBucket{
  28891. ServerResponse: googleapi.ServerResponse{
  28892. Header: res.Header,
  28893. HTTPStatusCode: res.StatusCode,
  28894. },
  28895. }
  28896. target := &ret
  28897. if err := gensupport.DecodeResponse(target, res); err != nil {
  28898. return nil, err
  28899. }
  28900. return ret, nil
  28901. // {
  28902. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  28903. // "httpMethod": "GET",
  28904. // "id": "compute.backendBuckets.get",
  28905. // "parameterOrder": [
  28906. // "project",
  28907. // "backendBucket"
  28908. // ],
  28909. // "parameters": {
  28910. // "backendBucket": {
  28911. // "description": "Name of the BackendBucket resource to return.",
  28912. // "location": "path",
  28913. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28914. // "required": true,
  28915. // "type": "string"
  28916. // },
  28917. // "project": {
  28918. // "description": "Project ID for this request.",
  28919. // "location": "path",
  28920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28921. // "required": true,
  28922. // "type": "string"
  28923. // }
  28924. // },
  28925. // "path": "{project}/global/backendBuckets/{backendBucket}",
  28926. // "response": {
  28927. // "$ref": "BackendBucket"
  28928. // },
  28929. // "scopes": [
  28930. // "https://www.googleapis.com/auth/cloud-platform",
  28931. // "https://www.googleapis.com/auth/compute",
  28932. // "https://www.googleapis.com/auth/compute.readonly"
  28933. // ]
  28934. // }
  28935. }
  28936. // method id "compute.backendBuckets.insert":
  28937. type BackendBucketsInsertCall struct {
  28938. s *Service
  28939. project string
  28940. backendbucket *BackendBucket
  28941. urlParams_ gensupport.URLParams
  28942. ctx_ context.Context
  28943. header_ http.Header
  28944. }
  28945. // Insert: Creates a BackendBucket resource in the specified project
  28946. // using the data included in the request.
  28947. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  28948. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28949. c.project = project
  28950. c.backendbucket = backendbucket
  28951. return c
  28952. }
  28953. // RequestId sets the optional parameter "requestId": An optional
  28954. // request ID to identify requests. Specify a unique request ID so that
  28955. // if you must retry your request, the server will know to ignore the
  28956. // request if it has already been completed.
  28957. //
  28958. // For example, consider a situation where you make an initial request
  28959. // and the request times out. If you make the request again with the
  28960. // same request ID, the server can check if original operation with the
  28961. // same request ID was received, and if so, will ignore the second
  28962. // request. This prevents clients from accidentally creating duplicate
  28963. // commitments.
  28964. //
  28965. // The request ID must be a valid UUID with the exception that zero UUID
  28966. // is not supported (00000000-0000-0000-0000-000000000000).
  28967. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  28968. c.urlParams_.Set("requestId", requestId)
  28969. return c
  28970. }
  28971. // Fields allows partial responses to be retrieved. See
  28972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28973. // for more information.
  28974. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  28975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28976. return c
  28977. }
  28978. // Context sets the context to be used in this call's Do method. Any
  28979. // pending HTTP request will be aborted if the provided context is
  28980. // canceled.
  28981. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  28982. c.ctx_ = ctx
  28983. return c
  28984. }
  28985. // Header returns an http.Header that can be modified by the caller to
  28986. // add HTTP headers to the request.
  28987. func (c *BackendBucketsInsertCall) Header() http.Header {
  28988. if c.header_ == nil {
  28989. c.header_ = make(http.Header)
  28990. }
  28991. return c.header_
  28992. }
  28993. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  28994. reqHeaders := make(http.Header)
  28995. for k, v := range c.header_ {
  28996. reqHeaders[k] = v
  28997. }
  28998. reqHeaders.Set("User-Agent", c.s.userAgent())
  28999. var body io.Reader = nil
  29000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  29001. if err != nil {
  29002. return nil, err
  29003. }
  29004. reqHeaders.Set("Content-Type", "application/json")
  29005. c.urlParams_.Set("alt", alt)
  29006. c.urlParams_.Set("prettyPrint", "false")
  29007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  29008. urls += "?" + c.urlParams_.Encode()
  29009. req, err := http.NewRequest("POST", urls, body)
  29010. if err != nil {
  29011. return nil, err
  29012. }
  29013. req.Header = reqHeaders
  29014. googleapi.Expand(req.URL, map[string]string{
  29015. "project": c.project,
  29016. })
  29017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29018. }
  29019. // Do executes the "compute.backendBuckets.insert" call.
  29020. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29021. // status code is an error. Response headers are in either
  29022. // *Operation.ServerResponse.Header or (if a response was returned at
  29023. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29024. // to check whether the returned error was because
  29025. // http.StatusNotModified was returned.
  29026. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29027. gensupport.SetOptions(c.urlParams_, opts...)
  29028. res, err := c.doRequest("json")
  29029. if res != nil && res.StatusCode == http.StatusNotModified {
  29030. if res.Body != nil {
  29031. res.Body.Close()
  29032. }
  29033. return nil, &googleapi.Error{
  29034. Code: res.StatusCode,
  29035. Header: res.Header,
  29036. }
  29037. }
  29038. if err != nil {
  29039. return nil, err
  29040. }
  29041. defer googleapi.CloseBody(res)
  29042. if err := googleapi.CheckResponse(res); err != nil {
  29043. return nil, err
  29044. }
  29045. ret := &Operation{
  29046. ServerResponse: googleapi.ServerResponse{
  29047. Header: res.Header,
  29048. HTTPStatusCode: res.StatusCode,
  29049. },
  29050. }
  29051. target := &ret
  29052. if err := gensupport.DecodeResponse(target, res); err != nil {
  29053. return nil, err
  29054. }
  29055. return ret, nil
  29056. // {
  29057. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  29058. // "httpMethod": "POST",
  29059. // "id": "compute.backendBuckets.insert",
  29060. // "parameterOrder": [
  29061. // "project"
  29062. // ],
  29063. // "parameters": {
  29064. // "project": {
  29065. // "description": "Project ID for this request.",
  29066. // "location": "path",
  29067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29068. // "required": true,
  29069. // "type": "string"
  29070. // },
  29071. // "requestId": {
  29072. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29073. // "location": "query",
  29074. // "type": "string"
  29075. // }
  29076. // },
  29077. // "path": "{project}/global/backendBuckets",
  29078. // "request": {
  29079. // "$ref": "BackendBucket"
  29080. // },
  29081. // "response": {
  29082. // "$ref": "Operation"
  29083. // },
  29084. // "scopes": [
  29085. // "https://www.googleapis.com/auth/cloud-platform",
  29086. // "https://www.googleapis.com/auth/compute"
  29087. // ]
  29088. // }
  29089. }
  29090. // method id "compute.backendBuckets.list":
  29091. type BackendBucketsListCall struct {
  29092. s *Service
  29093. project string
  29094. urlParams_ gensupport.URLParams
  29095. ifNoneMatch_ string
  29096. ctx_ context.Context
  29097. header_ http.Header
  29098. }
  29099. // List: Retrieves the list of BackendBucket resources available to the
  29100. // specified project.
  29101. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  29102. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29103. c.project = project
  29104. return c
  29105. }
  29106. // Filter sets the optional parameter "filter": A filter expression that
  29107. // filters resources listed in the response. The expression must specify
  29108. // the field name, a comparison operator, and the value that you want to
  29109. // use for filtering. The value must be a string, a number, or a
  29110. // boolean. The comparison operator must be either =, !=, >, or <.
  29111. //
  29112. // For example, if you are filtering Compute Engine instances, you can
  29113. // exclude instances named example-instance by specifying name !=
  29114. // example-instance.
  29115. //
  29116. // You can also filter nested fields. For example, you could specify
  29117. // scheduling.automaticRestart = false to include instances only if they
  29118. // are not scheduled for automatic restarts. You can use filtering on
  29119. // nested fields to filter based on resource labels.
  29120. //
  29121. // To filter on multiple expressions, provide each separate expression
  29122. // within parentheses. For example, (scheduling.automaticRestart = true)
  29123. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29124. // AND expression. However, you can include AND and OR expressions
  29125. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29126. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29127. // true).
  29128. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  29129. c.urlParams_.Set("filter", filter)
  29130. return c
  29131. }
  29132. // MaxResults sets the optional parameter "maxResults": The maximum
  29133. // number of results per page that should be returned. If the number of
  29134. // available results is larger than maxResults, Compute Engine returns a
  29135. // nextPageToken that can be used to get the next page of results in
  29136. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29137. // (Default: 500)
  29138. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  29139. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29140. return c
  29141. }
  29142. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29143. // a certain order. By default, results are returned in alphanumerical
  29144. // order based on the resource name.
  29145. //
  29146. // You can also sort results in descending order based on the creation
  29147. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29148. // based on the creationTimestamp field in reverse chronological order
  29149. // (newest result first). Use this to sort resources like operations so
  29150. // that the newest operation is returned first.
  29151. //
  29152. // Currently, only sorting by name or creationTimestamp desc is
  29153. // supported.
  29154. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  29155. c.urlParams_.Set("orderBy", orderBy)
  29156. return c
  29157. }
  29158. // PageToken sets the optional parameter "pageToken": Specifies a page
  29159. // token to use. Set pageToken to the nextPageToken returned by a
  29160. // previous list request to get the next page of results.
  29161. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  29162. c.urlParams_.Set("pageToken", pageToken)
  29163. return c
  29164. }
  29165. // Fields allows partial responses to be retrieved. See
  29166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29167. // for more information.
  29168. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  29169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29170. return c
  29171. }
  29172. // IfNoneMatch sets the optional parameter which makes the operation
  29173. // fail if the object's ETag matches the given value. This is useful for
  29174. // getting updates only after the object has changed since the last
  29175. // request. Use googleapi.IsNotModified to check whether the response
  29176. // error from Do is the result of In-None-Match.
  29177. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  29178. c.ifNoneMatch_ = entityTag
  29179. return c
  29180. }
  29181. // Context sets the context to be used in this call's Do method. Any
  29182. // pending HTTP request will be aborted if the provided context is
  29183. // canceled.
  29184. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  29185. c.ctx_ = ctx
  29186. return c
  29187. }
  29188. // Header returns an http.Header that can be modified by the caller to
  29189. // add HTTP headers to the request.
  29190. func (c *BackendBucketsListCall) Header() http.Header {
  29191. if c.header_ == nil {
  29192. c.header_ = make(http.Header)
  29193. }
  29194. return c.header_
  29195. }
  29196. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  29197. reqHeaders := make(http.Header)
  29198. for k, v := range c.header_ {
  29199. reqHeaders[k] = v
  29200. }
  29201. reqHeaders.Set("User-Agent", c.s.userAgent())
  29202. if c.ifNoneMatch_ != "" {
  29203. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29204. }
  29205. var body io.Reader = nil
  29206. c.urlParams_.Set("alt", alt)
  29207. c.urlParams_.Set("prettyPrint", "false")
  29208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  29209. urls += "?" + c.urlParams_.Encode()
  29210. req, err := http.NewRequest("GET", urls, body)
  29211. if err != nil {
  29212. return nil, err
  29213. }
  29214. req.Header = reqHeaders
  29215. googleapi.Expand(req.URL, map[string]string{
  29216. "project": c.project,
  29217. })
  29218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29219. }
  29220. // Do executes the "compute.backendBuckets.list" call.
  29221. // Exactly one of *BackendBucketList or error will be non-nil. Any
  29222. // non-2xx status code is an error. Response headers are in either
  29223. // *BackendBucketList.ServerResponse.Header or (if a response was
  29224. // returned at all) in error.(*googleapi.Error).Header. Use
  29225. // googleapi.IsNotModified to check whether the returned error was
  29226. // because http.StatusNotModified was returned.
  29227. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  29228. gensupport.SetOptions(c.urlParams_, opts...)
  29229. res, err := c.doRequest("json")
  29230. if res != nil && res.StatusCode == http.StatusNotModified {
  29231. if res.Body != nil {
  29232. res.Body.Close()
  29233. }
  29234. return nil, &googleapi.Error{
  29235. Code: res.StatusCode,
  29236. Header: res.Header,
  29237. }
  29238. }
  29239. if err != nil {
  29240. return nil, err
  29241. }
  29242. defer googleapi.CloseBody(res)
  29243. if err := googleapi.CheckResponse(res); err != nil {
  29244. return nil, err
  29245. }
  29246. ret := &BackendBucketList{
  29247. ServerResponse: googleapi.ServerResponse{
  29248. Header: res.Header,
  29249. HTTPStatusCode: res.StatusCode,
  29250. },
  29251. }
  29252. target := &ret
  29253. if err := gensupport.DecodeResponse(target, res); err != nil {
  29254. return nil, err
  29255. }
  29256. return ret, nil
  29257. // {
  29258. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  29259. // "httpMethod": "GET",
  29260. // "id": "compute.backendBuckets.list",
  29261. // "parameterOrder": [
  29262. // "project"
  29263. // ],
  29264. // "parameters": {
  29265. // "filter": {
  29266. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  29267. // "location": "query",
  29268. // "type": "string"
  29269. // },
  29270. // "maxResults": {
  29271. // "default": "500",
  29272. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  29273. // "format": "uint32",
  29274. // "location": "query",
  29275. // "minimum": "0",
  29276. // "type": "integer"
  29277. // },
  29278. // "orderBy": {
  29279. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  29280. // "location": "query",
  29281. // "type": "string"
  29282. // },
  29283. // "pageToken": {
  29284. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  29285. // "location": "query",
  29286. // "type": "string"
  29287. // },
  29288. // "project": {
  29289. // "description": "Project ID for this request.",
  29290. // "location": "path",
  29291. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29292. // "required": true,
  29293. // "type": "string"
  29294. // }
  29295. // },
  29296. // "path": "{project}/global/backendBuckets",
  29297. // "response": {
  29298. // "$ref": "BackendBucketList"
  29299. // },
  29300. // "scopes": [
  29301. // "https://www.googleapis.com/auth/cloud-platform",
  29302. // "https://www.googleapis.com/auth/compute",
  29303. // "https://www.googleapis.com/auth/compute.readonly"
  29304. // ]
  29305. // }
  29306. }
  29307. // Pages invokes f for each page of results.
  29308. // A non-nil error returned from f will halt the iteration.
  29309. // The provided context supersedes any context provided to the Context method.
  29310. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  29311. c.ctx_ = ctx
  29312. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29313. for {
  29314. x, err := c.Do()
  29315. if err != nil {
  29316. return err
  29317. }
  29318. if err := f(x); err != nil {
  29319. return err
  29320. }
  29321. if x.NextPageToken == "" {
  29322. return nil
  29323. }
  29324. c.PageToken(x.NextPageToken)
  29325. }
  29326. }
  29327. // method id "compute.backendBuckets.patch":
  29328. type BackendBucketsPatchCall struct {
  29329. s *Service
  29330. project string
  29331. backendBucket string
  29332. backendbucket *BackendBucket
  29333. urlParams_ gensupport.URLParams
  29334. ctx_ context.Context
  29335. header_ http.Header
  29336. }
  29337. // Patch: Updates the specified BackendBucket resource with the data
  29338. // included in the request. This method supports PATCH semantics and
  29339. // uses the JSON merge patch format and processing rules.
  29340. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  29341. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29342. c.project = project
  29343. c.backendBucket = backendBucket
  29344. c.backendbucket = backendbucket
  29345. return c
  29346. }
  29347. // RequestId sets the optional parameter "requestId": An optional
  29348. // request ID to identify requests. Specify a unique request ID so that
  29349. // if you must retry your request, the server will know to ignore the
  29350. // request if it has already been completed.
  29351. //
  29352. // For example, consider a situation where you make an initial request
  29353. // and the request times out. If you make the request again with the
  29354. // same request ID, the server can check if original operation with the
  29355. // same request ID was received, and if so, will ignore the second
  29356. // request. This prevents clients from accidentally creating duplicate
  29357. // commitments.
  29358. //
  29359. // The request ID must be a valid UUID with the exception that zero UUID
  29360. // is not supported (00000000-0000-0000-0000-000000000000).
  29361. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  29362. c.urlParams_.Set("requestId", requestId)
  29363. return c
  29364. }
  29365. // Fields allows partial responses to be retrieved. See
  29366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29367. // for more information.
  29368. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  29369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29370. return c
  29371. }
  29372. // Context sets the context to be used in this call's Do method. Any
  29373. // pending HTTP request will be aborted if the provided context is
  29374. // canceled.
  29375. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  29376. c.ctx_ = ctx
  29377. return c
  29378. }
  29379. // Header returns an http.Header that can be modified by the caller to
  29380. // add HTTP headers to the request.
  29381. func (c *BackendBucketsPatchCall) Header() http.Header {
  29382. if c.header_ == nil {
  29383. c.header_ = make(http.Header)
  29384. }
  29385. return c.header_
  29386. }
  29387. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  29388. reqHeaders := make(http.Header)
  29389. for k, v := range c.header_ {
  29390. reqHeaders[k] = v
  29391. }
  29392. reqHeaders.Set("User-Agent", c.s.userAgent())
  29393. var body io.Reader = nil
  29394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  29395. if err != nil {
  29396. return nil, err
  29397. }
  29398. reqHeaders.Set("Content-Type", "application/json")
  29399. c.urlParams_.Set("alt", alt)
  29400. c.urlParams_.Set("prettyPrint", "false")
  29401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  29402. urls += "?" + c.urlParams_.Encode()
  29403. req, err := http.NewRequest("PATCH", urls, body)
  29404. if err != nil {
  29405. return nil, err
  29406. }
  29407. req.Header = reqHeaders
  29408. googleapi.Expand(req.URL, map[string]string{
  29409. "project": c.project,
  29410. "backendBucket": c.backendBucket,
  29411. })
  29412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29413. }
  29414. // Do executes the "compute.backendBuckets.patch" call.
  29415. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29416. // status code is an error. Response headers are in either
  29417. // *Operation.ServerResponse.Header or (if a response was returned at
  29418. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29419. // to check whether the returned error was because
  29420. // http.StatusNotModified was returned.
  29421. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29422. gensupport.SetOptions(c.urlParams_, opts...)
  29423. res, err := c.doRequest("json")
  29424. if res != nil && res.StatusCode == http.StatusNotModified {
  29425. if res.Body != nil {
  29426. res.Body.Close()
  29427. }
  29428. return nil, &googleapi.Error{
  29429. Code: res.StatusCode,
  29430. Header: res.Header,
  29431. }
  29432. }
  29433. if err != nil {
  29434. return nil, err
  29435. }
  29436. defer googleapi.CloseBody(res)
  29437. if err := googleapi.CheckResponse(res); err != nil {
  29438. return nil, err
  29439. }
  29440. ret := &Operation{
  29441. ServerResponse: googleapi.ServerResponse{
  29442. Header: res.Header,
  29443. HTTPStatusCode: res.StatusCode,
  29444. },
  29445. }
  29446. target := &ret
  29447. if err := gensupport.DecodeResponse(target, res); err != nil {
  29448. return nil, err
  29449. }
  29450. return ret, nil
  29451. // {
  29452. // "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  29453. // "httpMethod": "PATCH",
  29454. // "id": "compute.backendBuckets.patch",
  29455. // "parameterOrder": [
  29456. // "project",
  29457. // "backendBucket"
  29458. // ],
  29459. // "parameters": {
  29460. // "backendBucket": {
  29461. // "description": "Name of the BackendBucket resource to patch.",
  29462. // "location": "path",
  29463. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29464. // "required": true,
  29465. // "type": "string"
  29466. // },
  29467. // "project": {
  29468. // "description": "Project ID for this request.",
  29469. // "location": "path",
  29470. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29471. // "required": true,
  29472. // "type": "string"
  29473. // },
  29474. // "requestId": {
  29475. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29476. // "location": "query",
  29477. // "type": "string"
  29478. // }
  29479. // },
  29480. // "path": "{project}/global/backendBuckets/{backendBucket}",
  29481. // "request": {
  29482. // "$ref": "BackendBucket"
  29483. // },
  29484. // "response": {
  29485. // "$ref": "Operation"
  29486. // },
  29487. // "scopes": [
  29488. // "https://www.googleapis.com/auth/cloud-platform",
  29489. // "https://www.googleapis.com/auth/compute"
  29490. // ]
  29491. // }
  29492. }
  29493. // method id "compute.backendBuckets.update":
  29494. type BackendBucketsUpdateCall struct {
  29495. s *Service
  29496. project string
  29497. backendBucket string
  29498. backendbucket *BackendBucket
  29499. urlParams_ gensupport.URLParams
  29500. ctx_ context.Context
  29501. header_ http.Header
  29502. }
  29503. // Update: Updates the specified BackendBucket resource with the data
  29504. // included in the request.
  29505. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  29506. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29507. c.project = project
  29508. c.backendBucket = backendBucket
  29509. c.backendbucket = backendbucket
  29510. return c
  29511. }
  29512. // RequestId sets the optional parameter "requestId": An optional
  29513. // request ID to identify requests. Specify a unique request ID so that
  29514. // if you must retry your request, the server will know to ignore the
  29515. // request if it has already been completed.
  29516. //
  29517. // For example, consider a situation where you make an initial request
  29518. // and the request times out. If you make the request again with the
  29519. // same request ID, the server can check if original operation with the
  29520. // same request ID was received, and if so, will ignore the second
  29521. // request. This prevents clients from accidentally creating duplicate
  29522. // commitments.
  29523. //
  29524. // The request ID must be a valid UUID with the exception that zero UUID
  29525. // is not supported (00000000-0000-0000-0000-000000000000).
  29526. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  29527. c.urlParams_.Set("requestId", requestId)
  29528. return c
  29529. }
  29530. // Fields allows partial responses to be retrieved. See
  29531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29532. // for more information.
  29533. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  29534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29535. return c
  29536. }
  29537. // Context sets the context to be used in this call's Do method. Any
  29538. // pending HTTP request will be aborted if the provided context is
  29539. // canceled.
  29540. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  29541. c.ctx_ = ctx
  29542. return c
  29543. }
  29544. // Header returns an http.Header that can be modified by the caller to
  29545. // add HTTP headers to the request.
  29546. func (c *BackendBucketsUpdateCall) Header() http.Header {
  29547. if c.header_ == nil {
  29548. c.header_ = make(http.Header)
  29549. }
  29550. return c.header_
  29551. }
  29552. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  29553. reqHeaders := make(http.Header)
  29554. for k, v := range c.header_ {
  29555. reqHeaders[k] = v
  29556. }
  29557. reqHeaders.Set("User-Agent", c.s.userAgent())
  29558. var body io.Reader = nil
  29559. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  29560. if err != nil {
  29561. return nil, err
  29562. }
  29563. reqHeaders.Set("Content-Type", "application/json")
  29564. c.urlParams_.Set("alt", alt)
  29565. c.urlParams_.Set("prettyPrint", "false")
  29566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  29567. urls += "?" + c.urlParams_.Encode()
  29568. req, err := http.NewRequest("PUT", urls, body)
  29569. if err != nil {
  29570. return nil, err
  29571. }
  29572. req.Header = reqHeaders
  29573. googleapi.Expand(req.URL, map[string]string{
  29574. "project": c.project,
  29575. "backendBucket": c.backendBucket,
  29576. })
  29577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29578. }
  29579. // Do executes the "compute.backendBuckets.update" call.
  29580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29581. // status code is an error. Response headers are in either
  29582. // *Operation.ServerResponse.Header or (if a response was returned at
  29583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29584. // to check whether the returned error was because
  29585. // http.StatusNotModified was returned.
  29586. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29587. gensupport.SetOptions(c.urlParams_, opts...)
  29588. res, err := c.doRequest("json")
  29589. if res != nil && res.StatusCode == http.StatusNotModified {
  29590. if res.Body != nil {
  29591. res.Body.Close()
  29592. }
  29593. return nil, &googleapi.Error{
  29594. Code: res.StatusCode,
  29595. Header: res.Header,
  29596. }
  29597. }
  29598. if err != nil {
  29599. return nil, err
  29600. }
  29601. defer googleapi.CloseBody(res)
  29602. if err := googleapi.CheckResponse(res); err != nil {
  29603. return nil, err
  29604. }
  29605. ret := &Operation{
  29606. ServerResponse: googleapi.ServerResponse{
  29607. Header: res.Header,
  29608. HTTPStatusCode: res.StatusCode,
  29609. },
  29610. }
  29611. target := &ret
  29612. if err := gensupport.DecodeResponse(target, res); err != nil {
  29613. return nil, err
  29614. }
  29615. return ret, nil
  29616. // {
  29617. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  29618. // "httpMethod": "PUT",
  29619. // "id": "compute.backendBuckets.update",
  29620. // "parameterOrder": [
  29621. // "project",
  29622. // "backendBucket"
  29623. // ],
  29624. // "parameters": {
  29625. // "backendBucket": {
  29626. // "description": "Name of the BackendBucket resource to update.",
  29627. // "location": "path",
  29628. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29629. // "required": true,
  29630. // "type": "string"
  29631. // },
  29632. // "project": {
  29633. // "description": "Project ID for this request.",
  29634. // "location": "path",
  29635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29636. // "required": true,
  29637. // "type": "string"
  29638. // },
  29639. // "requestId": {
  29640. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29641. // "location": "query",
  29642. // "type": "string"
  29643. // }
  29644. // },
  29645. // "path": "{project}/global/backendBuckets/{backendBucket}",
  29646. // "request": {
  29647. // "$ref": "BackendBucket"
  29648. // },
  29649. // "response": {
  29650. // "$ref": "Operation"
  29651. // },
  29652. // "scopes": [
  29653. // "https://www.googleapis.com/auth/cloud-platform",
  29654. // "https://www.googleapis.com/auth/compute"
  29655. // ]
  29656. // }
  29657. }
  29658. // method id "compute.backendServices.addSignedUrlKey":
  29659. type BackendServicesAddSignedUrlKeyCall struct {
  29660. s *Service
  29661. project string
  29662. backendService string
  29663. signedurlkey *SignedUrlKey
  29664. urlParams_ gensupport.URLParams
  29665. ctx_ context.Context
  29666. header_ http.Header
  29667. }
  29668. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  29669. // for this backend service.
  29670. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  29671. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29672. c.project = project
  29673. c.backendService = backendService
  29674. c.signedurlkey = signedurlkey
  29675. return c
  29676. }
  29677. // RequestId sets the optional parameter "requestId": An optional
  29678. // request ID to identify requests. Specify a unique request ID so that
  29679. // if you must retry your request, the server will know to ignore the
  29680. // request if it has already been completed.
  29681. //
  29682. // For example, consider a situation where you make an initial request
  29683. // and the request times out. If you make the request again with the
  29684. // same request ID, the server can check if original operation with the
  29685. // same request ID was received, and if so, will ignore the second
  29686. // request. This prevents clients from accidentally creating duplicate
  29687. // commitments.
  29688. //
  29689. // The request ID must be a valid UUID with the exception that zero UUID
  29690. // is not supported (00000000-0000-0000-0000-000000000000).
  29691. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  29692. c.urlParams_.Set("requestId", requestId)
  29693. return c
  29694. }
  29695. // Fields allows partial responses to be retrieved. See
  29696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29697. // for more information.
  29698. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  29699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29700. return c
  29701. }
  29702. // Context sets the context to be used in this call's Do method. Any
  29703. // pending HTTP request will be aborted if the provided context is
  29704. // canceled.
  29705. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  29706. c.ctx_ = ctx
  29707. return c
  29708. }
  29709. // Header returns an http.Header that can be modified by the caller to
  29710. // add HTTP headers to the request.
  29711. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  29712. if c.header_ == nil {
  29713. c.header_ = make(http.Header)
  29714. }
  29715. return c.header_
  29716. }
  29717. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  29718. reqHeaders := make(http.Header)
  29719. for k, v := range c.header_ {
  29720. reqHeaders[k] = v
  29721. }
  29722. reqHeaders.Set("User-Agent", c.s.userAgent())
  29723. var body io.Reader = nil
  29724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  29725. if err != nil {
  29726. return nil, err
  29727. }
  29728. reqHeaders.Set("Content-Type", "application/json")
  29729. c.urlParams_.Set("alt", alt)
  29730. c.urlParams_.Set("prettyPrint", "false")
  29731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  29732. urls += "?" + c.urlParams_.Encode()
  29733. req, err := http.NewRequest("POST", urls, body)
  29734. if err != nil {
  29735. return nil, err
  29736. }
  29737. req.Header = reqHeaders
  29738. googleapi.Expand(req.URL, map[string]string{
  29739. "project": c.project,
  29740. "backendService": c.backendService,
  29741. })
  29742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29743. }
  29744. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  29745. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29746. // status code is an error. Response headers are in either
  29747. // *Operation.ServerResponse.Header or (if a response was returned at
  29748. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29749. // to check whether the returned error was because
  29750. // http.StatusNotModified was returned.
  29751. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29752. gensupport.SetOptions(c.urlParams_, opts...)
  29753. res, err := c.doRequest("json")
  29754. if res != nil && res.StatusCode == http.StatusNotModified {
  29755. if res.Body != nil {
  29756. res.Body.Close()
  29757. }
  29758. return nil, &googleapi.Error{
  29759. Code: res.StatusCode,
  29760. Header: res.Header,
  29761. }
  29762. }
  29763. if err != nil {
  29764. return nil, err
  29765. }
  29766. defer googleapi.CloseBody(res)
  29767. if err := googleapi.CheckResponse(res); err != nil {
  29768. return nil, err
  29769. }
  29770. ret := &Operation{
  29771. ServerResponse: googleapi.ServerResponse{
  29772. Header: res.Header,
  29773. HTTPStatusCode: res.StatusCode,
  29774. },
  29775. }
  29776. target := &ret
  29777. if err := gensupport.DecodeResponse(target, res); err != nil {
  29778. return nil, err
  29779. }
  29780. return ret, nil
  29781. // {
  29782. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  29783. // "httpMethod": "POST",
  29784. // "id": "compute.backendServices.addSignedUrlKey",
  29785. // "parameterOrder": [
  29786. // "project",
  29787. // "backendService"
  29788. // ],
  29789. // "parameters": {
  29790. // "backendService": {
  29791. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  29792. // "location": "path",
  29793. // "required": true,
  29794. // "type": "string"
  29795. // },
  29796. // "project": {
  29797. // "description": "Project ID for this request.",
  29798. // "location": "path",
  29799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29800. // "required": true,
  29801. // "type": "string"
  29802. // },
  29803. // "requestId": {
  29804. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29805. // "location": "query",
  29806. // "type": "string"
  29807. // }
  29808. // },
  29809. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  29810. // "request": {
  29811. // "$ref": "SignedUrlKey"
  29812. // },
  29813. // "response": {
  29814. // "$ref": "Operation"
  29815. // },
  29816. // "scopes": [
  29817. // "https://www.googleapis.com/auth/cloud-platform",
  29818. // "https://www.googleapis.com/auth/compute"
  29819. // ]
  29820. // }
  29821. }
  29822. // method id "compute.backendServices.aggregatedList":
  29823. type BackendServicesAggregatedListCall struct {
  29824. s *Service
  29825. project string
  29826. urlParams_ gensupport.URLParams
  29827. ifNoneMatch_ string
  29828. ctx_ context.Context
  29829. header_ http.Header
  29830. }
  29831. // AggregatedList: Retrieves the list of all BackendService resources,
  29832. // regional and global, available to the specified project.
  29833. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  29834. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29835. c.project = project
  29836. return c
  29837. }
  29838. // Filter sets the optional parameter "filter": A filter expression that
  29839. // filters resources listed in the response. The expression must specify
  29840. // the field name, a comparison operator, and the value that you want to
  29841. // use for filtering. The value must be a string, a number, or a
  29842. // boolean. The comparison operator must be either =, !=, >, or <.
  29843. //
  29844. // For example, if you are filtering Compute Engine instances, you can
  29845. // exclude instances named example-instance by specifying name !=
  29846. // example-instance.
  29847. //
  29848. // You can also filter nested fields. For example, you could specify
  29849. // scheduling.automaticRestart = false to include instances only if they
  29850. // are not scheduled for automatic restarts. You can use filtering on
  29851. // nested fields to filter based on resource labels.
  29852. //
  29853. // To filter on multiple expressions, provide each separate expression
  29854. // within parentheses. For example, (scheduling.automaticRestart = true)
  29855. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29856. // AND expression. However, you can include AND and OR expressions
  29857. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29858. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29859. // true).
  29860. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  29861. c.urlParams_.Set("filter", filter)
  29862. return c
  29863. }
  29864. // MaxResults sets the optional parameter "maxResults": The maximum
  29865. // number of results per page that should be returned. If the number of
  29866. // available results is larger than maxResults, Compute Engine returns a
  29867. // nextPageToken that can be used to get the next page of results in
  29868. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29869. // (Default: 500)
  29870. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  29871. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29872. return c
  29873. }
  29874. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29875. // a certain order. By default, results are returned in alphanumerical
  29876. // order based on the resource name.
  29877. //
  29878. // You can also sort results in descending order based on the creation
  29879. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29880. // based on the creationTimestamp field in reverse chronological order
  29881. // (newest result first). Use this to sort resources like operations so
  29882. // that the newest operation is returned first.
  29883. //
  29884. // Currently, only sorting by name or creationTimestamp desc is
  29885. // supported.
  29886. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  29887. c.urlParams_.Set("orderBy", orderBy)
  29888. return c
  29889. }
  29890. // PageToken sets the optional parameter "pageToken": Specifies a page
  29891. // token to use. Set pageToken to the nextPageToken returned by a
  29892. // previous list request to get the next page of results.
  29893. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  29894. c.urlParams_.Set("pageToken", pageToken)
  29895. return c
  29896. }
  29897. // Fields allows partial responses to be retrieved. See
  29898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29899. // for more information.
  29900. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  29901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29902. return c
  29903. }
  29904. // IfNoneMatch sets the optional parameter which makes the operation
  29905. // fail if the object's ETag matches the given value. This is useful for
  29906. // getting updates only after the object has changed since the last
  29907. // request. Use googleapi.IsNotModified to check whether the response
  29908. // error from Do is the result of In-None-Match.
  29909. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  29910. c.ifNoneMatch_ = entityTag
  29911. return c
  29912. }
  29913. // Context sets the context to be used in this call's Do method. Any
  29914. // pending HTTP request will be aborted if the provided context is
  29915. // canceled.
  29916. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  29917. c.ctx_ = ctx
  29918. return c
  29919. }
  29920. // Header returns an http.Header that can be modified by the caller to
  29921. // add HTTP headers to the request.
  29922. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  29923. if c.header_ == nil {
  29924. c.header_ = make(http.Header)
  29925. }
  29926. return c.header_
  29927. }
  29928. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  29929. reqHeaders := make(http.Header)
  29930. for k, v := range c.header_ {
  29931. reqHeaders[k] = v
  29932. }
  29933. reqHeaders.Set("User-Agent", c.s.userAgent())
  29934. if c.ifNoneMatch_ != "" {
  29935. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29936. }
  29937. var body io.Reader = nil
  29938. c.urlParams_.Set("alt", alt)
  29939. c.urlParams_.Set("prettyPrint", "false")
  29940. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  29941. urls += "?" + c.urlParams_.Encode()
  29942. req, err := http.NewRequest("GET", urls, body)
  29943. if err != nil {
  29944. return nil, err
  29945. }
  29946. req.Header = reqHeaders
  29947. googleapi.Expand(req.URL, map[string]string{
  29948. "project": c.project,
  29949. })
  29950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29951. }
  29952. // Do executes the "compute.backendServices.aggregatedList" call.
  29953. // Exactly one of *BackendServiceAggregatedList or error will be
  29954. // non-nil. Any non-2xx status code is an error. Response headers are in
  29955. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  29956. // response was returned at all) in error.(*googleapi.Error).Header. Use
  29957. // googleapi.IsNotModified to check whether the returned error was
  29958. // because http.StatusNotModified was returned.
  29959. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  29960. gensupport.SetOptions(c.urlParams_, opts...)
  29961. res, err := c.doRequest("json")
  29962. if res != nil && res.StatusCode == http.StatusNotModified {
  29963. if res.Body != nil {
  29964. res.Body.Close()
  29965. }
  29966. return nil, &googleapi.Error{
  29967. Code: res.StatusCode,
  29968. Header: res.Header,
  29969. }
  29970. }
  29971. if err != nil {
  29972. return nil, err
  29973. }
  29974. defer googleapi.CloseBody(res)
  29975. if err := googleapi.CheckResponse(res); err != nil {
  29976. return nil, err
  29977. }
  29978. ret := &BackendServiceAggregatedList{
  29979. ServerResponse: googleapi.ServerResponse{
  29980. Header: res.Header,
  29981. HTTPStatusCode: res.StatusCode,
  29982. },
  29983. }
  29984. target := &ret
  29985. if err := gensupport.DecodeResponse(target, res); err != nil {
  29986. return nil, err
  29987. }
  29988. return ret, nil
  29989. // {
  29990. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  29991. // "httpMethod": "GET",
  29992. // "id": "compute.backendServices.aggregatedList",
  29993. // "parameterOrder": [
  29994. // "project"
  29995. // ],
  29996. // "parameters": {
  29997. // "filter": {
  29998. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  29999. // "location": "query",
  30000. // "type": "string"
  30001. // },
  30002. // "maxResults": {
  30003. // "default": "500",
  30004. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  30005. // "format": "uint32",
  30006. // "location": "query",
  30007. // "minimum": "0",
  30008. // "type": "integer"
  30009. // },
  30010. // "orderBy": {
  30011. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  30012. // "location": "query",
  30013. // "type": "string"
  30014. // },
  30015. // "pageToken": {
  30016. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  30017. // "location": "query",
  30018. // "type": "string"
  30019. // },
  30020. // "project": {
  30021. // "description": "Name of the project scoping this request.",
  30022. // "location": "path",
  30023. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30024. // "required": true,
  30025. // "type": "string"
  30026. // }
  30027. // },
  30028. // "path": "{project}/aggregated/backendServices",
  30029. // "response": {
  30030. // "$ref": "BackendServiceAggregatedList"
  30031. // },
  30032. // "scopes": [
  30033. // "https://www.googleapis.com/auth/cloud-platform",
  30034. // "https://www.googleapis.com/auth/compute",
  30035. // "https://www.googleapis.com/auth/compute.readonly"
  30036. // ]
  30037. // }
  30038. }
  30039. // Pages invokes f for each page of results.
  30040. // A non-nil error returned from f will halt the iteration.
  30041. // The provided context supersedes any context provided to the Context method.
  30042. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  30043. c.ctx_ = ctx
  30044. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30045. for {
  30046. x, err := c.Do()
  30047. if err != nil {
  30048. return err
  30049. }
  30050. if err := f(x); err != nil {
  30051. return err
  30052. }
  30053. if x.NextPageToken == "" {
  30054. return nil
  30055. }
  30056. c.PageToken(x.NextPageToken)
  30057. }
  30058. }
  30059. // method id "compute.backendServices.delete":
  30060. type BackendServicesDeleteCall struct {
  30061. s *Service
  30062. project string
  30063. backendService string
  30064. urlParams_ gensupport.URLParams
  30065. ctx_ context.Context
  30066. header_ http.Header
  30067. }
  30068. // Delete: Deletes the specified BackendService resource.
  30069. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  30070. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  30071. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30072. c.project = project
  30073. c.backendService = backendService
  30074. return c
  30075. }
  30076. // RequestId sets the optional parameter "requestId": An optional
  30077. // request ID to identify requests. Specify a unique request ID so that
  30078. // if you must retry your request, the server will know to ignore the
  30079. // request if it has already been completed.
  30080. //
  30081. // For example, consider a situation where you make an initial request
  30082. // and the request times out. If you make the request again with the
  30083. // same request ID, the server can check if original operation with the
  30084. // same request ID was received, and if so, will ignore the second
  30085. // request. This prevents clients from accidentally creating duplicate
  30086. // commitments.
  30087. //
  30088. // The request ID must be a valid UUID with the exception that zero UUID
  30089. // is not supported (00000000-0000-0000-0000-000000000000).
  30090. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  30091. c.urlParams_.Set("requestId", requestId)
  30092. return c
  30093. }
  30094. // Fields allows partial responses to be retrieved. See
  30095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30096. // for more information.
  30097. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  30098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30099. return c
  30100. }
  30101. // Context sets the context to be used in this call's Do method. Any
  30102. // pending HTTP request will be aborted if the provided context is
  30103. // canceled.
  30104. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  30105. c.ctx_ = ctx
  30106. return c
  30107. }
  30108. // Header returns an http.Header that can be modified by the caller to
  30109. // add HTTP headers to the request.
  30110. func (c *BackendServicesDeleteCall) Header() http.Header {
  30111. if c.header_ == nil {
  30112. c.header_ = make(http.Header)
  30113. }
  30114. return c.header_
  30115. }
  30116. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30117. reqHeaders := make(http.Header)
  30118. for k, v := range c.header_ {
  30119. reqHeaders[k] = v
  30120. }
  30121. reqHeaders.Set("User-Agent", c.s.userAgent())
  30122. var body io.Reader = nil
  30123. c.urlParams_.Set("alt", alt)
  30124. c.urlParams_.Set("prettyPrint", "false")
  30125. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  30126. urls += "?" + c.urlParams_.Encode()
  30127. req, err := http.NewRequest("DELETE", urls, body)
  30128. if err != nil {
  30129. return nil, err
  30130. }
  30131. req.Header = reqHeaders
  30132. googleapi.Expand(req.URL, map[string]string{
  30133. "project": c.project,
  30134. "backendService": c.backendService,
  30135. })
  30136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30137. }
  30138. // Do executes the "compute.backendServices.delete" call.
  30139. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30140. // status code is an error. Response headers are in either
  30141. // *Operation.ServerResponse.Header or (if a response was returned at
  30142. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30143. // to check whether the returned error was because
  30144. // http.StatusNotModified was returned.
  30145. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30146. gensupport.SetOptions(c.urlParams_, opts...)
  30147. res, err := c.doRequest("json")
  30148. if res != nil && res.StatusCode == http.StatusNotModified {
  30149. if res.Body != nil {
  30150. res.Body.Close()
  30151. }
  30152. return nil, &googleapi.Error{
  30153. Code: res.StatusCode,
  30154. Header: res.Header,
  30155. }
  30156. }
  30157. if err != nil {
  30158. return nil, err
  30159. }
  30160. defer googleapi.CloseBody(res)
  30161. if err := googleapi.CheckResponse(res); err != nil {
  30162. return nil, err
  30163. }
  30164. ret := &Operation{
  30165. ServerResponse: googleapi.ServerResponse{
  30166. Header: res.Header,
  30167. HTTPStatusCode: res.StatusCode,
  30168. },
  30169. }
  30170. target := &ret
  30171. if err := gensupport.DecodeResponse(target, res); err != nil {
  30172. return nil, err
  30173. }
  30174. return ret, nil
  30175. // {
  30176. // "description": "Deletes the specified BackendService resource.",
  30177. // "httpMethod": "DELETE",
  30178. // "id": "compute.backendServices.delete",
  30179. // "parameterOrder": [
  30180. // "project",
  30181. // "backendService"
  30182. // ],
  30183. // "parameters": {
  30184. // "backendService": {
  30185. // "description": "Name of the BackendService resource to delete.",
  30186. // "location": "path",
  30187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30188. // "required": true,
  30189. // "type": "string"
  30190. // },
  30191. // "project": {
  30192. // "description": "Project ID for this request.",
  30193. // "location": "path",
  30194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30195. // "required": true,
  30196. // "type": "string"
  30197. // },
  30198. // "requestId": {
  30199. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30200. // "location": "query",
  30201. // "type": "string"
  30202. // }
  30203. // },
  30204. // "path": "{project}/global/backendServices/{backendService}",
  30205. // "response": {
  30206. // "$ref": "Operation"
  30207. // },
  30208. // "scopes": [
  30209. // "https://www.googleapis.com/auth/cloud-platform",
  30210. // "https://www.googleapis.com/auth/compute"
  30211. // ]
  30212. // }
  30213. }
  30214. // method id "compute.backendServices.deleteSignedUrlKey":
  30215. type BackendServicesDeleteSignedUrlKeyCall struct {
  30216. s *Service
  30217. project string
  30218. backendService string
  30219. urlParams_ gensupport.URLParams
  30220. ctx_ context.Context
  30221. header_ http.Header
  30222. }
  30223. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  30224. // URLs for this backend service.
  30225. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  30226. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30227. c.project = project
  30228. c.backendService = backendService
  30229. c.urlParams_.Set("keyName", keyName)
  30230. return c
  30231. }
  30232. // RequestId sets the optional parameter "requestId": An optional
  30233. // request ID to identify requests. Specify a unique request ID so that
  30234. // if you must retry your request, the server will know to ignore the
  30235. // request if it has already been completed.
  30236. //
  30237. // For example, consider a situation where you make an initial request
  30238. // and the request times out. If you make the request again with the
  30239. // same request ID, the server can check if original operation with the
  30240. // same request ID was received, and if so, will ignore the second
  30241. // request. This prevents clients from accidentally creating duplicate
  30242. // commitments.
  30243. //
  30244. // The request ID must be a valid UUID with the exception that zero UUID
  30245. // is not supported (00000000-0000-0000-0000-000000000000).
  30246. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  30247. c.urlParams_.Set("requestId", requestId)
  30248. return c
  30249. }
  30250. // Fields allows partial responses to be retrieved. See
  30251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30252. // for more information.
  30253. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  30254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30255. return c
  30256. }
  30257. // Context sets the context to be used in this call's Do method. Any
  30258. // pending HTTP request will be aborted if the provided context is
  30259. // canceled.
  30260. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  30261. c.ctx_ = ctx
  30262. return c
  30263. }
  30264. // Header returns an http.Header that can be modified by the caller to
  30265. // add HTTP headers to the request.
  30266. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  30267. if c.header_ == nil {
  30268. c.header_ = make(http.Header)
  30269. }
  30270. return c.header_
  30271. }
  30272. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  30273. reqHeaders := make(http.Header)
  30274. for k, v := range c.header_ {
  30275. reqHeaders[k] = v
  30276. }
  30277. reqHeaders.Set("User-Agent", c.s.userAgent())
  30278. var body io.Reader = nil
  30279. c.urlParams_.Set("alt", alt)
  30280. c.urlParams_.Set("prettyPrint", "false")
  30281. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  30282. urls += "?" + c.urlParams_.Encode()
  30283. req, err := http.NewRequest("POST", urls, body)
  30284. if err != nil {
  30285. return nil, err
  30286. }
  30287. req.Header = reqHeaders
  30288. googleapi.Expand(req.URL, map[string]string{
  30289. "project": c.project,
  30290. "backendService": c.backendService,
  30291. })
  30292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30293. }
  30294. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  30295. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30296. // status code is an error. Response headers are in either
  30297. // *Operation.ServerResponse.Header or (if a response was returned at
  30298. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30299. // to check whether the returned error was because
  30300. // http.StatusNotModified was returned.
  30301. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30302. gensupport.SetOptions(c.urlParams_, opts...)
  30303. res, err := c.doRequest("json")
  30304. if res != nil && res.StatusCode == http.StatusNotModified {
  30305. if res.Body != nil {
  30306. res.Body.Close()
  30307. }
  30308. return nil, &googleapi.Error{
  30309. Code: res.StatusCode,
  30310. Header: res.Header,
  30311. }
  30312. }
  30313. if err != nil {
  30314. return nil, err
  30315. }
  30316. defer googleapi.CloseBody(res)
  30317. if err := googleapi.CheckResponse(res); err != nil {
  30318. return nil, err
  30319. }
  30320. ret := &Operation{
  30321. ServerResponse: googleapi.ServerResponse{
  30322. Header: res.Header,
  30323. HTTPStatusCode: res.StatusCode,
  30324. },
  30325. }
  30326. target := &ret
  30327. if err := gensupport.DecodeResponse(target, res); err != nil {
  30328. return nil, err
  30329. }
  30330. return ret, nil
  30331. // {
  30332. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  30333. // "httpMethod": "POST",
  30334. // "id": "compute.backendServices.deleteSignedUrlKey",
  30335. // "parameterOrder": [
  30336. // "project",
  30337. // "backendService",
  30338. // "keyName"
  30339. // ],
  30340. // "parameters": {
  30341. // "backendService": {
  30342. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  30343. // "location": "path",
  30344. // "required": true,
  30345. // "type": "string"
  30346. // },
  30347. // "keyName": {
  30348. // "description": "The name of the Signed URL Key to delete.",
  30349. // "location": "query",
  30350. // "required": true,
  30351. // "type": "string"
  30352. // },
  30353. // "project": {
  30354. // "description": "Project ID for this request.",
  30355. // "location": "path",
  30356. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30357. // "required": true,
  30358. // "type": "string"
  30359. // },
  30360. // "requestId": {
  30361. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30362. // "location": "query",
  30363. // "type": "string"
  30364. // }
  30365. // },
  30366. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  30367. // "response": {
  30368. // "$ref": "Operation"
  30369. // },
  30370. // "scopes": [
  30371. // "https://www.googleapis.com/auth/cloud-platform",
  30372. // "https://www.googleapis.com/auth/compute"
  30373. // ]
  30374. // }
  30375. }
  30376. // method id "compute.backendServices.get":
  30377. type BackendServicesGetCall struct {
  30378. s *Service
  30379. project string
  30380. backendService string
  30381. urlParams_ gensupport.URLParams
  30382. ifNoneMatch_ string
  30383. ctx_ context.Context
  30384. header_ http.Header
  30385. }
  30386. // Get: Returns the specified BackendService resource. Gets a list of
  30387. // available backend services.
  30388. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  30389. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  30390. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30391. c.project = project
  30392. c.backendService = backendService
  30393. return c
  30394. }
  30395. // Fields allows partial responses to be retrieved. See
  30396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30397. // for more information.
  30398. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  30399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30400. return c
  30401. }
  30402. // IfNoneMatch sets the optional parameter which makes the operation
  30403. // fail if the object's ETag matches the given value. This is useful for
  30404. // getting updates only after the object has changed since the last
  30405. // request. Use googleapi.IsNotModified to check whether the response
  30406. // error from Do is the result of In-None-Match.
  30407. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  30408. c.ifNoneMatch_ = entityTag
  30409. return c
  30410. }
  30411. // Context sets the context to be used in this call's Do method. Any
  30412. // pending HTTP request will be aborted if the provided context is
  30413. // canceled.
  30414. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  30415. c.ctx_ = ctx
  30416. return c
  30417. }
  30418. // Header returns an http.Header that can be modified by the caller to
  30419. // add HTTP headers to the request.
  30420. func (c *BackendServicesGetCall) Header() http.Header {
  30421. if c.header_ == nil {
  30422. c.header_ = make(http.Header)
  30423. }
  30424. return c.header_
  30425. }
  30426. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  30427. reqHeaders := make(http.Header)
  30428. for k, v := range c.header_ {
  30429. reqHeaders[k] = v
  30430. }
  30431. reqHeaders.Set("User-Agent", c.s.userAgent())
  30432. if c.ifNoneMatch_ != "" {
  30433. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30434. }
  30435. var body io.Reader = nil
  30436. c.urlParams_.Set("alt", alt)
  30437. c.urlParams_.Set("prettyPrint", "false")
  30438. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  30439. urls += "?" + c.urlParams_.Encode()
  30440. req, err := http.NewRequest("GET", urls, body)
  30441. if err != nil {
  30442. return nil, err
  30443. }
  30444. req.Header = reqHeaders
  30445. googleapi.Expand(req.URL, map[string]string{
  30446. "project": c.project,
  30447. "backendService": c.backendService,
  30448. })
  30449. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30450. }
  30451. // Do executes the "compute.backendServices.get" call.
  30452. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  30453. // status code is an error. Response headers are in either
  30454. // *BackendService.ServerResponse.Header or (if a response was returned
  30455. // at all) in error.(*googleapi.Error).Header. Use
  30456. // googleapi.IsNotModified to check whether the returned error was
  30457. // because http.StatusNotModified was returned.
  30458. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  30459. gensupport.SetOptions(c.urlParams_, opts...)
  30460. res, err := c.doRequest("json")
  30461. if res != nil && res.StatusCode == http.StatusNotModified {
  30462. if res.Body != nil {
  30463. res.Body.Close()
  30464. }
  30465. return nil, &googleapi.Error{
  30466. Code: res.StatusCode,
  30467. Header: res.Header,
  30468. }
  30469. }
  30470. if err != nil {
  30471. return nil, err
  30472. }
  30473. defer googleapi.CloseBody(res)
  30474. if err := googleapi.CheckResponse(res); err != nil {
  30475. return nil, err
  30476. }
  30477. ret := &BackendService{
  30478. ServerResponse: googleapi.ServerResponse{
  30479. Header: res.Header,
  30480. HTTPStatusCode: res.StatusCode,
  30481. },
  30482. }
  30483. target := &ret
  30484. if err := gensupport.DecodeResponse(target, res); err != nil {
  30485. return nil, err
  30486. }
  30487. return ret, nil
  30488. // {
  30489. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  30490. // "httpMethod": "GET",
  30491. // "id": "compute.backendServices.get",
  30492. // "parameterOrder": [
  30493. // "project",
  30494. // "backendService"
  30495. // ],
  30496. // "parameters": {
  30497. // "backendService": {
  30498. // "description": "Name of the BackendService resource to return.",
  30499. // "location": "path",
  30500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30501. // "required": true,
  30502. // "type": "string"
  30503. // },
  30504. // "project": {
  30505. // "description": "Project ID for this request.",
  30506. // "location": "path",
  30507. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30508. // "required": true,
  30509. // "type": "string"
  30510. // }
  30511. // },
  30512. // "path": "{project}/global/backendServices/{backendService}",
  30513. // "response": {
  30514. // "$ref": "BackendService"
  30515. // },
  30516. // "scopes": [
  30517. // "https://www.googleapis.com/auth/cloud-platform",
  30518. // "https://www.googleapis.com/auth/compute",
  30519. // "https://www.googleapis.com/auth/compute.readonly"
  30520. // ]
  30521. // }
  30522. }
  30523. // method id "compute.backendServices.getHealth":
  30524. type BackendServicesGetHealthCall struct {
  30525. s *Service
  30526. project string
  30527. backendService string
  30528. resourcegroupreference *ResourceGroupReference
  30529. urlParams_ gensupport.URLParams
  30530. ctx_ context.Context
  30531. header_ http.Header
  30532. }
  30533. // GetHealth: Gets the most recent health check results for this
  30534. // BackendService.
  30535. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  30536. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  30537. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30538. c.project = project
  30539. c.backendService = backendService
  30540. c.resourcegroupreference = resourcegroupreference
  30541. return c
  30542. }
  30543. // Fields allows partial responses to be retrieved. See
  30544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30545. // for more information.
  30546. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  30547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30548. return c
  30549. }
  30550. // Context sets the context to be used in this call's Do method. Any
  30551. // pending HTTP request will be aborted if the provided context is
  30552. // canceled.
  30553. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  30554. c.ctx_ = ctx
  30555. return c
  30556. }
  30557. // Header returns an http.Header that can be modified by the caller to
  30558. // add HTTP headers to the request.
  30559. func (c *BackendServicesGetHealthCall) Header() http.Header {
  30560. if c.header_ == nil {
  30561. c.header_ = make(http.Header)
  30562. }
  30563. return c.header_
  30564. }
  30565. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  30566. reqHeaders := make(http.Header)
  30567. for k, v := range c.header_ {
  30568. reqHeaders[k] = v
  30569. }
  30570. reqHeaders.Set("User-Agent", c.s.userAgent())
  30571. var body io.Reader = nil
  30572. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  30573. if err != nil {
  30574. return nil, err
  30575. }
  30576. reqHeaders.Set("Content-Type", "application/json")
  30577. c.urlParams_.Set("alt", alt)
  30578. c.urlParams_.Set("prettyPrint", "false")
  30579. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  30580. urls += "?" + c.urlParams_.Encode()
  30581. req, err := http.NewRequest("POST", urls, body)
  30582. if err != nil {
  30583. return nil, err
  30584. }
  30585. req.Header = reqHeaders
  30586. googleapi.Expand(req.URL, map[string]string{
  30587. "project": c.project,
  30588. "backendService": c.backendService,
  30589. })
  30590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30591. }
  30592. // Do executes the "compute.backendServices.getHealth" call.
  30593. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  30594. // Any non-2xx status code is an error. Response headers are in either
  30595. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  30596. // was returned at all) in error.(*googleapi.Error).Header. Use
  30597. // googleapi.IsNotModified to check whether the returned error was
  30598. // because http.StatusNotModified was returned.
  30599. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  30600. gensupport.SetOptions(c.urlParams_, opts...)
  30601. res, err := c.doRequest("json")
  30602. if res != nil && res.StatusCode == http.StatusNotModified {
  30603. if res.Body != nil {
  30604. res.Body.Close()
  30605. }
  30606. return nil, &googleapi.Error{
  30607. Code: res.StatusCode,
  30608. Header: res.Header,
  30609. }
  30610. }
  30611. if err != nil {
  30612. return nil, err
  30613. }
  30614. defer googleapi.CloseBody(res)
  30615. if err := googleapi.CheckResponse(res); err != nil {
  30616. return nil, err
  30617. }
  30618. ret := &BackendServiceGroupHealth{
  30619. ServerResponse: googleapi.ServerResponse{
  30620. Header: res.Header,
  30621. HTTPStatusCode: res.StatusCode,
  30622. },
  30623. }
  30624. target := &ret
  30625. if err := gensupport.DecodeResponse(target, res); err != nil {
  30626. return nil, err
  30627. }
  30628. return ret, nil
  30629. // {
  30630. // "description": "Gets the most recent health check results for this BackendService.",
  30631. // "httpMethod": "POST",
  30632. // "id": "compute.backendServices.getHealth",
  30633. // "parameterOrder": [
  30634. // "project",
  30635. // "backendService"
  30636. // ],
  30637. // "parameters": {
  30638. // "backendService": {
  30639. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  30640. // "location": "path",
  30641. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30642. // "required": true,
  30643. // "type": "string"
  30644. // },
  30645. // "project": {
  30646. // "location": "path",
  30647. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30648. // "required": true,
  30649. // "type": "string"
  30650. // }
  30651. // },
  30652. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  30653. // "request": {
  30654. // "$ref": "ResourceGroupReference"
  30655. // },
  30656. // "response": {
  30657. // "$ref": "BackendServiceGroupHealth"
  30658. // },
  30659. // "scopes": [
  30660. // "https://www.googleapis.com/auth/cloud-platform",
  30661. // "https://www.googleapis.com/auth/compute",
  30662. // "https://www.googleapis.com/auth/compute.readonly"
  30663. // ]
  30664. // }
  30665. }
  30666. // method id "compute.backendServices.insert":
  30667. type BackendServicesInsertCall struct {
  30668. s *Service
  30669. project string
  30670. backendservice *BackendService
  30671. urlParams_ gensupport.URLParams
  30672. ctx_ context.Context
  30673. header_ http.Header
  30674. }
  30675. // Insert: Creates a BackendService resource in the specified project
  30676. // using the data included in the request. There are several
  30677. // restrictions and guidelines to keep in mind when creating a backend
  30678. // service. Read Restrictions and Guidelines for more information.
  30679. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  30680. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  30681. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30682. c.project = project
  30683. c.backendservice = backendservice
  30684. return c
  30685. }
  30686. // RequestId sets the optional parameter "requestId": An optional
  30687. // request ID to identify requests. Specify a unique request ID so that
  30688. // if you must retry your request, the server will know to ignore the
  30689. // request if it has already been completed.
  30690. //
  30691. // For example, consider a situation where you make an initial request
  30692. // and the request times out. If you make the request again with the
  30693. // same request ID, the server can check if original operation with the
  30694. // same request ID was received, and if so, will ignore the second
  30695. // request. This prevents clients from accidentally creating duplicate
  30696. // commitments.
  30697. //
  30698. // The request ID must be a valid UUID with the exception that zero UUID
  30699. // is not supported (00000000-0000-0000-0000-000000000000).
  30700. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  30701. c.urlParams_.Set("requestId", requestId)
  30702. return c
  30703. }
  30704. // Fields allows partial responses to be retrieved. See
  30705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30706. // for more information.
  30707. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  30708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30709. return c
  30710. }
  30711. // Context sets the context to be used in this call's Do method. Any
  30712. // pending HTTP request will be aborted if the provided context is
  30713. // canceled.
  30714. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  30715. c.ctx_ = ctx
  30716. return c
  30717. }
  30718. // Header returns an http.Header that can be modified by the caller to
  30719. // add HTTP headers to the request.
  30720. func (c *BackendServicesInsertCall) Header() http.Header {
  30721. if c.header_ == nil {
  30722. c.header_ = make(http.Header)
  30723. }
  30724. return c.header_
  30725. }
  30726. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  30727. reqHeaders := make(http.Header)
  30728. for k, v := range c.header_ {
  30729. reqHeaders[k] = v
  30730. }
  30731. reqHeaders.Set("User-Agent", c.s.userAgent())
  30732. var body io.Reader = nil
  30733. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  30734. if err != nil {
  30735. return nil, err
  30736. }
  30737. reqHeaders.Set("Content-Type", "application/json")
  30738. c.urlParams_.Set("alt", alt)
  30739. c.urlParams_.Set("prettyPrint", "false")
  30740. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  30741. urls += "?" + c.urlParams_.Encode()
  30742. req, err := http.NewRequest("POST", urls, body)
  30743. if err != nil {
  30744. return nil, err
  30745. }
  30746. req.Header = reqHeaders
  30747. googleapi.Expand(req.URL, map[string]string{
  30748. "project": c.project,
  30749. })
  30750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30751. }
  30752. // Do executes the "compute.backendServices.insert" call.
  30753. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30754. // status code is an error. Response headers are in either
  30755. // *Operation.ServerResponse.Header or (if a response was returned at
  30756. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30757. // to check whether the returned error was because
  30758. // http.StatusNotModified was returned.
  30759. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30760. gensupport.SetOptions(c.urlParams_, opts...)
  30761. res, err := c.doRequest("json")
  30762. if res != nil && res.StatusCode == http.StatusNotModified {
  30763. if res.Body != nil {
  30764. res.Body.Close()
  30765. }
  30766. return nil, &googleapi.Error{
  30767. Code: res.StatusCode,
  30768. Header: res.Header,
  30769. }
  30770. }
  30771. if err != nil {
  30772. return nil, err
  30773. }
  30774. defer googleapi.CloseBody(res)
  30775. if err := googleapi.CheckResponse(res); err != nil {
  30776. return nil, err
  30777. }
  30778. ret := &Operation{
  30779. ServerResponse: googleapi.ServerResponse{
  30780. Header: res.Header,
  30781. HTTPStatusCode: res.StatusCode,
  30782. },
  30783. }
  30784. target := &ret
  30785. if err := gensupport.DecodeResponse(target, res); err != nil {
  30786. return nil, err
  30787. }
  30788. return ret, nil
  30789. // {
  30790. // "description": "Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.",
  30791. // "httpMethod": "POST",
  30792. // "id": "compute.backendServices.insert",
  30793. // "parameterOrder": [
  30794. // "project"
  30795. // ],
  30796. // "parameters": {
  30797. // "project": {
  30798. // "description": "Project ID for this request.",
  30799. // "location": "path",
  30800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30801. // "required": true,
  30802. // "type": "string"
  30803. // },
  30804. // "requestId": {
  30805. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30806. // "location": "query",
  30807. // "type": "string"
  30808. // }
  30809. // },
  30810. // "path": "{project}/global/backendServices",
  30811. // "request": {
  30812. // "$ref": "BackendService"
  30813. // },
  30814. // "response": {
  30815. // "$ref": "Operation"
  30816. // },
  30817. // "scopes": [
  30818. // "https://www.googleapis.com/auth/cloud-platform",
  30819. // "https://www.googleapis.com/auth/compute"
  30820. // ]
  30821. // }
  30822. }
  30823. // method id "compute.backendServices.list":
  30824. type BackendServicesListCall struct {
  30825. s *Service
  30826. project string
  30827. urlParams_ gensupport.URLParams
  30828. ifNoneMatch_ string
  30829. ctx_ context.Context
  30830. header_ http.Header
  30831. }
  30832. // List: Retrieves the list of BackendService resources available to the
  30833. // specified project.
  30834. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  30835. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  30836. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30837. c.project = project
  30838. return c
  30839. }
  30840. // Filter sets the optional parameter "filter": A filter expression that
  30841. // filters resources listed in the response. The expression must specify
  30842. // the field name, a comparison operator, and the value that you want to
  30843. // use for filtering. The value must be a string, a number, or a
  30844. // boolean. The comparison operator must be either =, !=, >, or <.
  30845. //
  30846. // For example, if you are filtering Compute Engine instances, you can
  30847. // exclude instances named example-instance by specifying name !=
  30848. // example-instance.
  30849. //
  30850. // You can also filter nested fields. For example, you could specify
  30851. // scheduling.automaticRestart = false to include instances only if they
  30852. // are not scheduled for automatic restarts. You can use filtering on
  30853. // nested fields to filter based on resource labels.
  30854. //
  30855. // To filter on multiple expressions, provide each separate expression
  30856. // within parentheses. For example, (scheduling.automaticRestart = true)
  30857. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30858. // AND expression. However, you can include AND and OR expressions
  30859. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30860. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30861. // true).
  30862. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  30863. c.urlParams_.Set("filter", filter)
  30864. return c
  30865. }
  30866. // MaxResults sets the optional parameter "maxResults": The maximum
  30867. // number of results per page that should be returned. If the number of
  30868. // available results is larger than maxResults, Compute Engine returns a
  30869. // nextPageToken that can be used to get the next page of results in
  30870. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30871. // (Default: 500)
  30872. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  30873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30874. return c
  30875. }
  30876. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30877. // a certain order. By default, results are returned in alphanumerical
  30878. // order based on the resource name.
  30879. //
  30880. // You can also sort results in descending order based on the creation
  30881. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30882. // based on the creationTimestamp field in reverse chronological order
  30883. // (newest result first). Use this to sort resources like operations so
  30884. // that the newest operation is returned first.
  30885. //
  30886. // Currently, only sorting by name or creationTimestamp desc is
  30887. // supported.
  30888. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  30889. c.urlParams_.Set("orderBy", orderBy)
  30890. return c
  30891. }
  30892. // PageToken sets the optional parameter "pageToken": Specifies a page
  30893. // token to use. Set pageToken to the nextPageToken returned by a
  30894. // previous list request to get the next page of results.
  30895. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  30896. c.urlParams_.Set("pageToken", pageToken)
  30897. return c
  30898. }
  30899. // Fields allows partial responses to be retrieved. See
  30900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30901. // for more information.
  30902. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  30903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30904. return c
  30905. }
  30906. // IfNoneMatch sets the optional parameter which makes the operation
  30907. // fail if the object's ETag matches the given value. This is useful for
  30908. // getting updates only after the object has changed since the last
  30909. // request. Use googleapi.IsNotModified to check whether the response
  30910. // error from Do is the result of In-None-Match.
  30911. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  30912. c.ifNoneMatch_ = entityTag
  30913. return c
  30914. }
  30915. // Context sets the context to be used in this call's Do method. Any
  30916. // pending HTTP request will be aborted if the provided context is
  30917. // canceled.
  30918. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  30919. c.ctx_ = ctx
  30920. return c
  30921. }
  30922. // Header returns an http.Header that can be modified by the caller to
  30923. // add HTTP headers to the request.
  30924. func (c *BackendServicesListCall) Header() http.Header {
  30925. if c.header_ == nil {
  30926. c.header_ = make(http.Header)
  30927. }
  30928. return c.header_
  30929. }
  30930. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  30931. reqHeaders := make(http.Header)
  30932. for k, v := range c.header_ {
  30933. reqHeaders[k] = v
  30934. }
  30935. reqHeaders.Set("User-Agent", c.s.userAgent())
  30936. if c.ifNoneMatch_ != "" {
  30937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30938. }
  30939. var body io.Reader = nil
  30940. c.urlParams_.Set("alt", alt)
  30941. c.urlParams_.Set("prettyPrint", "false")
  30942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  30943. urls += "?" + c.urlParams_.Encode()
  30944. req, err := http.NewRequest("GET", urls, body)
  30945. if err != nil {
  30946. return nil, err
  30947. }
  30948. req.Header = reqHeaders
  30949. googleapi.Expand(req.URL, map[string]string{
  30950. "project": c.project,
  30951. })
  30952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30953. }
  30954. // Do executes the "compute.backendServices.list" call.
  30955. // Exactly one of *BackendServiceList or error will be non-nil. Any
  30956. // non-2xx status code is an error. Response headers are in either
  30957. // *BackendServiceList.ServerResponse.Header or (if a response was
  30958. // returned at all) in error.(*googleapi.Error).Header. Use
  30959. // googleapi.IsNotModified to check whether the returned error was
  30960. // because http.StatusNotModified was returned.
  30961. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  30962. gensupport.SetOptions(c.urlParams_, opts...)
  30963. res, err := c.doRequest("json")
  30964. if res != nil && res.StatusCode == http.StatusNotModified {
  30965. if res.Body != nil {
  30966. res.Body.Close()
  30967. }
  30968. return nil, &googleapi.Error{
  30969. Code: res.StatusCode,
  30970. Header: res.Header,
  30971. }
  30972. }
  30973. if err != nil {
  30974. return nil, err
  30975. }
  30976. defer googleapi.CloseBody(res)
  30977. if err := googleapi.CheckResponse(res); err != nil {
  30978. return nil, err
  30979. }
  30980. ret := &BackendServiceList{
  30981. ServerResponse: googleapi.ServerResponse{
  30982. Header: res.Header,
  30983. HTTPStatusCode: res.StatusCode,
  30984. },
  30985. }
  30986. target := &ret
  30987. if err := gensupport.DecodeResponse(target, res); err != nil {
  30988. return nil, err
  30989. }
  30990. return ret, nil
  30991. // {
  30992. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  30993. // "httpMethod": "GET",
  30994. // "id": "compute.backendServices.list",
  30995. // "parameterOrder": [
  30996. // "project"
  30997. // ],
  30998. // "parameters": {
  30999. // "filter": {
  31000. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  31001. // "location": "query",
  31002. // "type": "string"
  31003. // },
  31004. // "maxResults": {
  31005. // "default": "500",
  31006. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  31007. // "format": "uint32",
  31008. // "location": "query",
  31009. // "minimum": "0",
  31010. // "type": "integer"
  31011. // },
  31012. // "orderBy": {
  31013. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  31014. // "location": "query",
  31015. // "type": "string"
  31016. // },
  31017. // "pageToken": {
  31018. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  31019. // "location": "query",
  31020. // "type": "string"
  31021. // },
  31022. // "project": {
  31023. // "description": "Project ID for this request.",
  31024. // "location": "path",
  31025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31026. // "required": true,
  31027. // "type": "string"
  31028. // }
  31029. // },
  31030. // "path": "{project}/global/backendServices",
  31031. // "response": {
  31032. // "$ref": "BackendServiceList"
  31033. // },
  31034. // "scopes": [
  31035. // "https://www.googleapis.com/auth/cloud-platform",
  31036. // "https://www.googleapis.com/auth/compute",
  31037. // "https://www.googleapis.com/auth/compute.readonly"
  31038. // ]
  31039. // }
  31040. }
  31041. // Pages invokes f for each page of results.
  31042. // A non-nil error returned from f will halt the iteration.
  31043. // The provided context supersedes any context provided to the Context method.
  31044. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  31045. c.ctx_ = ctx
  31046. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31047. for {
  31048. x, err := c.Do()
  31049. if err != nil {
  31050. return err
  31051. }
  31052. if err := f(x); err != nil {
  31053. return err
  31054. }
  31055. if x.NextPageToken == "" {
  31056. return nil
  31057. }
  31058. c.PageToken(x.NextPageToken)
  31059. }
  31060. }
  31061. // method id "compute.backendServices.patch":
  31062. type BackendServicesPatchCall struct {
  31063. s *Service
  31064. project string
  31065. backendService string
  31066. backendservice *BackendService
  31067. urlParams_ gensupport.URLParams
  31068. ctx_ context.Context
  31069. header_ http.Header
  31070. }
  31071. // Patch: Patches the specified BackendService resource with the data
  31072. // included in the request. There are several restrictions and
  31073. // guidelines to keep in mind when updating a backend service. Read
  31074. // Restrictions and Guidelines for more information. This method
  31075. // supports PATCH semantics and uses the JSON merge patch format and
  31076. // processing rules.
  31077. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  31078. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  31079. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31080. c.project = project
  31081. c.backendService = backendService
  31082. c.backendservice = backendservice
  31083. return c
  31084. }
  31085. // RequestId sets the optional parameter "requestId": An optional
  31086. // request ID to identify requests. Specify a unique request ID so that
  31087. // if you must retry your request, the server will know to ignore the
  31088. // request if it has already been completed.
  31089. //
  31090. // For example, consider a situation where you make an initial request
  31091. // and the request times out. If you make the request again with the
  31092. // same request ID, the server can check if original operation with the
  31093. // same request ID was received, and if so, will ignore the second
  31094. // request. This prevents clients from accidentally creating duplicate
  31095. // commitments.
  31096. //
  31097. // The request ID must be a valid UUID with the exception that zero UUID
  31098. // is not supported (00000000-0000-0000-0000-000000000000).
  31099. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  31100. c.urlParams_.Set("requestId", requestId)
  31101. return c
  31102. }
  31103. // Fields allows partial responses to be retrieved. See
  31104. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31105. // for more information.
  31106. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  31107. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31108. return c
  31109. }
  31110. // Context sets the context to be used in this call's Do method. Any
  31111. // pending HTTP request will be aborted if the provided context is
  31112. // canceled.
  31113. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  31114. c.ctx_ = ctx
  31115. return c
  31116. }
  31117. // Header returns an http.Header that can be modified by the caller to
  31118. // add HTTP headers to the request.
  31119. func (c *BackendServicesPatchCall) Header() http.Header {
  31120. if c.header_ == nil {
  31121. c.header_ = make(http.Header)
  31122. }
  31123. return c.header_
  31124. }
  31125. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  31126. reqHeaders := make(http.Header)
  31127. for k, v := range c.header_ {
  31128. reqHeaders[k] = v
  31129. }
  31130. reqHeaders.Set("User-Agent", c.s.userAgent())
  31131. var body io.Reader = nil
  31132. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  31133. if err != nil {
  31134. return nil, err
  31135. }
  31136. reqHeaders.Set("Content-Type", "application/json")
  31137. c.urlParams_.Set("alt", alt)
  31138. c.urlParams_.Set("prettyPrint", "false")
  31139. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31140. urls += "?" + c.urlParams_.Encode()
  31141. req, err := http.NewRequest("PATCH", urls, body)
  31142. if err != nil {
  31143. return nil, err
  31144. }
  31145. req.Header = reqHeaders
  31146. googleapi.Expand(req.URL, map[string]string{
  31147. "project": c.project,
  31148. "backendService": c.backendService,
  31149. })
  31150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31151. }
  31152. // Do executes the "compute.backendServices.patch" call.
  31153. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31154. // status code is an error. Response headers are in either
  31155. // *Operation.ServerResponse.Header or (if a response was returned at
  31156. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31157. // to check whether the returned error was because
  31158. // http.StatusNotModified was returned.
  31159. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31160. gensupport.SetOptions(c.urlParams_, opts...)
  31161. res, err := c.doRequest("json")
  31162. if res != nil && res.StatusCode == http.StatusNotModified {
  31163. if res.Body != nil {
  31164. res.Body.Close()
  31165. }
  31166. return nil, &googleapi.Error{
  31167. Code: res.StatusCode,
  31168. Header: res.Header,
  31169. }
  31170. }
  31171. if err != nil {
  31172. return nil, err
  31173. }
  31174. defer googleapi.CloseBody(res)
  31175. if err := googleapi.CheckResponse(res); err != nil {
  31176. return nil, err
  31177. }
  31178. ret := &Operation{
  31179. ServerResponse: googleapi.ServerResponse{
  31180. Header: res.Header,
  31181. HTTPStatusCode: res.StatusCode,
  31182. },
  31183. }
  31184. target := &ret
  31185. if err := gensupport.DecodeResponse(target, res); err != nil {
  31186. return nil, err
  31187. }
  31188. return ret, nil
  31189. // {
  31190. // "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  31191. // "httpMethod": "PATCH",
  31192. // "id": "compute.backendServices.patch",
  31193. // "parameterOrder": [
  31194. // "project",
  31195. // "backendService"
  31196. // ],
  31197. // "parameters": {
  31198. // "backendService": {
  31199. // "description": "Name of the BackendService resource to patch.",
  31200. // "location": "path",
  31201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31202. // "required": true,
  31203. // "type": "string"
  31204. // },
  31205. // "project": {
  31206. // "description": "Project ID for this request.",
  31207. // "location": "path",
  31208. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31209. // "required": true,
  31210. // "type": "string"
  31211. // },
  31212. // "requestId": {
  31213. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31214. // "location": "query",
  31215. // "type": "string"
  31216. // }
  31217. // },
  31218. // "path": "{project}/global/backendServices/{backendService}",
  31219. // "request": {
  31220. // "$ref": "BackendService"
  31221. // },
  31222. // "response": {
  31223. // "$ref": "Operation"
  31224. // },
  31225. // "scopes": [
  31226. // "https://www.googleapis.com/auth/cloud-platform",
  31227. // "https://www.googleapis.com/auth/compute"
  31228. // ]
  31229. // }
  31230. }
  31231. // method id "compute.backendServices.setSecurityPolicy":
  31232. type BackendServicesSetSecurityPolicyCall struct {
  31233. s *Service
  31234. project string
  31235. backendService string
  31236. securitypolicyreference *SecurityPolicyReference
  31237. urlParams_ gensupport.URLParams
  31238. ctx_ context.Context
  31239. header_ http.Header
  31240. }
  31241. // SetSecurityPolicy: Sets the security policy for the specified backend
  31242. // service.
  31243. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  31244. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31245. c.project = project
  31246. c.backendService = backendService
  31247. c.securitypolicyreference = securitypolicyreference
  31248. return c
  31249. }
  31250. // RequestId sets the optional parameter "requestId": An optional
  31251. // request ID to identify requests. Specify a unique request ID so that
  31252. // if you must retry your request, the server will know to ignore the
  31253. // request if it has already been completed.
  31254. //
  31255. // For example, consider a situation where you make an initial request
  31256. // and the request times out. If you make the request again with the
  31257. // same request ID, the server can check if original operation with the
  31258. // same request ID was received, and if so, will ignore the second
  31259. // request. This prevents clients from accidentally creating duplicate
  31260. // commitments.
  31261. //
  31262. // The request ID must be a valid UUID with the exception that zero UUID
  31263. // is not supported (00000000-0000-0000-0000-000000000000).
  31264. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  31265. c.urlParams_.Set("requestId", requestId)
  31266. return c
  31267. }
  31268. // Fields allows partial responses to be retrieved. See
  31269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31270. // for more information.
  31271. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  31272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31273. return c
  31274. }
  31275. // Context sets the context to be used in this call's Do method. Any
  31276. // pending HTTP request will be aborted if the provided context is
  31277. // canceled.
  31278. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  31279. c.ctx_ = ctx
  31280. return c
  31281. }
  31282. // Header returns an http.Header that can be modified by the caller to
  31283. // add HTTP headers to the request.
  31284. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  31285. if c.header_ == nil {
  31286. c.header_ = make(http.Header)
  31287. }
  31288. return c.header_
  31289. }
  31290. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  31291. reqHeaders := make(http.Header)
  31292. for k, v := range c.header_ {
  31293. reqHeaders[k] = v
  31294. }
  31295. reqHeaders.Set("User-Agent", c.s.userAgent())
  31296. var body io.Reader = nil
  31297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  31298. if err != nil {
  31299. return nil, err
  31300. }
  31301. reqHeaders.Set("Content-Type", "application/json")
  31302. c.urlParams_.Set("alt", alt)
  31303. c.urlParams_.Set("prettyPrint", "false")
  31304. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  31305. urls += "?" + c.urlParams_.Encode()
  31306. req, err := http.NewRequest("POST", urls, body)
  31307. if err != nil {
  31308. return nil, err
  31309. }
  31310. req.Header = reqHeaders
  31311. googleapi.Expand(req.URL, map[string]string{
  31312. "project": c.project,
  31313. "backendService": c.backendService,
  31314. })
  31315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31316. }
  31317. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  31318. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31319. // status code is an error. Response headers are in either
  31320. // *Operation.ServerResponse.Header or (if a response was returned at
  31321. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31322. // to check whether the returned error was because
  31323. // http.StatusNotModified was returned.
  31324. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31325. gensupport.SetOptions(c.urlParams_, opts...)
  31326. res, err := c.doRequest("json")
  31327. if res != nil && res.StatusCode == http.StatusNotModified {
  31328. if res.Body != nil {
  31329. res.Body.Close()
  31330. }
  31331. return nil, &googleapi.Error{
  31332. Code: res.StatusCode,
  31333. Header: res.Header,
  31334. }
  31335. }
  31336. if err != nil {
  31337. return nil, err
  31338. }
  31339. defer googleapi.CloseBody(res)
  31340. if err := googleapi.CheckResponse(res); err != nil {
  31341. return nil, err
  31342. }
  31343. ret := &Operation{
  31344. ServerResponse: googleapi.ServerResponse{
  31345. Header: res.Header,
  31346. HTTPStatusCode: res.StatusCode,
  31347. },
  31348. }
  31349. target := &ret
  31350. if err := gensupport.DecodeResponse(target, res); err != nil {
  31351. return nil, err
  31352. }
  31353. return ret, nil
  31354. // {
  31355. // "description": "Sets the security policy for the specified backend service.",
  31356. // "httpMethod": "POST",
  31357. // "id": "compute.backendServices.setSecurityPolicy",
  31358. // "parameterOrder": [
  31359. // "project",
  31360. // "backendService"
  31361. // ],
  31362. // "parameters": {
  31363. // "backendService": {
  31364. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  31365. // "location": "path",
  31366. // "required": true,
  31367. // "type": "string"
  31368. // },
  31369. // "project": {
  31370. // "description": "Project ID for this request.",
  31371. // "location": "path",
  31372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31373. // "required": true,
  31374. // "type": "string"
  31375. // },
  31376. // "requestId": {
  31377. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31378. // "location": "query",
  31379. // "type": "string"
  31380. // }
  31381. // },
  31382. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  31383. // "request": {
  31384. // "$ref": "SecurityPolicyReference"
  31385. // },
  31386. // "response": {
  31387. // "$ref": "Operation"
  31388. // },
  31389. // "scopes": [
  31390. // "https://www.googleapis.com/auth/cloud-platform",
  31391. // "https://www.googleapis.com/auth/compute"
  31392. // ]
  31393. // }
  31394. }
  31395. // method id "compute.backendServices.update":
  31396. type BackendServicesUpdateCall struct {
  31397. s *Service
  31398. project string
  31399. backendService string
  31400. backendservice *BackendService
  31401. urlParams_ gensupport.URLParams
  31402. ctx_ context.Context
  31403. header_ http.Header
  31404. }
  31405. // Update: Updates the specified BackendService resource with the data
  31406. // included in the request. There are several restrictions and
  31407. // guidelines to keep in mind when updating a backend service. Read
  31408. // Restrictions and Guidelines for more information.
  31409. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  31410. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  31411. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31412. c.project = project
  31413. c.backendService = backendService
  31414. c.backendservice = backendservice
  31415. return c
  31416. }
  31417. // RequestId sets the optional parameter "requestId": An optional
  31418. // request ID to identify requests. Specify a unique request ID so that
  31419. // if you must retry your request, the server will know to ignore the
  31420. // request if it has already been completed.
  31421. //
  31422. // For example, consider a situation where you make an initial request
  31423. // and the request times out. If you make the request again with the
  31424. // same request ID, the server can check if original operation with the
  31425. // same request ID was received, and if so, will ignore the second
  31426. // request. This prevents clients from accidentally creating duplicate
  31427. // commitments.
  31428. //
  31429. // The request ID must be a valid UUID with the exception that zero UUID
  31430. // is not supported (00000000-0000-0000-0000-000000000000).
  31431. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  31432. c.urlParams_.Set("requestId", requestId)
  31433. return c
  31434. }
  31435. // Fields allows partial responses to be retrieved. See
  31436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31437. // for more information.
  31438. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  31439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31440. return c
  31441. }
  31442. // Context sets the context to be used in this call's Do method. Any
  31443. // pending HTTP request will be aborted if the provided context is
  31444. // canceled.
  31445. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  31446. c.ctx_ = ctx
  31447. return c
  31448. }
  31449. // Header returns an http.Header that can be modified by the caller to
  31450. // add HTTP headers to the request.
  31451. func (c *BackendServicesUpdateCall) Header() http.Header {
  31452. if c.header_ == nil {
  31453. c.header_ = make(http.Header)
  31454. }
  31455. return c.header_
  31456. }
  31457. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  31458. reqHeaders := make(http.Header)
  31459. for k, v := range c.header_ {
  31460. reqHeaders[k] = v
  31461. }
  31462. reqHeaders.Set("User-Agent", c.s.userAgent())
  31463. var body io.Reader = nil
  31464. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  31465. if err != nil {
  31466. return nil, err
  31467. }
  31468. reqHeaders.Set("Content-Type", "application/json")
  31469. c.urlParams_.Set("alt", alt)
  31470. c.urlParams_.Set("prettyPrint", "false")
  31471. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31472. urls += "?" + c.urlParams_.Encode()
  31473. req, err := http.NewRequest("PUT", urls, body)
  31474. if err != nil {
  31475. return nil, err
  31476. }
  31477. req.Header = reqHeaders
  31478. googleapi.Expand(req.URL, map[string]string{
  31479. "project": c.project,
  31480. "backendService": c.backendService,
  31481. })
  31482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31483. }
  31484. // Do executes the "compute.backendServices.update" call.
  31485. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31486. // status code is an error. Response headers are in either
  31487. // *Operation.ServerResponse.Header or (if a response was returned at
  31488. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31489. // to check whether the returned error was because
  31490. // http.StatusNotModified was returned.
  31491. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31492. gensupport.SetOptions(c.urlParams_, opts...)
  31493. res, err := c.doRequest("json")
  31494. if res != nil && res.StatusCode == http.StatusNotModified {
  31495. if res.Body != nil {
  31496. res.Body.Close()
  31497. }
  31498. return nil, &googleapi.Error{
  31499. Code: res.StatusCode,
  31500. Header: res.Header,
  31501. }
  31502. }
  31503. if err != nil {
  31504. return nil, err
  31505. }
  31506. defer googleapi.CloseBody(res)
  31507. if err := googleapi.CheckResponse(res); err != nil {
  31508. return nil, err
  31509. }
  31510. ret := &Operation{
  31511. ServerResponse: googleapi.ServerResponse{
  31512. Header: res.Header,
  31513. HTTPStatusCode: res.StatusCode,
  31514. },
  31515. }
  31516. target := &ret
  31517. if err := gensupport.DecodeResponse(target, res); err != nil {
  31518. return nil, err
  31519. }
  31520. return ret, nil
  31521. // {
  31522. // "description": "Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  31523. // "httpMethod": "PUT",
  31524. // "id": "compute.backendServices.update",
  31525. // "parameterOrder": [
  31526. // "project",
  31527. // "backendService"
  31528. // ],
  31529. // "parameters": {
  31530. // "backendService": {
  31531. // "description": "Name of the BackendService resource to update.",
  31532. // "location": "path",
  31533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31534. // "required": true,
  31535. // "type": "string"
  31536. // },
  31537. // "project": {
  31538. // "description": "Project ID for this request.",
  31539. // "location": "path",
  31540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31541. // "required": true,
  31542. // "type": "string"
  31543. // },
  31544. // "requestId": {
  31545. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31546. // "location": "query",
  31547. // "type": "string"
  31548. // }
  31549. // },
  31550. // "path": "{project}/global/backendServices/{backendService}",
  31551. // "request": {
  31552. // "$ref": "BackendService"
  31553. // },
  31554. // "response": {
  31555. // "$ref": "Operation"
  31556. // },
  31557. // "scopes": [
  31558. // "https://www.googleapis.com/auth/cloud-platform",
  31559. // "https://www.googleapis.com/auth/compute"
  31560. // ]
  31561. // }
  31562. }
  31563. // method id "compute.diskTypes.aggregatedList":
  31564. type DiskTypesAggregatedListCall struct {
  31565. s *Service
  31566. project string
  31567. urlParams_ gensupport.URLParams
  31568. ifNoneMatch_ string
  31569. ctx_ context.Context
  31570. header_ http.Header
  31571. }
  31572. // AggregatedList: Retrieves an aggregated list of disk types.
  31573. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  31574. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  31575. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31576. c.project = project
  31577. return c
  31578. }
  31579. // Filter sets the optional parameter "filter": A filter expression that
  31580. // filters resources listed in the response. The expression must specify
  31581. // the field name, a comparison operator, and the value that you want to
  31582. // use for filtering. The value must be a string, a number, or a
  31583. // boolean. The comparison operator must be either =, !=, >, or <.
  31584. //
  31585. // For example, if you are filtering Compute Engine instances, you can
  31586. // exclude instances named example-instance by specifying name !=
  31587. // example-instance.
  31588. //
  31589. // You can also filter nested fields. For example, you could specify
  31590. // scheduling.automaticRestart = false to include instances only if they
  31591. // are not scheduled for automatic restarts. You can use filtering on
  31592. // nested fields to filter based on resource labels.
  31593. //
  31594. // To filter on multiple expressions, provide each separate expression
  31595. // within parentheses. For example, (scheduling.automaticRestart = true)
  31596. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31597. // AND expression. However, you can include AND and OR expressions
  31598. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31599. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31600. // true).
  31601. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  31602. c.urlParams_.Set("filter", filter)
  31603. return c
  31604. }
  31605. // MaxResults sets the optional parameter "maxResults": The maximum
  31606. // number of results per page that should be returned. If the number of
  31607. // available results is larger than maxResults, Compute Engine returns a
  31608. // nextPageToken that can be used to get the next page of results in
  31609. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31610. // (Default: 500)
  31611. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  31612. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31613. return c
  31614. }
  31615. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31616. // a certain order. By default, results are returned in alphanumerical
  31617. // order based on the resource name.
  31618. //
  31619. // You can also sort results in descending order based on the creation
  31620. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31621. // based on the creationTimestamp field in reverse chronological order
  31622. // (newest result first). Use this to sort resources like operations so
  31623. // that the newest operation is returned first.
  31624. //
  31625. // Currently, only sorting by name or creationTimestamp desc is
  31626. // supported.
  31627. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  31628. c.urlParams_.Set("orderBy", orderBy)
  31629. return c
  31630. }
  31631. // PageToken sets the optional parameter "pageToken": Specifies a page
  31632. // token to use. Set pageToken to the nextPageToken returned by a
  31633. // previous list request to get the next page of results.
  31634. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  31635. c.urlParams_.Set("pageToken", pageToken)
  31636. return c
  31637. }
  31638. // Fields allows partial responses to be retrieved. See
  31639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31640. // for more information.
  31641. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  31642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31643. return c
  31644. }
  31645. // IfNoneMatch sets the optional parameter which makes the operation
  31646. // fail if the object's ETag matches the given value. This is useful for
  31647. // getting updates only after the object has changed since the last
  31648. // request. Use googleapi.IsNotModified to check whether the response
  31649. // error from Do is the result of In-None-Match.
  31650. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  31651. c.ifNoneMatch_ = entityTag
  31652. return c
  31653. }
  31654. // Context sets the context to be used in this call's Do method. Any
  31655. // pending HTTP request will be aborted if the provided context is
  31656. // canceled.
  31657. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  31658. c.ctx_ = ctx
  31659. return c
  31660. }
  31661. // Header returns an http.Header that can be modified by the caller to
  31662. // add HTTP headers to the request.
  31663. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  31664. if c.header_ == nil {
  31665. c.header_ = make(http.Header)
  31666. }
  31667. return c.header_
  31668. }
  31669. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31670. reqHeaders := make(http.Header)
  31671. for k, v := range c.header_ {
  31672. reqHeaders[k] = v
  31673. }
  31674. reqHeaders.Set("User-Agent", c.s.userAgent())
  31675. if c.ifNoneMatch_ != "" {
  31676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31677. }
  31678. var body io.Reader = nil
  31679. c.urlParams_.Set("alt", alt)
  31680. c.urlParams_.Set("prettyPrint", "false")
  31681. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  31682. urls += "?" + c.urlParams_.Encode()
  31683. req, err := http.NewRequest("GET", urls, body)
  31684. if err != nil {
  31685. return nil, err
  31686. }
  31687. req.Header = reqHeaders
  31688. googleapi.Expand(req.URL, map[string]string{
  31689. "project": c.project,
  31690. })
  31691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31692. }
  31693. // Do executes the "compute.diskTypes.aggregatedList" call.
  31694. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  31695. // non-2xx status code is an error. Response headers are in either
  31696. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  31697. // returned at all) in error.(*googleapi.Error).Header. Use
  31698. // googleapi.IsNotModified to check whether the returned error was
  31699. // because http.StatusNotModified was returned.
  31700. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  31701. gensupport.SetOptions(c.urlParams_, opts...)
  31702. res, err := c.doRequest("json")
  31703. if res != nil && res.StatusCode == http.StatusNotModified {
  31704. if res.Body != nil {
  31705. res.Body.Close()
  31706. }
  31707. return nil, &googleapi.Error{
  31708. Code: res.StatusCode,
  31709. Header: res.Header,
  31710. }
  31711. }
  31712. if err != nil {
  31713. return nil, err
  31714. }
  31715. defer googleapi.CloseBody(res)
  31716. if err := googleapi.CheckResponse(res); err != nil {
  31717. return nil, err
  31718. }
  31719. ret := &DiskTypeAggregatedList{
  31720. ServerResponse: googleapi.ServerResponse{
  31721. Header: res.Header,
  31722. HTTPStatusCode: res.StatusCode,
  31723. },
  31724. }
  31725. target := &ret
  31726. if err := gensupport.DecodeResponse(target, res); err != nil {
  31727. return nil, err
  31728. }
  31729. return ret, nil
  31730. // {
  31731. // "description": "Retrieves an aggregated list of disk types.",
  31732. // "httpMethod": "GET",
  31733. // "id": "compute.diskTypes.aggregatedList",
  31734. // "parameterOrder": [
  31735. // "project"
  31736. // ],
  31737. // "parameters": {
  31738. // "filter": {
  31739. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  31740. // "location": "query",
  31741. // "type": "string"
  31742. // },
  31743. // "maxResults": {
  31744. // "default": "500",
  31745. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  31746. // "format": "uint32",
  31747. // "location": "query",
  31748. // "minimum": "0",
  31749. // "type": "integer"
  31750. // },
  31751. // "orderBy": {
  31752. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  31753. // "location": "query",
  31754. // "type": "string"
  31755. // },
  31756. // "pageToken": {
  31757. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  31758. // "location": "query",
  31759. // "type": "string"
  31760. // },
  31761. // "project": {
  31762. // "description": "Project ID for this request.",
  31763. // "location": "path",
  31764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31765. // "required": true,
  31766. // "type": "string"
  31767. // }
  31768. // },
  31769. // "path": "{project}/aggregated/diskTypes",
  31770. // "response": {
  31771. // "$ref": "DiskTypeAggregatedList"
  31772. // },
  31773. // "scopes": [
  31774. // "https://www.googleapis.com/auth/cloud-platform",
  31775. // "https://www.googleapis.com/auth/compute",
  31776. // "https://www.googleapis.com/auth/compute.readonly"
  31777. // ]
  31778. // }
  31779. }
  31780. // Pages invokes f for each page of results.
  31781. // A non-nil error returned from f will halt the iteration.
  31782. // The provided context supersedes any context provided to the Context method.
  31783. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  31784. c.ctx_ = ctx
  31785. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31786. for {
  31787. x, err := c.Do()
  31788. if err != nil {
  31789. return err
  31790. }
  31791. if err := f(x); err != nil {
  31792. return err
  31793. }
  31794. if x.NextPageToken == "" {
  31795. return nil
  31796. }
  31797. c.PageToken(x.NextPageToken)
  31798. }
  31799. }
  31800. // method id "compute.diskTypes.get":
  31801. type DiskTypesGetCall struct {
  31802. s *Service
  31803. project string
  31804. zone string
  31805. diskType string
  31806. urlParams_ gensupport.URLParams
  31807. ifNoneMatch_ string
  31808. ctx_ context.Context
  31809. header_ http.Header
  31810. }
  31811. // Get: Returns the specified disk type. Gets a list of available disk
  31812. // types by making a list() request.
  31813. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  31814. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  31815. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31816. c.project = project
  31817. c.zone = zone
  31818. c.diskType = diskType
  31819. return c
  31820. }
  31821. // Fields allows partial responses to be retrieved. See
  31822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31823. // for more information.
  31824. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  31825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31826. return c
  31827. }
  31828. // IfNoneMatch sets the optional parameter which makes the operation
  31829. // fail if the object's ETag matches the given value. This is useful for
  31830. // getting updates only after the object has changed since the last
  31831. // request. Use googleapi.IsNotModified to check whether the response
  31832. // error from Do is the result of In-None-Match.
  31833. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  31834. c.ifNoneMatch_ = entityTag
  31835. return c
  31836. }
  31837. // Context sets the context to be used in this call's Do method. Any
  31838. // pending HTTP request will be aborted if the provided context is
  31839. // canceled.
  31840. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  31841. c.ctx_ = ctx
  31842. return c
  31843. }
  31844. // Header returns an http.Header that can be modified by the caller to
  31845. // add HTTP headers to the request.
  31846. func (c *DiskTypesGetCall) Header() http.Header {
  31847. if c.header_ == nil {
  31848. c.header_ = make(http.Header)
  31849. }
  31850. return c.header_
  31851. }
  31852. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  31853. reqHeaders := make(http.Header)
  31854. for k, v := range c.header_ {
  31855. reqHeaders[k] = v
  31856. }
  31857. reqHeaders.Set("User-Agent", c.s.userAgent())
  31858. if c.ifNoneMatch_ != "" {
  31859. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31860. }
  31861. var body io.Reader = nil
  31862. c.urlParams_.Set("alt", alt)
  31863. c.urlParams_.Set("prettyPrint", "false")
  31864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  31865. urls += "?" + c.urlParams_.Encode()
  31866. req, err := http.NewRequest("GET", urls, body)
  31867. if err != nil {
  31868. return nil, err
  31869. }
  31870. req.Header = reqHeaders
  31871. googleapi.Expand(req.URL, map[string]string{
  31872. "project": c.project,
  31873. "zone": c.zone,
  31874. "diskType": c.diskType,
  31875. })
  31876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31877. }
  31878. // Do executes the "compute.diskTypes.get" call.
  31879. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  31880. // code is an error. Response headers are in either
  31881. // *DiskType.ServerResponse.Header or (if a response was returned at
  31882. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31883. // to check whether the returned error was because
  31884. // http.StatusNotModified was returned.
  31885. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  31886. gensupport.SetOptions(c.urlParams_, opts...)
  31887. res, err := c.doRequest("json")
  31888. if res != nil && res.StatusCode == http.StatusNotModified {
  31889. if res.Body != nil {
  31890. res.Body.Close()
  31891. }
  31892. return nil, &googleapi.Error{
  31893. Code: res.StatusCode,
  31894. Header: res.Header,
  31895. }
  31896. }
  31897. if err != nil {
  31898. return nil, err
  31899. }
  31900. defer googleapi.CloseBody(res)
  31901. if err := googleapi.CheckResponse(res); err != nil {
  31902. return nil, err
  31903. }
  31904. ret := &DiskType{
  31905. ServerResponse: googleapi.ServerResponse{
  31906. Header: res.Header,
  31907. HTTPStatusCode: res.StatusCode,
  31908. },
  31909. }
  31910. target := &ret
  31911. if err := gensupport.DecodeResponse(target, res); err != nil {
  31912. return nil, err
  31913. }
  31914. return ret, nil
  31915. // {
  31916. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  31917. // "httpMethod": "GET",
  31918. // "id": "compute.diskTypes.get",
  31919. // "parameterOrder": [
  31920. // "project",
  31921. // "zone",
  31922. // "diskType"
  31923. // ],
  31924. // "parameters": {
  31925. // "diskType": {
  31926. // "description": "Name of the disk type to return.",
  31927. // "location": "path",
  31928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31929. // "required": true,
  31930. // "type": "string"
  31931. // },
  31932. // "project": {
  31933. // "description": "Project ID for this request.",
  31934. // "location": "path",
  31935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31936. // "required": true,
  31937. // "type": "string"
  31938. // },
  31939. // "zone": {
  31940. // "description": "The name of the zone for this request.",
  31941. // "location": "path",
  31942. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31943. // "required": true,
  31944. // "type": "string"
  31945. // }
  31946. // },
  31947. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  31948. // "response": {
  31949. // "$ref": "DiskType"
  31950. // },
  31951. // "scopes": [
  31952. // "https://www.googleapis.com/auth/cloud-platform",
  31953. // "https://www.googleapis.com/auth/compute",
  31954. // "https://www.googleapis.com/auth/compute.readonly"
  31955. // ]
  31956. // }
  31957. }
  31958. // method id "compute.diskTypes.list":
  31959. type DiskTypesListCall struct {
  31960. s *Service
  31961. project string
  31962. zone string
  31963. urlParams_ gensupport.URLParams
  31964. ifNoneMatch_ string
  31965. ctx_ context.Context
  31966. header_ http.Header
  31967. }
  31968. // List: Retrieves a list of disk types available to the specified
  31969. // project.
  31970. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  31971. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  31972. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31973. c.project = project
  31974. c.zone = zone
  31975. return c
  31976. }
  31977. // Filter sets the optional parameter "filter": A filter expression that
  31978. // filters resources listed in the response. The expression must specify
  31979. // the field name, a comparison operator, and the value that you want to
  31980. // use for filtering. The value must be a string, a number, or a
  31981. // boolean. The comparison operator must be either =, !=, >, or <.
  31982. //
  31983. // For example, if you are filtering Compute Engine instances, you can
  31984. // exclude instances named example-instance by specifying name !=
  31985. // example-instance.
  31986. //
  31987. // You can also filter nested fields. For example, you could specify
  31988. // scheduling.automaticRestart = false to include instances only if they
  31989. // are not scheduled for automatic restarts. You can use filtering on
  31990. // nested fields to filter based on resource labels.
  31991. //
  31992. // To filter on multiple expressions, provide each separate expression
  31993. // within parentheses. For example, (scheduling.automaticRestart = true)
  31994. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31995. // AND expression. However, you can include AND and OR expressions
  31996. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31997. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31998. // true).
  31999. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  32000. c.urlParams_.Set("filter", filter)
  32001. return c
  32002. }
  32003. // MaxResults sets the optional parameter "maxResults": The maximum
  32004. // number of results per page that should be returned. If the number of
  32005. // available results is larger than maxResults, Compute Engine returns a
  32006. // nextPageToken that can be used to get the next page of results in
  32007. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32008. // (Default: 500)
  32009. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  32010. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32011. return c
  32012. }
  32013. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32014. // a certain order. By default, results are returned in alphanumerical
  32015. // order based on the resource name.
  32016. //
  32017. // You can also sort results in descending order based on the creation
  32018. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32019. // based on the creationTimestamp field in reverse chronological order
  32020. // (newest result first). Use this to sort resources like operations so
  32021. // that the newest operation is returned first.
  32022. //
  32023. // Currently, only sorting by name or creationTimestamp desc is
  32024. // supported.
  32025. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  32026. c.urlParams_.Set("orderBy", orderBy)
  32027. return c
  32028. }
  32029. // PageToken sets the optional parameter "pageToken": Specifies a page
  32030. // token to use. Set pageToken to the nextPageToken returned by a
  32031. // previous list request to get the next page of results.
  32032. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  32033. c.urlParams_.Set("pageToken", pageToken)
  32034. return c
  32035. }
  32036. // Fields allows partial responses to be retrieved. See
  32037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32038. // for more information.
  32039. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  32040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32041. return c
  32042. }
  32043. // IfNoneMatch sets the optional parameter which makes the operation
  32044. // fail if the object's ETag matches the given value. This is useful for
  32045. // getting updates only after the object has changed since the last
  32046. // request. Use googleapi.IsNotModified to check whether the response
  32047. // error from Do is the result of In-None-Match.
  32048. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  32049. c.ifNoneMatch_ = entityTag
  32050. return c
  32051. }
  32052. // Context sets the context to be used in this call's Do method. Any
  32053. // pending HTTP request will be aborted if the provided context is
  32054. // canceled.
  32055. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  32056. c.ctx_ = ctx
  32057. return c
  32058. }
  32059. // Header returns an http.Header that can be modified by the caller to
  32060. // add HTTP headers to the request.
  32061. func (c *DiskTypesListCall) Header() http.Header {
  32062. if c.header_ == nil {
  32063. c.header_ = make(http.Header)
  32064. }
  32065. return c.header_
  32066. }
  32067. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  32068. reqHeaders := make(http.Header)
  32069. for k, v := range c.header_ {
  32070. reqHeaders[k] = v
  32071. }
  32072. reqHeaders.Set("User-Agent", c.s.userAgent())
  32073. if c.ifNoneMatch_ != "" {
  32074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32075. }
  32076. var body io.Reader = nil
  32077. c.urlParams_.Set("alt", alt)
  32078. c.urlParams_.Set("prettyPrint", "false")
  32079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  32080. urls += "?" + c.urlParams_.Encode()
  32081. req, err := http.NewRequest("GET", urls, body)
  32082. if err != nil {
  32083. return nil, err
  32084. }
  32085. req.Header = reqHeaders
  32086. googleapi.Expand(req.URL, map[string]string{
  32087. "project": c.project,
  32088. "zone": c.zone,
  32089. })
  32090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32091. }
  32092. // Do executes the "compute.diskTypes.list" call.
  32093. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  32094. // status code is an error. Response headers are in either
  32095. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  32096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32097. // to check whether the returned error was because
  32098. // http.StatusNotModified was returned.
  32099. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  32100. gensupport.SetOptions(c.urlParams_, opts...)
  32101. res, err := c.doRequest("json")
  32102. if res != nil && res.StatusCode == http.StatusNotModified {
  32103. if res.Body != nil {
  32104. res.Body.Close()
  32105. }
  32106. return nil, &googleapi.Error{
  32107. Code: res.StatusCode,
  32108. Header: res.Header,
  32109. }
  32110. }
  32111. if err != nil {
  32112. return nil, err
  32113. }
  32114. defer googleapi.CloseBody(res)
  32115. if err := googleapi.CheckResponse(res); err != nil {
  32116. return nil, err
  32117. }
  32118. ret := &DiskTypeList{
  32119. ServerResponse: googleapi.ServerResponse{
  32120. Header: res.Header,
  32121. HTTPStatusCode: res.StatusCode,
  32122. },
  32123. }
  32124. target := &ret
  32125. if err := gensupport.DecodeResponse(target, res); err != nil {
  32126. return nil, err
  32127. }
  32128. return ret, nil
  32129. // {
  32130. // "description": "Retrieves a list of disk types available to the specified project.",
  32131. // "httpMethod": "GET",
  32132. // "id": "compute.diskTypes.list",
  32133. // "parameterOrder": [
  32134. // "project",
  32135. // "zone"
  32136. // ],
  32137. // "parameters": {
  32138. // "filter": {
  32139. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  32140. // "location": "query",
  32141. // "type": "string"
  32142. // },
  32143. // "maxResults": {
  32144. // "default": "500",
  32145. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32146. // "format": "uint32",
  32147. // "location": "query",
  32148. // "minimum": "0",
  32149. // "type": "integer"
  32150. // },
  32151. // "orderBy": {
  32152. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32153. // "location": "query",
  32154. // "type": "string"
  32155. // },
  32156. // "pageToken": {
  32157. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32158. // "location": "query",
  32159. // "type": "string"
  32160. // },
  32161. // "project": {
  32162. // "description": "Project ID for this request.",
  32163. // "location": "path",
  32164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32165. // "required": true,
  32166. // "type": "string"
  32167. // },
  32168. // "zone": {
  32169. // "description": "The name of the zone for this request.",
  32170. // "location": "path",
  32171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32172. // "required": true,
  32173. // "type": "string"
  32174. // }
  32175. // },
  32176. // "path": "{project}/zones/{zone}/diskTypes",
  32177. // "response": {
  32178. // "$ref": "DiskTypeList"
  32179. // },
  32180. // "scopes": [
  32181. // "https://www.googleapis.com/auth/cloud-platform",
  32182. // "https://www.googleapis.com/auth/compute",
  32183. // "https://www.googleapis.com/auth/compute.readonly"
  32184. // ]
  32185. // }
  32186. }
  32187. // Pages invokes f for each page of results.
  32188. // A non-nil error returned from f will halt the iteration.
  32189. // The provided context supersedes any context provided to the Context method.
  32190. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  32191. c.ctx_ = ctx
  32192. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32193. for {
  32194. x, err := c.Do()
  32195. if err != nil {
  32196. return err
  32197. }
  32198. if err := f(x); err != nil {
  32199. return err
  32200. }
  32201. if x.NextPageToken == "" {
  32202. return nil
  32203. }
  32204. c.PageToken(x.NextPageToken)
  32205. }
  32206. }
  32207. // method id "compute.disks.aggregatedList":
  32208. type DisksAggregatedListCall struct {
  32209. s *Service
  32210. project string
  32211. urlParams_ gensupport.URLParams
  32212. ifNoneMatch_ string
  32213. ctx_ context.Context
  32214. header_ http.Header
  32215. }
  32216. // AggregatedList: Retrieves an aggregated list of persistent disks.
  32217. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  32218. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  32219. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32220. c.project = project
  32221. return c
  32222. }
  32223. // Filter sets the optional parameter "filter": A filter expression that
  32224. // filters resources listed in the response. The expression must specify
  32225. // the field name, a comparison operator, and the value that you want to
  32226. // use for filtering. The value must be a string, a number, or a
  32227. // boolean. The comparison operator must be either =, !=, >, or <.
  32228. //
  32229. // For example, if you are filtering Compute Engine instances, you can
  32230. // exclude instances named example-instance by specifying name !=
  32231. // example-instance.
  32232. //
  32233. // You can also filter nested fields. For example, you could specify
  32234. // scheduling.automaticRestart = false to include instances only if they
  32235. // are not scheduled for automatic restarts. You can use filtering on
  32236. // nested fields to filter based on resource labels.
  32237. //
  32238. // To filter on multiple expressions, provide each separate expression
  32239. // within parentheses. For example, (scheduling.automaticRestart = true)
  32240. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32241. // AND expression. However, you can include AND and OR expressions
  32242. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32243. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32244. // true).
  32245. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  32246. c.urlParams_.Set("filter", filter)
  32247. return c
  32248. }
  32249. // MaxResults sets the optional parameter "maxResults": The maximum
  32250. // number of results per page that should be returned. If the number of
  32251. // available results is larger than maxResults, Compute Engine returns a
  32252. // nextPageToken that can be used to get the next page of results in
  32253. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32254. // (Default: 500)
  32255. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  32256. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32257. return c
  32258. }
  32259. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32260. // a certain order. By default, results are returned in alphanumerical
  32261. // order based on the resource name.
  32262. //
  32263. // You can also sort results in descending order based on the creation
  32264. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32265. // based on the creationTimestamp field in reverse chronological order
  32266. // (newest result first). Use this to sort resources like operations so
  32267. // that the newest operation is returned first.
  32268. //
  32269. // Currently, only sorting by name or creationTimestamp desc is
  32270. // supported.
  32271. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  32272. c.urlParams_.Set("orderBy", orderBy)
  32273. return c
  32274. }
  32275. // PageToken sets the optional parameter "pageToken": Specifies a page
  32276. // token to use. Set pageToken to the nextPageToken returned by a
  32277. // previous list request to get the next page of results.
  32278. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  32279. c.urlParams_.Set("pageToken", pageToken)
  32280. return c
  32281. }
  32282. // Fields allows partial responses to be retrieved. See
  32283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32284. // for more information.
  32285. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  32286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32287. return c
  32288. }
  32289. // IfNoneMatch sets the optional parameter which makes the operation
  32290. // fail if the object's ETag matches the given value. This is useful for
  32291. // getting updates only after the object has changed since the last
  32292. // request. Use googleapi.IsNotModified to check whether the response
  32293. // error from Do is the result of In-None-Match.
  32294. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  32295. c.ifNoneMatch_ = entityTag
  32296. return c
  32297. }
  32298. // Context sets the context to be used in this call's Do method. Any
  32299. // pending HTTP request will be aborted if the provided context is
  32300. // canceled.
  32301. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  32302. c.ctx_ = ctx
  32303. return c
  32304. }
  32305. // Header returns an http.Header that can be modified by the caller to
  32306. // add HTTP headers to the request.
  32307. func (c *DisksAggregatedListCall) Header() http.Header {
  32308. if c.header_ == nil {
  32309. c.header_ = make(http.Header)
  32310. }
  32311. return c.header_
  32312. }
  32313. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32314. reqHeaders := make(http.Header)
  32315. for k, v := range c.header_ {
  32316. reqHeaders[k] = v
  32317. }
  32318. reqHeaders.Set("User-Agent", c.s.userAgent())
  32319. if c.ifNoneMatch_ != "" {
  32320. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32321. }
  32322. var body io.Reader = nil
  32323. c.urlParams_.Set("alt", alt)
  32324. c.urlParams_.Set("prettyPrint", "false")
  32325. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  32326. urls += "?" + c.urlParams_.Encode()
  32327. req, err := http.NewRequest("GET", urls, body)
  32328. if err != nil {
  32329. return nil, err
  32330. }
  32331. req.Header = reqHeaders
  32332. googleapi.Expand(req.URL, map[string]string{
  32333. "project": c.project,
  32334. })
  32335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32336. }
  32337. // Do executes the "compute.disks.aggregatedList" call.
  32338. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  32339. // non-2xx status code is an error. Response headers are in either
  32340. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  32341. // returned at all) in error.(*googleapi.Error).Header. Use
  32342. // googleapi.IsNotModified to check whether the returned error was
  32343. // because http.StatusNotModified was returned.
  32344. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  32345. gensupport.SetOptions(c.urlParams_, opts...)
  32346. res, err := c.doRequest("json")
  32347. if res != nil && res.StatusCode == http.StatusNotModified {
  32348. if res.Body != nil {
  32349. res.Body.Close()
  32350. }
  32351. return nil, &googleapi.Error{
  32352. Code: res.StatusCode,
  32353. Header: res.Header,
  32354. }
  32355. }
  32356. if err != nil {
  32357. return nil, err
  32358. }
  32359. defer googleapi.CloseBody(res)
  32360. if err := googleapi.CheckResponse(res); err != nil {
  32361. return nil, err
  32362. }
  32363. ret := &DiskAggregatedList{
  32364. ServerResponse: googleapi.ServerResponse{
  32365. Header: res.Header,
  32366. HTTPStatusCode: res.StatusCode,
  32367. },
  32368. }
  32369. target := &ret
  32370. if err := gensupport.DecodeResponse(target, res); err != nil {
  32371. return nil, err
  32372. }
  32373. return ret, nil
  32374. // {
  32375. // "description": "Retrieves an aggregated list of persistent disks.",
  32376. // "httpMethod": "GET",
  32377. // "id": "compute.disks.aggregatedList",
  32378. // "parameterOrder": [
  32379. // "project"
  32380. // ],
  32381. // "parameters": {
  32382. // "filter": {
  32383. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  32384. // "location": "query",
  32385. // "type": "string"
  32386. // },
  32387. // "maxResults": {
  32388. // "default": "500",
  32389. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32390. // "format": "uint32",
  32391. // "location": "query",
  32392. // "minimum": "0",
  32393. // "type": "integer"
  32394. // },
  32395. // "orderBy": {
  32396. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32397. // "location": "query",
  32398. // "type": "string"
  32399. // },
  32400. // "pageToken": {
  32401. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32402. // "location": "query",
  32403. // "type": "string"
  32404. // },
  32405. // "project": {
  32406. // "description": "Project ID for this request.",
  32407. // "location": "path",
  32408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32409. // "required": true,
  32410. // "type": "string"
  32411. // }
  32412. // },
  32413. // "path": "{project}/aggregated/disks",
  32414. // "response": {
  32415. // "$ref": "DiskAggregatedList"
  32416. // },
  32417. // "scopes": [
  32418. // "https://www.googleapis.com/auth/cloud-platform",
  32419. // "https://www.googleapis.com/auth/compute",
  32420. // "https://www.googleapis.com/auth/compute.readonly"
  32421. // ]
  32422. // }
  32423. }
  32424. // Pages invokes f for each page of results.
  32425. // A non-nil error returned from f will halt the iteration.
  32426. // The provided context supersedes any context provided to the Context method.
  32427. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  32428. c.ctx_ = ctx
  32429. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32430. for {
  32431. x, err := c.Do()
  32432. if err != nil {
  32433. return err
  32434. }
  32435. if err := f(x); err != nil {
  32436. return err
  32437. }
  32438. if x.NextPageToken == "" {
  32439. return nil
  32440. }
  32441. c.PageToken(x.NextPageToken)
  32442. }
  32443. }
  32444. // method id "compute.disks.createSnapshot":
  32445. type DisksCreateSnapshotCall struct {
  32446. s *Service
  32447. project string
  32448. zone string
  32449. disk string
  32450. snapshot *Snapshot
  32451. urlParams_ gensupport.URLParams
  32452. ctx_ context.Context
  32453. header_ http.Header
  32454. }
  32455. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  32456. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  32457. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  32458. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32459. c.project = project
  32460. c.zone = zone
  32461. c.disk = disk
  32462. c.snapshot = snapshot
  32463. return c
  32464. }
  32465. // GuestFlush sets the optional parameter "guestFlush":
  32466. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  32467. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  32468. return c
  32469. }
  32470. // RequestId sets the optional parameter "requestId": An optional
  32471. // request ID to identify requests. Specify a unique request ID so that
  32472. // if you must retry your request, the server will know to ignore the
  32473. // request if it has already been completed.
  32474. //
  32475. // For example, consider a situation where you make an initial request
  32476. // and the request times out. If you make the request again with the
  32477. // same request ID, the server can check if original operation with the
  32478. // same request ID was received, and if so, will ignore the second
  32479. // request. This prevents clients from accidentally creating duplicate
  32480. // commitments.
  32481. //
  32482. // The request ID must be a valid UUID with the exception that zero UUID
  32483. // is not supported (00000000-0000-0000-0000-000000000000).
  32484. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  32485. c.urlParams_.Set("requestId", requestId)
  32486. return c
  32487. }
  32488. // Fields allows partial responses to be retrieved. See
  32489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32490. // for more information.
  32491. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  32492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32493. return c
  32494. }
  32495. // Context sets the context to be used in this call's Do method. Any
  32496. // pending HTTP request will be aborted if the provided context is
  32497. // canceled.
  32498. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  32499. c.ctx_ = ctx
  32500. return c
  32501. }
  32502. // Header returns an http.Header that can be modified by the caller to
  32503. // add HTTP headers to the request.
  32504. func (c *DisksCreateSnapshotCall) Header() http.Header {
  32505. if c.header_ == nil {
  32506. c.header_ = make(http.Header)
  32507. }
  32508. return c.header_
  32509. }
  32510. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  32511. reqHeaders := make(http.Header)
  32512. for k, v := range c.header_ {
  32513. reqHeaders[k] = v
  32514. }
  32515. reqHeaders.Set("User-Agent", c.s.userAgent())
  32516. var body io.Reader = nil
  32517. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  32518. if err != nil {
  32519. return nil, err
  32520. }
  32521. reqHeaders.Set("Content-Type", "application/json")
  32522. c.urlParams_.Set("alt", alt)
  32523. c.urlParams_.Set("prettyPrint", "false")
  32524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  32525. urls += "?" + c.urlParams_.Encode()
  32526. req, err := http.NewRequest("POST", urls, body)
  32527. if err != nil {
  32528. return nil, err
  32529. }
  32530. req.Header = reqHeaders
  32531. googleapi.Expand(req.URL, map[string]string{
  32532. "project": c.project,
  32533. "zone": c.zone,
  32534. "disk": c.disk,
  32535. })
  32536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32537. }
  32538. // Do executes the "compute.disks.createSnapshot" call.
  32539. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32540. // status code is an error. Response headers are in either
  32541. // *Operation.ServerResponse.Header or (if a response was returned at
  32542. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32543. // to check whether the returned error was because
  32544. // http.StatusNotModified was returned.
  32545. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32546. gensupport.SetOptions(c.urlParams_, opts...)
  32547. res, err := c.doRequest("json")
  32548. if res != nil && res.StatusCode == http.StatusNotModified {
  32549. if res.Body != nil {
  32550. res.Body.Close()
  32551. }
  32552. return nil, &googleapi.Error{
  32553. Code: res.StatusCode,
  32554. Header: res.Header,
  32555. }
  32556. }
  32557. if err != nil {
  32558. return nil, err
  32559. }
  32560. defer googleapi.CloseBody(res)
  32561. if err := googleapi.CheckResponse(res); err != nil {
  32562. return nil, err
  32563. }
  32564. ret := &Operation{
  32565. ServerResponse: googleapi.ServerResponse{
  32566. Header: res.Header,
  32567. HTTPStatusCode: res.StatusCode,
  32568. },
  32569. }
  32570. target := &ret
  32571. if err := gensupport.DecodeResponse(target, res); err != nil {
  32572. return nil, err
  32573. }
  32574. return ret, nil
  32575. // {
  32576. // "description": "Creates a snapshot of a specified persistent disk.",
  32577. // "httpMethod": "POST",
  32578. // "id": "compute.disks.createSnapshot",
  32579. // "parameterOrder": [
  32580. // "project",
  32581. // "zone",
  32582. // "disk"
  32583. // ],
  32584. // "parameters": {
  32585. // "disk": {
  32586. // "description": "Name of the persistent disk to snapshot.",
  32587. // "location": "path",
  32588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32589. // "required": true,
  32590. // "type": "string"
  32591. // },
  32592. // "guestFlush": {
  32593. // "location": "query",
  32594. // "type": "boolean"
  32595. // },
  32596. // "project": {
  32597. // "description": "Project ID for this request.",
  32598. // "location": "path",
  32599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32600. // "required": true,
  32601. // "type": "string"
  32602. // },
  32603. // "requestId": {
  32604. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32605. // "location": "query",
  32606. // "type": "string"
  32607. // },
  32608. // "zone": {
  32609. // "description": "The name of the zone for this request.",
  32610. // "location": "path",
  32611. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32612. // "required": true,
  32613. // "type": "string"
  32614. // }
  32615. // },
  32616. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  32617. // "request": {
  32618. // "$ref": "Snapshot"
  32619. // },
  32620. // "response": {
  32621. // "$ref": "Operation"
  32622. // },
  32623. // "scopes": [
  32624. // "https://www.googleapis.com/auth/cloud-platform",
  32625. // "https://www.googleapis.com/auth/compute"
  32626. // ]
  32627. // }
  32628. }
  32629. // method id "compute.disks.delete":
  32630. type DisksDeleteCall struct {
  32631. s *Service
  32632. project string
  32633. zone string
  32634. disk string
  32635. urlParams_ gensupport.URLParams
  32636. ctx_ context.Context
  32637. header_ http.Header
  32638. }
  32639. // Delete: Deletes the specified persistent disk. Deleting a disk
  32640. // removes its data permanently and is irreversible. However, deleting a
  32641. // disk does not delete any snapshots previously made from the disk. You
  32642. // must separately delete snapshots.
  32643. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  32644. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  32645. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32646. c.project = project
  32647. c.zone = zone
  32648. c.disk = disk
  32649. return c
  32650. }
  32651. // RequestId sets the optional parameter "requestId": An optional
  32652. // request ID to identify requests. Specify a unique request ID so that
  32653. // if you must retry your request, the server will know to ignore the
  32654. // request if it has already been completed.
  32655. //
  32656. // For example, consider a situation where you make an initial request
  32657. // and the request times out. If you make the request again with the
  32658. // same request ID, the server can check if original operation with the
  32659. // same request ID was received, and if so, will ignore the second
  32660. // request. This prevents clients from accidentally creating duplicate
  32661. // commitments.
  32662. //
  32663. // The request ID must be a valid UUID with the exception that zero UUID
  32664. // is not supported (00000000-0000-0000-0000-000000000000).
  32665. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  32666. c.urlParams_.Set("requestId", requestId)
  32667. return c
  32668. }
  32669. // Fields allows partial responses to be retrieved. See
  32670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32671. // for more information.
  32672. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  32673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32674. return c
  32675. }
  32676. // Context sets the context to be used in this call's Do method. Any
  32677. // pending HTTP request will be aborted if the provided context is
  32678. // canceled.
  32679. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  32680. c.ctx_ = ctx
  32681. return c
  32682. }
  32683. // Header returns an http.Header that can be modified by the caller to
  32684. // add HTTP headers to the request.
  32685. func (c *DisksDeleteCall) Header() http.Header {
  32686. if c.header_ == nil {
  32687. c.header_ = make(http.Header)
  32688. }
  32689. return c.header_
  32690. }
  32691. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  32692. reqHeaders := make(http.Header)
  32693. for k, v := range c.header_ {
  32694. reqHeaders[k] = v
  32695. }
  32696. reqHeaders.Set("User-Agent", c.s.userAgent())
  32697. var body io.Reader = nil
  32698. c.urlParams_.Set("alt", alt)
  32699. c.urlParams_.Set("prettyPrint", "false")
  32700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  32701. urls += "?" + c.urlParams_.Encode()
  32702. req, err := http.NewRequest("DELETE", urls, body)
  32703. if err != nil {
  32704. return nil, err
  32705. }
  32706. req.Header = reqHeaders
  32707. googleapi.Expand(req.URL, map[string]string{
  32708. "project": c.project,
  32709. "zone": c.zone,
  32710. "disk": c.disk,
  32711. })
  32712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32713. }
  32714. // Do executes the "compute.disks.delete" call.
  32715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32716. // status code is an error. Response headers are in either
  32717. // *Operation.ServerResponse.Header or (if a response was returned at
  32718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32719. // to check whether the returned error was because
  32720. // http.StatusNotModified was returned.
  32721. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32722. gensupport.SetOptions(c.urlParams_, opts...)
  32723. res, err := c.doRequest("json")
  32724. if res != nil && res.StatusCode == http.StatusNotModified {
  32725. if res.Body != nil {
  32726. res.Body.Close()
  32727. }
  32728. return nil, &googleapi.Error{
  32729. Code: res.StatusCode,
  32730. Header: res.Header,
  32731. }
  32732. }
  32733. if err != nil {
  32734. return nil, err
  32735. }
  32736. defer googleapi.CloseBody(res)
  32737. if err := googleapi.CheckResponse(res); err != nil {
  32738. return nil, err
  32739. }
  32740. ret := &Operation{
  32741. ServerResponse: googleapi.ServerResponse{
  32742. Header: res.Header,
  32743. HTTPStatusCode: res.StatusCode,
  32744. },
  32745. }
  32746. target := &ret
  32747. if err := gensupport.DecodeResponse(target, res); err != nil {
  32748. return nil, err
  32749. }
  32750. return ret, nil
  32751. // {
  32752. // "description": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
  32753. // "httpMethod": "DELETE",
  32754. // "id": "compute.disks.delete",
  32755. // "parameterOrder": [
  32756. // "project",
  32757. // "zone",
  32758. // "disk"
  32759. // ],
  32760. // "parameters": {
  32761. // "disk": {
  32762. // "description": "Name of the persistent disk to delete.",
  32763. // "location": "path",
  32764. // "required": true,
  32765. // "type": "string"
  32766. // },
  32767. // "project": {
  32768. // "description": "Project ID for this request.",
  32769. // "location": "path",
  32770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32771. // "required": true,
  32772. // "type": "string"
  32773. // },
  32774. // "requestId": {
  32775. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32776. // "location": "query",
  32777. // "type": "string"
  32778. // },
  32779. // "zone": {
  32780. // "description": "The name of the zone for this request.",
  32781. // "location": "path",
  32782. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32783. // "required": true,
  32784. // "type": "string"
  32785. // }
  32786. // },
  32787. // "path": "{project}/zones/{zone}/disks/{disk}",
  32788. // "response": {
  32789. // "$ref": "Operation"
  32790. // },
  32791. // "scopes": [
  32792. // "https://www.googleapis.com/auth/cloud-platform",
  32793. // "https://www.googleapis.com/auth/compute"
  32794. // ]
  32795. // }
  32796. }
  32797. // method id "compute.disks.get":
  32798. type DisksGetCall struct {
  32799. s *Service
  32800. project string
  32801. zone string
  32802. disk string
  32803. urlParams_ gensupport.URLParams
  32804. ifNoneMatch_ string
  32805. ctx_ context.Context
  32806. header_ http.Header
  32807. }
  32808. // Get: Returns a specified persistent disk. Gets a list of available
  32809. // persistent disks by making a list() request.
  32810. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  32811. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  32812. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32813. c.project = project
  32814. c.zone = zone
  32815. c.disk = disk
  32816. return c
  32817. }
  32818. // Fields allows partial responses to be retrieved. See
  32819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32820. // for more information.
  32821. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  32822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32823. return c
  32824. }
  32825. // IfNoneMatch sets the optional parameter which makes the operation
  32826. // fail if the object's ETag matches the given value. This is useful for
  32827. // getting updates only after the object has changed since the last
  32828. // request. Use googleapi.IsNotModified to check whether the response
  32829. // error from Do is the result of In-None-Match.
  32830. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  32831. c.ifNoneMatch_ = entityTag
  32832. return c
  32833. }
  32834. // Context sets the context to be used in this call's Do method. Any
  32835. // pending HTTP request will be aborted if the provided context is
  32836. // canceled.
  32837. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  32838. c.ctx_ = ctx
  32839. return c
  32840. }
  32841. // Header returns an http.Header that can be modified by the caller to
  32842. // add HTTP headers to the request.
  32843. func (c *DisksGetCall) Header() http.Header {
  32844. if c.header_ == nil {
  32845. c.header_ = make(http.Header)
  32846. }
  32847. return c.header_
  32848. }
  32849. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  32850. reqHeaders := make(http.Header)
  32851. for k, v := range c.header_ {
  32852. reqHeaders[k] = v
  32853. }
  32854. reqHeaders.Set("User-Agent", c.s.userAgent())
  32855. if c.ifNoneMatch_ != "" {
  32856. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32857. }
  32858. var body io.Reader = nil
  32859. c.urlParams_.Set("alt", alt)
  32860. c.urlParams_.Set("prettyPrint", "false")
  32861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  32862. urls += "?" + c.urlParams_.Encode()
  32863. req, err := http.NewRequest("GET", urls, body)
  32864. if err != nil {
  32865. return nil, err
  32866. }
  32867. req.Header = reqHeaders
  32868. googleapi.Expand(req.URL, map[string]string{
  32869. "project": c.project,
  32870. "zone": c.zone,
  32871. "disk": c.disk,
  32872. })
  32873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32874. }
  32875. // Do executes the "compute.disks.get" call.
  32876. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  32877. // code is an error. Response headers are in either
  32878. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  32879. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  32880. // whether the returned error was because http.StatusNotModified was
  32881. // returned.
  32882. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  32883. gensupport.SetOptions(c.urlParams_, opts...)
  32884. res, err := c.doRequest("json")
  32885. if res != nil && res.StatusCode == http.StatusNotModified {
  32886. if res.Body != nil {
  32887. res.Body.Close()
  32888. }
  32889. return nil, &googleapi.Error{
  32890. Code: res.StatusCode,
  32891. Header: res.Header,
  32892. }
  32893. }
  32894. if err != nil {
  32895. return nil, err
  32896. }
  32897. defer googleapi.CloseBody(res)
  32898. if err := googleapi.CheckResponse(res); err != nil {
  32899. return nil, err
  32900. }
  32901. ret := &Disk{
  32902. ServerResponse: googleapi.ServerResponse{
  32903. Header: res.Header,
  32904. HTTPStatusCode: res.StatusCode,
  32905. },
  32906. }
  32907. target := &ret
  32908. if err := gensupport.DecodeResponse(target, res); err != nil {
  32909. return nil, err
  32910. }
  32911. return ret, nil
  32912. // {
  32913. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  32914. // "httpMethod": "GET",
  32915. // "id": "compute.disks.get",
  32916. // "parameterOrder": [
  32917. // "project",
  32918. // "zone",
  32919. // "disk"
  32920. // ],
  32921. // "parameters": {
  32922. // "disk": {
  32923. // "description": "Name of the persistent disk to return.",
  32924. // "location": "path",
  32925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32926. // "required": true,
  32927. // "type": "string"
  32928. // },
  32929. // "project": {
  32930. // "description": "Project ID for this request.",
  32931. // "location": "path",
  32932. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32933. // "required": true,
  32934. // "type": "string"
  32935. // },
  32936. // "zone": {
  32937. // "description": "The name of the zone for this request.",
  32938. // "location": "path",
  32939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32940. // "required": true,
  32941. // "type": "string"
  32942. // }
  32943. // },
  32944. // "path": "{project}/zones/{zone}/disks/{disk}",
  32945. // "response": {
  32946. // "$ref": "Disk"
  32947. // },
  32948. // "scopes": [
  32949. // "https://www.googleapis.com/auth/cloud-platform",
  32950. // "https://www.googleapis.com/auth/compute",
  32951. // "https://www.googleapis.com/auth/compute.readonly"
  32952. // ]
  32953. // }
  32954. }
  32955. // method id "compute.disks.getIamPolicy":
  32956. type DisksGetIamPolicyCall struct {
  32957. s *Service
  32958. project string
  32959. zone string
  32960. resource string
  32961. urlParams_ gensupport.URLParams
  32962. ifNoneMatch_ string
  32963. ctx_ context.Context
  32964. header_ http.Header
  32965. }
  32966. // GetIamPolicy: Gets the access control policy for a resource. May be
  32967. // empty if no such policy or resource exists.
  32968. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  32969. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32970. c.project = project
  32971. c.zone = zone
  32972. c.resource = resource
  32973. return c
  32974. }
  32975. // Fields allows partial responses to be retrieved. See
  32976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32977. // for more information.
  32978. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  32979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32980. return c
  32981. }
  32982. // IfNoneMatch sets the optional parameter which makes the operation
  32983. // fail if the object's ETag matches the given value. This is useful for
  32984. // getting updates only after the object has changed since the last
  32985. // request. Use googleapi.IsNotModified to check whether the response
  32986. // error from Do is the result of In-None-Match.
  32987. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  32988. c.ifNoneMatch_ = entityTag
  32989. return c
  32990. }
  32991. // Context sets the context to be used in this call's Do method. Any
  32992. // pending HTTP request will be aborted if the provided context is
  32993. // canceled.
  32994. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  32995. c.ctx_ = ctx
  32996. return c
  32997. }
  32998. // Header returns an http.Header that can be modified by the caller to
  32999. // add HTTP headers to the request.
  33000. func (c *DisksGetIamPolicyCall) Header() http.Header {
  33001. if c.header_ == nil {
  33002. c.header_ = make(http.Header)
  33003. }
  33004. return c.header_
  33005. }
  33006. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  33007. reqHeaders := make(http.Header)
  33008. for k, v := range c.header_ {
  33009. reqHeaders[k] = v
  33010. }
  33011. reqHeaders.Set("User-Agent", c.s.userAgent())
  33012. if c.ifNoneMatch_ != "" {
  33013. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33014. }
  33015. var body io.Reader = nil
  33016. c.urlParams_.Set("alt", alt)
  33017. c.urlParams_.Set("prettyPrint", "false")
  33018. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  33019. urls += "?" + c.urlParams_.Encode()
  33020. req, err := http.NewRequest("GET", urls, body)
  33021. if err != nil {
  33022. return nil, err
  33023. }
  33024. req.Header = reqHeaders
  33025. googleapi.Expand(req.URL, map[string]string{
  33026. "project": c.project,
  33027. "zone": c.zone,
  33028. "resource": c.resource,
  33029. })
  33030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33031. }
  33032. // Do executes the "compute.disks.getIamPolicy" call.
  33033. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  33034. // code is an error. Response headers are in either
  33035. // *Policy.ServerResponse.Header or (if a response was returned at all)
  33036. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33037. // check whether the returned error was because http.StatusNotModified
  33038. // was returned.
  33039. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  33040. gensupport.SetOptions(c.urlParams_, opts...)
  33041. res, err := c.doRequest("json")
  33042. if res != nil && res.StatusCode == http.StatusNotModified {
  33043. if res.Body != nil {
  33044. res.Body.Close()
  33045. }
  33046. return nil, &googleapi.Error{
  33047. Code: res.StatusCode,
  33048. Header: res.Header,
  33049. }
  33050. }
  33051. if err != nil {
  33052. return nil, err
  33053. }
  33054. defer googleapi.CloseBody(res)
  33055. if err := googleapi.CheckResponse(res); err != nil {
  33056. return nil, err
  33057. }
  33058. ret := &Policy{
  33059. ServerResponse: googleapi.ServerResponse{
  33060. Header: res.Header,
  33061. HTTPStatusCode: res.StatusCode,
  33062. },
  33063. }
  33064. target := &ret
  33065. if err := gensupport.DecodeResponse(target, res); err != nil {
  33066. return nil, err
  33067. }
  33068. return ret, nil
  33069. // {
  33070. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  33071. // "httpMethod": "GET",
  33072. // "id": "compute.disks.getIamPolicy",
  33073. // "parameterOrder": [
  33074. // "project",
  33075. // "zone",
  33076. // "resource"
  33077. // ],
  33078. // "parameters": {
  33079. // "project": {
  33080. // "description": "Project ID for this request.",
  33081. // "location": "path",
  33082. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33083. // "required": true,
  33084. // "type": "string"
  33085. // },
  33086. // "resource": {
  33087. // "description": "Name or id of the resource for this request.",
  33088. // "location": "path",
  33089. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33090. // "required": true,
  33091. // "type": "string"
  33092. // },
  33093. // "zone": {
  33094. // "description": "The name of the zone for this request.",
  33095. // "location": "path",
  33096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33097. // "required": true,
  33098. // "type": "string"
  33099. // }
  33100. // },
  33101. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  33102. // "response": {
  33103. // "$ref": "Policy"
  33104. // },
  33105. // "scopes": [
  33106. // "https://www.googleapis.com/auth/cloud-platform",
  33107. // "https://www.googleapis.com/auth/compute",
  33108. // "https://www.googleapis.com/auth/compute.readonly"
  33109. // ]
  33110. // }
  33111. }
  33112. // method id "compute.disks.insert":
  33113. type DisksInsertCall struct {
  33114. s *Service
  33115. project string
  33116. zone string
  33117. disk *Disk
  33118. urlParams_ gensupport.URLParams
  33119. ctx_ context.Context
  33120. header_ http.Header
  33121. }
  33122. // Insert: Creates a persistent disk in the specified project using the
  33123. // data in the request. You can create a disk with a sourceImage, a
  33124. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  33125. // properties. You can also create a disk that is larger than the
  33126. // default size by specifying the sizeGb property.
  33127. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  33128. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  33129. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33130. c.project = project
  33131. c.zone = zone
  33132. c.disk = disk
  33133. return c
  33134. }
  33135. // RequestId sets the optional parameter "requestId": An optional
  33136. // request ID to identify requests. Specify a unique request ID so that
  33137. // if you must retry your request, the server will know to ignore the
  33138. // request if it has already been completed.
  33139. //
  33140. // For example, consider a situation where you make an initial request
  33141. // and the request times out. If you make the request again with the
  33142. // same request ID, the server can check if original operation with the
  33143. // same request ID was received, and if so, will ignore the second
  33144. // request. This prevents clients from accidentally creating duplicate
  33145. // commitments.
  33146. //
  33147. // The request ID must be a valid UUID with the exception that zero UUID
  33148. // is not supported (00000000-0000-0000-0000-000000000000).
  33149. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  33150. c.urlParams_.Set("requestId", requestId)
  33151. return c
  33152. }
  33153. // SourceImage sets the optional parameter "sourceImage": Source image
  33154. // to restore onto a disk.
  33155. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  33156. c.urlParams_.Set("sourceImage", sourceImage)
  33157. return c
  33158. }
  33159. // Fields allows partial responses to be retrieved. See
  33160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33161. // for more information.
  33162. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  33163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33164. return c
  33165. }
  33166. // Context sets the context to be used in this call's Do method. Any
  33167. // pending HTTP request will be aborted if the provided context is
  33168. // canceled.
  33169. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  33170. c.ctx_ = ctx
  33171. return c
  33172. }
  33173. // Header returns an http.Header that can be modified by the caller to
  33174. // add HTTP headers to the request.
  33175. func (c *DisksInsertCall) Header() http.Header {
  33176. if c.header_ == nil {
  33177. c.header_ = make(http.Header)
  33178. }
  33179. return c.header_
  33180. }
  33181. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  33182. reqHeaders := make(http.Header)
  33183. for k, v := range c.header_ {
  33184. reqHeaders[k] = v
  33185. }
  33186. reqHeaders.Set("User-Agent", c.s.userAgent())
  33187. var body io.Reader = nil
  33188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  33189. if err != nil {
  33190. return nil, err
  33191. }
  33192. reqHeaders.Set("Content-Type", "application/json")
  33193. c.urlParams_.Set("alt", alt)
  33194. c.urlParams_.Set("prettyPrint", "false")
  33195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  33196. urls += "?" + c.urlParams_.Encode()
  33197. req, err := http.NewRequest("POST", urls, body)
  33198. if err != nil {
  33199. return nil, err
  33200. }
  33201. req.Header = reqHeaders
  33202. googleapi.Expand(req.URL, map[string]string{
  33203. "project": c.project,
  33204. "zone": c.zone,
  33205. })
  33206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33207. }
  33208. // Do executes the "compute.disks.insert" call.
  33209. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33210. // status code is an error. Response headers are in either
  33211. // *Operation.ServerResponse.Header or (if a response was returned at
  33212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33213. // to check whether the returned error was because
  33214. // http.StatusNotModified was returned.
  33215. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33216. gensupport.SetOptions(c.urlParams_, opts...)
  33217. res, err := c.doRequest("json")
  33218. if res != nil && res.StatusCode == http.StatusNotModified {
  33219. if res.Body != nil {
  33220. res.Body.Close()
  33221. }
  33222. return nil, &googleapi.Error{
  33223. Code: res.StatusCode,
  33224. Header: res.Header,
  33225. }
  33226. }
  33227. if err != nil {
  33228. return nil, err
  33229. }
  33230. defer googleapi.CloseBody(res)
  33231. if err := googleapi.CheckResponse(res); err != nil {
  33232. return nil, err
  33233. }
  33234. ret := &Operation{
  33235. ServerResponse: googleapi.ServerResponse{
  33236. Header: res.Header,
  33237. HTTPStatusCode: res.StatusCode,
  33238. },
  33239. }
  33240. target := &ret
  33241. if err := gensupport.DecodeResponse(target, res); err != nil {
  33242. return nil, err
  33243. }
  33244. return ret, nil
  33245. // {
  33246. // "description": "Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.",
  33247. // "httpMethod": "POST",
  33248. // "id": "compute.disks.insert",
  33249. // "parameterOrder": [
  33250. // "project",
  33251. // "zone"
  33252. // ],
  33253. // "parameters": {
  33254. // "project": {
  33255. // "description": "Project ID for this request.",
  33256. // "location": "path",
  33257. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33258. // "required": true,
  33259. // "type": "string"
  33260. // },
  33261. // "requestId": {
  33262. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33263. // "location": "query",
  33264. // "type": "string"
  33265. // },
  33266. // "sourceImage": {
  33267. // "description": "Optional. Source image to restore onto a disk.",
  33268. // "location": "query",
  33269. // "type": "string"
  33270. // },
  33271. // "zone": {
  33272. // "description": "The name of the zone for this request.",
  33273. // "location": "path",
  33274. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33275. // "required": true,
  33276. // "type": "string"
  33277. // }
  33278. // },
  33279. // "path": "{project}/zones/{zone}/disks",
  33280. // "request": {
  33281. // "$ref": "Disk"
  33282. // },
  33283. // "response": {
  33284. // "$ref": "Operation"
  33285. // },
  33286. // "scopes": [
  33287. // "https://www.googleapis.com/auth/cloud-platform",
  33288. // "https://www.googleapis.com/auth/compute"
  33289. // ]
  33290. // }
  33291. }
  33292. // method id "compute.disks.list":
  33293. type DisksListCall struct {
  33294. s *Service
  33295. project string
  33296. zone string
  33297. urlParams_ gensupport.URLParams
  33298. ifNoneMatch_ string
  33299. ctx_ context.Context
  33300. header_ http.Header
  33301. }
  33302. // List: Retrieves a list of persistent disks contained within the
  33303. // specified zone.
  33304. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  33305. func (r *DisksService) List(project string, zone string) *DisksListCall {
  33306. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33307. c.project = project
  33308. c.zone = zone
  33309. return c
  33310. }
  33311. // Filter sets the optional parameter "filter": A filter expression that
  33312. // filters resources listed in the response. The expression must specify
  33313. // the field name, a comparison operator, and the value that you want to
  33314. // use for filtering. The value must be a string, a number, or a
  33315. // boolean. The comparison operator must be either =, !=, >, or <.
  33316. //
  33317. // For example, if you are filtering Compute Engine instances, you can
  33318. // exclude instances named example-instance by specifying name !=
  33319. // example-instance.
  33320. //
  33321. // You can also filter nested fields. For example, you could specify
  33322. // scheduling.automaticRestart = false to include instances only if they
  33323. // are not scheduled for automatic restarts. You can use filtering on
  33324. // nested fields to filter based on resource labels.
  33325. //
  33326. // To filter on multiple expressions, provide each separate expression
  33327. // within parentheses. For example, (scheduling.automaticRestart = true)
  33328. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33329. // AND expression. However, you can include AND and OR expressions
  33330. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33331. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33332. // true).
  33333. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  33334. c.urlParams_.Set("filter", filter)
  33335. return c
  33336. }
  33337. // MaxResults sets the optional parameter "maxResults": The maximum
  33338. // number of results per page that should be returned. If the number of
  33339. // available results is larger than maxResults, Compute Engine returns a
  33340. // nextPageToken that can be used to get the next page of results in
  33341. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33342. // (Default: 500)
  33343. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  33344. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33345. return c
  33346. }
  33347. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33348. // a certain order. By default, results are returned in alphanumerical
  33349. // order based on the resource name.
  33350. //
  33351. // You can also sort results in descending order based on the creation
  33352. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33353. // based on the creationTimestamp field in reverse chronological order
  33354. // (newest result first). Use this to sort resources like operations so
  33355. // that the newest operation is returned first.
  33356. //
  33357. // Currently, only sorting by name or creationTimestamp desc is
  33358. // supported.
  33359. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  33360. c.urlParams_.Set("orderBy", orderBy)
  33361. return c
  33362. }
  33363. // PageToken sets the optional parameter "pageToken": Specifies a page
  33364. // token to use. Set pageToken to the nextPageToken returned by a
  33365. // previous list request to get the next page of results.
  33366. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  33367. c.urlParams_.Set("pageToken", pageToken)
  33368. return c
  33369. }
  33370. // Fields allows partial responses to be retrieved. See
  33371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33372. // for more information.
  33373. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  33374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33375. return c
  33376. }
  33377. // IfNoneMatch sets the optional parameter which makes the operation
  33378. // fail if the object's ETag matches the given value. This is useful for
  33379. // getting updates only after the object has changed since the last
  33380. // request. Use googleapi.IsNotModified to check whether the response
  33381. // error from Do is the result of In-None-Match.
  33382. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  33383. c.ifNoneMatch_ = entityTag
  33384. return c
  33385. }
  33386. // Context sets the context to be used in this call's Do method. Any
  33387. // pending HTTP request will be aborted if the provided context is
  33388. // canceled.
  33389. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  33390. c.ctx_ = ctx
  33391. return c
  33392. }
  33393. // Header returns an http.Header that can be modified by the caller to
  33394. // add HTTP headers to the request.
  33395. func (c *DisksListCall) Header() http.Header {
  33396. if c.header_ == nil {
  33397. c.header_ = make(http.Header)
  33398. }
  33399. return c.header_
  33400. }
  33401. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  33402. reqHeaders := make(http.Header)
  33403. for k, v := range c.header_ {
  33404. reqHeaders[k] = v
  33405. }
  33406. reqHeaders.Set("User-Agent", c.s.userAgent())
  33407. if c.ifNoneMatch_ != "" {
  33408. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33409. }
  33410. var body io.Reader = nil
  33411. c.urlParams_.Set("alt", alt)
  33412. c.urlParams_.Set("prettyPrint", "false")
  33413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  33414. urls += "?" + c.urlParams_.Encode()
  33415. req, err := http.NewRequest("GET", urls, body)
  33416. if err != nil {
  33417. return nil, err
  33418. }
  33419. req.Header = reqHeaders
  33420. googleapi.Expand(req.URL, map[string]string{
  33421. "project": c.project,
  33422. "zone": c.zone,
  33423. })
  33424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33425. }
  33426. // Do executes the "compute.disks.list" call.
  33427. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  33428. // code is an error. Response headers are in either
  33429. // *DiskList.ServerResponse.Header or (if a response was returned at
  33430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33431. // to check whether the returned error was because
  33432. // http.StatusNotModified was returned.
  33433. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  33434. gensupport.SetOptions(c.urlParams_, opts...)
  33435. res, err := c.doRequest("json")
  33436. if res != nil && res.StatusCode == http.StatusNotModified {
  33437. if res.Body != nil {
  33438. res.Body.Close()
  33439. }
  33440. return nil, &googleapi.Error{
  33441. Code: res.StatusCode,
  33442. Header: res.Header,
  33443. }
  33444. }
  33445. if err != nil {
  33446. return nil, err
  33447. }
  33448. defer googleapi.CloseBody(res)
  33449. if err := googleapi.CheckResponse(res); err != nil {
  33450. return nil, err
  33451. }
  33452. ret := &DiskList{
  33453. ServerResponse: googleapi.ServerResponse{
  33454. Header: res.Header,
  33455. HTTPStatusCode: res.StatusCode,
  33456. },
  33457. }
  33458. target := &ret
  33459. if err := gensupport.DecodeResponse(target, res); err != nil {
  33460. return nil, err
  33461. }
  33462. return ret, nil
  33463. // {
  33464. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  33465. // "httpMethod": "GET",
  33466. // "id": "compute.disks.list",
  33467. // "parameterOrder": [
  33468. // "project",
  33469. // "zone"
  33470. // ],
  33471. // "parameters": {
  33472. // "filter": {
  33473. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  33474. // "location": "query",
  33475. // "type": "string"
  33476. // },
  33477. // "maxResults": {
  33478. // "default": "500",
  33479. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  33480. // "format": "uint32",
  33481. // "location": "query",
  33482. // "minimum": "0",
  33483. // "type": "integer"
  33484. // },
  33485. // "orderBy": {
  33486. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  33487. // "location": "query",
  33488. // "type": "string"
  33489. // },
  33490. // "pageToken": {
  33491. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  33492. // "location": "query",
  33493. // "type": "string"
  33494. // },
  33495. // "project": {
  33496. // "description": "Project ID for this request.",
  33497. // "location": "path",
  33498. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33499. // "required": true,
  33500. // "type": "string"
  33501. // },
  33502. // "zone": {
  33503. // "description": "The name of the zone for this request.",
  33504. // "location": "path",
  33505. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33506. // "required": true,
  33507. // "type": "string"
  33508. // }
  33509. // },
  33510. // "path": "{project}/zones/{zone}/disks",
  33511. // "response": {
  33512. // "$ref": "DiskList"
  33513. // },
  33514. // "scopes": [
  33515. // "https://www.googleapis.com/auth/cloud-platform",
  33516. // "https://www.googleapis.com/auth/compute",
  33517. // "https://www.googleapis.com/auth/compute.readonly"
  33518. // ]
  33519. // }
  33520. }
  33521. // Pages invokes f for each page of results.
  33522. // A non-nil error returned from f will halt the iteration.
  33523. // The provided context supersedes any context provided to the Context method.
  33524. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  33525. c.ctx_ = ctx
  33526. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33527. for {
  33528. x, err := c.Do()
  33529. if err != nil {
  33530. return err
  33531. }
  33532. if err := f(x); err != nil {
  33533. return err
  33534. }
  33535. if x.NextPageToken == "" {
  33536. return nil
  33537. }
  33538. c.PageToken(x.NextPageToken)
  33539. }
  33540. }
  33541. // method id "compute.disks.resize":
  33542. type DisksResizeCall struct {
  33543. s *Service
  33544. project string
  33545. zone string
  33546. disk string
  33547. disksresizerequest *DisksResizeRequest
  33548. urlParams_ gensupport.URLParams
  33549. ctx_ context.Context
  33550. header_ http.Header
  33551. }
  33552. // Resize: Resizes the specified persistent disk. You can only increase
  33553. // the size of the disk.
  33554. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  33555. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33556. c.project = project
  33557. c.zone = zone
  33558. c.disk = disk
  33559. c.disksresizerequest = disksresizerequest
  33560. return c
  33561. }
  33562. // RequestId sets the optional parameter "requestId": An optional
  33563. // request ID to identify requests. Specify a unique request ID so that
  33564. // if you must retry your request, the server will know to ignore the
  33565. // request if it has already been completed.
  33566. //
  33567. // For example, consider a situation where you make an initial request
  33568. // and the request times out. If you make the request again with the
  33569. // same request ID, the server can check if original operation with the
  33570. // same request ID was received, and if so, will ignore the second
  33571. // request. This prevents clients from accidentally creating duplicate
  33572. // commitments.
  33573. //
  33574. // The request ID must be a valid UUID with the exception that zero UUID
  33575. // is not supported (00000000-0000-0000-0000-000000000000).
  33576. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  33577. c.urlParams_.Set("requestId", requestId)
  33578. return c
  33579. }
  33580. // Fields allows partial responses to be retrieved. See
  33581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33582. // for more information.
  33583. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  33584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33585. return c
  33586. }
  33587. // Context sets the context to be used in this call's Do method. Any
  33588. // pending HTTP request will be aborted if the provided context is
  33589. // canceled.
  33590. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  33591. c.ctx_ = ctx
  33592. return c
  33593. }
  33594. // Header returns an http.Header that can be modified by the caller to
  33595. // add HTTP headers to the request.
  33596. func (c *DisksResizeCall) Header() http.Header {
  33597. if c.header_ == nil {
  33598. c.header_ = make(http.Header)
  33599. }
  33600. return c.header_
  33601. }
  33602. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  33603. reqHeaders := make(http.Header)
  33604. for k, v := range c.header_ {
  33605. reqHeaders[k] = v
  33606. }
  33607. reqHeaders.Set("User-Agent", c.s.userAgent())
  33608. var body io.Reader = nil
  33609. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  33610. if err != nil {
  33611. return nil, err
  33612. }
  33613. reqHeaders.Set("Content-Type", "application/json")
  33614. c.urlParams_.Set("alt", alt)
  33615. c.urlParams_.Set("prettyPrint", "false")
  33616. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  33617. urls += "?" + c.urlParams_.Encode()
  33618. req, err := http.NewRequest("POST", urls, body)
  33619. if err != nil {
  33620. return nil, err
  33621. }
  33622. req.Header = reqHeaders
  33623. googleapi.Expand(req.URL, map[string]string{
  33624. "project": c.project,
  33625. "zone": c.zone,
  33626. "disk": c.disk,
  33627. })
  33628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33629. }
  33630. // Do executes the "compute.disks.resize" call.
  33631. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33632. // status code is an error. Response headers are in either
  33633. // *Operation.ServerResponse.Header or (if a response was returned at
  33634. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33635. // to check whether the returned error was because
  33636. // http.StatusNotModified was returned.
  33637. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33638. gensupport.SetOptions(c.urlParams_, opts...)
  33639. res, err := c.doRequest("json")
  33640. if res != nil && res.StatusCode == http.StatusNotModified {
  33641. if res.Body != nil {
  33642. res.Body.Close()
  33643. }
  33644. return nil, &googleapi.Error{
  33645. Code: res.StatusCode,
  33646. Header: res.Header,
  33647. }
  33648. }
  33649. if err != nil {
  33650. return nil, err
  33651. }
  33652. defer googleapi.CloseBody(res)
  33653. if err := googleapi.CheckResponse(res); err != nil {
  33654. return nil, err
  33655. }
  33656. ret := &Operation{
  33657. ServerResponse: googleapi.ServerResponse{
  33658. Header: res.Header,
  33659. HTTPStatusCode: res.StatusCode,
  33660. },
  33661. }
  33662. target := &ret
  33663. if err := gensupport.DecodeResponse(target, res); err != nil {
  33664. return nil, err
  33665. }
  33666. return ret, nil
  33667. // {
  33668. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  33669. // "httpMethod": "POST",
  33670. // "id": "compute.disks.resize",
  33671. // "parameterOrder": [
  33672. // "project",
  33673. // "zone",
  33674. // "disk"
  33675. // ],
  33676. // "parameters": {
  33677. // "disk": {
  33678. // "description": "The name of the persistent disk.",
  33679. // "location": "path",
  33680. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33681. // "required": true,
  33682. // "type": "string"
  33683. // },
  33684. // "project": {
  33685. // "description": "Project ID for this request.",
  33686. // "location": "path",
  33687. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33688. // "required": true,
  33689. // "type": "string"
  33690. // },
  33691. // "requestId": {
  33692. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33693. // "location": "query",
  33694. // "type": "string"
  33695. // },
  33696. // "zone": {
  33697. // "description": "The name of the zone for this request.",
  33698. // "location": "path",
  33699. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33700. // "required": true,
  33701. // "type": "string"
  33702. // }
  33703. // },
  33704. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  33705. // "request": {
  33706. // "$ref": "DisksResizeRequest"
  33707. // },
  33708. // "response": {
  33709. // "$ref": "Operation"
  33710. // },
  33711. // "scopes": [
  33712. // "https://www.googleapis.com/auth/cloud-platform",
  33713. // "https://www.googleapis.com/auth/compute"
  33714. // ]
  33715. // }
  33716. }
  33717. // method id "compute.disks.setIamPolicy":
  33718. type DisksSetIamPolicyCall struct {
  33719. s *Service
  33720. project string
  33721. zone string
  33722. resource string
  33723. zonesetpolicyrequest *ZoneSetPolicyRequest
  33724. urlParams_ gensupport.URLParams
  33725. ctx_ context.Context
  33726. header_ http.Header
  33727. }
  33728. // SetIamPolicy: Sets the access control policy on the specified
  33729. // resource. Replaces any existing policy.
  33730. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  33731. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33732. c.project = project
  33733. c.zone = zone
  33734. c.resource = resource
  33735. c.zonesetpolicyrequest = zonesetpolicyrequest
  33736. return c
  33737. }
  33738. // Fields allows partial responses to be retrieved. See
  33739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33740. // for more information.
  33741. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  33742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33743. return c
  33744. }
  33745. // Context sets the context to be used in this call's Do method. Any
  33746. // pending HTTP request will be aborted if the provided context is
  33747. // canceled.
  33748. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  33749. c.ctx_ = ctx
  33750. return c
  33751. }
  33752. // Header returns an http.Header that can be modified by the caller to
  33753. // add HTTP headers to the request.
  33754. func (c *DisksSetIamPolicyCall) Header() http.Header {
  33755. if c.header_ == nil {
  33756. c.header_ = make(http.Header)
  33757. }
  33758. return c.header_
  33759. }
  33760. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  33761. reqHeaders := make(http.Header)
  33762. for k, v := range c.header_ {
  33763. reqHeaders[k] = v
  33764. }
  33765. reqHeaders.Set("User-Agent", c.s.userAgent())
  33766. var body io.Reader = nil
  33767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  33768. if err != nil {
  33769. return nil, err
  33770. }
  33771. reqHeaders.Set("Content-Type", "application/json")
  33772. c.urlParams_.Set("alt", alt)
  33773. c.urlParams_.Set("prettyPrint", "false")
  33774. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  33775. urls += "?" + c.urlParams_.Encode()
  33776. req, err := http.NewRequest("POST", urls, body)
  33777. if err != nil {
  33778. return nil, err
  33779. }
  33780. req.Header = reqHeaders
  33781. googleapi.Expand(req.URL, map[string]string{
  33782. "project": c.project,
  33783. "zone": c.zone,
  33784. "resource": c.resource,
  33785. })
  33786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33787. }
  33788. // Do executes the "compute.disks.setIamPolicy" call.
  33789. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  33790. // code is an error. Response headers are in either
  33791. // *Policy.ServerResponse.Header or (if a response was returned at all)
  33792. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33793. // check whether the returned error was because http.StatusNotModified
  33794. // was returned.
  33795. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  33796. gensupport.SetOptions(c.urlParams_, opts...)
  33797. res, err := c.doRequest("json")
  33798. if res != nil && res.StatusCode == http.StatusNotModified {
  33799. if res.Body != nil {
  33800. res.Body.Close()
  33801. }
  33802. return nil, &googleapi.Error{
  33803. Code: res.StatusCode,
  33804. Header: res.Header,
  33805. }
  33806. }
  33807. if err != nil {
  33808. return nil, err
  33809. }
  33810. defer googleapi.CloseBody(res)
  33811. if err := googleapi.CheckResponse(res); err != nil {
  33812. return nil, err
  33813. }
  33814. ret := &Policy{
  33815. ServerResponse: googleapi.ServerResponse{
  33816. Header: res.Header,
  33817. HTTPStatusCode: res.StatusCode,
  33818. },
  33819. }
  33820. target := &ret
  33821. if err := gensupport.DecodeResponse(target, res); err != nil {
  33822. return nil, err
  33823. }
  33824. return ret, nil
  33825. // {
  33826. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  33827. // "httpMethod": "POST",
  33828. // "id": "compute.disks.setIamPolicy",
  33829. // "parameterOrder": [
  33830. // "project",
  33831. // "zone",
  33832. // "resource"
  33833. // ],
  33834. // "parameters": {
  33835. // "project": {
  33836. // "description": "Project ID for this request.",
  33837. // "location": "path",
  33838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33839. // "required": true,
  33840. // "type": "string"
  33841. // },
  33842. // "resource": {
  33843. // "description": "Name or id of the resource for this request.",
  33844. // "location": "path",
  33845. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33846. // "required": true,
  33847. // "type": "string"
  33848. // },
  33849. // "zone": {
  33850. // "description": "The name of the zone for this request.",
  33851. // "location": "path",
  33852. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33853. // "required": true,
  33854. // "type": "string"
  33855. // }
  33856. // },
  33857. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  33858. // "request": {
  33859. // "$ref": "ZoneSetPolicyRequest"
  33860. // },
  33861. // "response": {
  33862. // "$ref": "Policy"
  33863. // },
  33864. // "scopes": [
  33865. // "https://www.googleapis.com/auth/cloud-platform",
  33866. // "https://www.googleapis.com/auth/compute"
  33867. // ]
  33868. // }
  33869. }
  33870. // method id "compute.disks.setLabels":
  33871. type DisksSetLabelsCall struct {
  33872. s *Service
  33873. project string
  33874. zone string
  33875. resource string
  33876. zonesetlabelsrequest *ZoneSetLabelsRequest
  33877. urlParams_ gensupport.URLParams
  33878. ctx_ context.Context
  33879. header_ http.Header
  33880. }
  33881. // SetLabels: Sets the labels on a disk. To learn more about labels,
  33882. // read the Labeling Resources documentation.
  33883. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  33884. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33885. c.project = project
  33886. c.zone = zone
  33887. c.resource = resource
  33888. c.zonesetlabelsrequest = zonesetlabelsrequest
  33889. return c
  33890. }
  33891. // RequestId sets the optional parameter "requestId": An optional
  33892. // request ID to identify requests. Specify a unique request ID so that
  33893. // if you must retry your request, the server will know to ignore the
  33894. // request if it has already been completed.
  33895. //
  33896. // For example, consider a situation where you make an initial request
  33897. // and the request times out. If you make the request again with the
  33898. // same request ID, the server can check if original operation with the
  33899. // same request ID was received, and if so, will ignore the second
  33900. // request. This prevents clients from accidentally creating duplicate
  33901. // commitments.
  33902. //
  33903. // The request ID must be a valid UUID with the exception that zero UUID
  33904. // is not supported (00000000-0000-0000-0000-000000000000).
  33905. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  33906. c.urlParams_.Set("requestId", requestId)
  33907. return c
  33908. }
  33909. // Fields allows partial responses to be retrieved. See
  33910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33911. // for more information.
  33912. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  33913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33914. return c
  33915. }
  33916. // Context sets the context to be used in this call's Do method. Any
  33917. // pending HTTP request will be aborted if the provided context is
  33918. // canceled.
  33919. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  33920. c.ctx_ = ctx
  33921. return c
  33922. }
  33923. // Header returns an http.Header that can be modified by the caller to
  33924. // add HTTP headers to the request.
  33925. func (c *DisksSetLabelsCall) Header() http.Header {
  33926. if c.header_ == nil {
  33927. c.header_ = make(http.Header)
  33928. }
  33929. return c.header_
  33930. }
  33931. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  33932. reqHeaders := make(http.Header)
  33933. for k, v := range c.header_ {
  33934. reqHeaders[k] = v
  33935. }
  33936. reqHeaders.Set("User-Agent", c.s.userAgent())
  33937. var body io.Reader = nil
  33938. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  33939. if err != nil {
  33940. return nil, err
  33941. }
  33942. reqHeaders.Set("Content-Type", "application/json")
  33943. c.urlParams_.Set("alt", alt)
  33944. c.urlParams_.Set("prettyPrint", "false")
  33945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  33946. urls += "?" + c.urlParams_.Encode()
  33947. req, err := http.NewRequest("POST", urls, body)
  33948. if err != nil {
  33949. return nil, err
  33950. }
  33951. req.Header = reqHeaders
  33952. googleapi.Expand(req.URL, map[string]string{
  33953. "project": c.project,
  33954. "zone": c.zone,
  33955. "resource": c.resource,
  33956. })
  33957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33958. }
  33959. // Do executes the "compute.disks.setLabels" call.
  33960. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33961. // status code is an error. Response headers are in either
  33962. // *Operation.ServerResponse.Header or (if a response was returned at
  33963. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33964. // to check whether the returned error was because
  33965. // http.StatusNotModified was returned.
  33966. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33967. gensupport.SetOptions(c.urlParams_, opts...)
  33968. res, err := c.doRequest("json")
  33969. if res != nil && res.StatusCode == http.StatusNotModified {
  33970. if res.Body != nil {
  33971. res.Body.Close()
  33972. }
  33973. return nil, &googleapi.Error{
  33974. Code: res.StatusCode,
  33975. Header: res.Header,
  33976. }
  33977. }
  33978. if err != nil {
  33979. return nil, err
  33980. }
  33981. defer googleapi.CloseBody(res)
  33982. if err := googleapi.CheckResponse(res); err != nil {
  33983. return nil, err
  33984. }
  33985. ret := &Operation{
  33986. ServerResponse: googleapi.ServerResponse{
  33987. Header: res.Header,
  33988. HTTPStatusCode: res.StatusCode,
  33989. },
  33990. }
  33991. target := &ret
  33992. if err := gensupport.DecodeResponse(target, res); err != nil {
  33993. return nil, err
  33994. }
  33995. return ret, nil
  33996. // {
  33997. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  33998. // "httpMethod": "POST",
  33999. // "id": "compute.disks.setLabels",
  34000. // "parameterOrder": [
  34001. // "project",
  34002. // "zone",
  34003. // "resource"
  34004. // ],
  34005. // "parameters": {
  34006. // "project": {
  34007. // "description": "Project ID for this request.",
  34008. // "location": "path",
  34009. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34010. // "required": true,
  34011. // "type": "string"
  34012. // },
  34013. // "requestId": {
  34014. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34015. // "location": "query",
  34016. // "type": "string"
  34017. // },
  34018. // "resource": {
  34019. // "description": "Name or id of the resource for this request.",
  34020. // "location": "path",
  34021. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34022. // "required": true,
  34023. // "type": "string"
  34024. // },
  34025. // "zone": {
  34026. // "description": "The name of the zone for this request.",
  34027. // "location": "path",
  34028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34029. // "required": true,
  34030. // "type": "string"
  34031. // }
  34032. // },
  34033. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  34034. // "request": {
  34035. // "$ref": "ZoneSetLabelsRequest"
  34036. // },
  34037. // "response": {
  34038. // "$ref": "Operation"
  34039. // },
  34040. // "scopes": [
  34041. // "https://www.googleapis.com/auth/cloud-platform",
  34042. // "https://www.googleapis.com/auth/compute"
  34043. // ]
  34044. // }
  34045. }
  34046. // method id "compute.disks.testIamPermissions":
  34047. type DisksTestIamPermissionsCall struct {
  34048. s *Service
  34049. project string
  34050. zone string
  34051. resource string
  34052. testpermissionsrequest *TestPermissionsRequest
  34053. urlParams_ gensupport.URLParams
  34054. ctx_ context.Context
  34055. header_ http.Header
  34056. }
  34057. // TestIamPermissions: Returns permissions that a caller has on the
  34058. // specified resource.
  34059. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  34060. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34061. c.project = project
  34062. c.zone = zone
  34063. c.resource = resource
  34064. c.testpermissionsrequest = testpermissionsrequest
  34065. return c
  34066. }
  34067. // Fields allows partial responses to be retrieved. See
  34068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34069. // for more information.
  34070. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  34071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34072. return c
  34073. }
  34074. // Context sets the context to be used in this call's Do method. Any
  34075. // pending HTTP request will be aborted if the provided context is
  34076. // canceled.
  34077. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  34078. c.ctx_ = ctx
  34079. return c
  34080. }
  34081. // Header returns an http.Header that can be modified by the caller to
  34082. // add HTTP headers to the request.
  34083. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  34084. if c.header_ == nil {
  34085. c.header_ = make(http.Header)
  34086. }
  34087. return c.header_
  34088. }
  34089. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  34090. reqHeaders := make(http.Header)
  34091. for k, v := range c.header_ {
  34092. reqHeaders[k] = v
  34093. }
  34094. reqHeaders.Set("User-Agent", c.s.userAgent())
  34095. var body io.Reader = nil
  34096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  34097. if err != nil {
  34098. return nil, err
  34099. }
  34100. reqHeaders.Set("Content-Type", "application/json")
  34101. c.urlParams_.Set("alt", alt)
  34102. c.urlParams_.Set("prettyPrint", "false")
  34103. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  34104. urls += "?" + c.urlParams_.Encode()
  34105. req, err := http.NewRequest("POST", urls, body)
  34106. if err != nil {
  34107. return nil, err
  34108. }
  34109. req.Header = reqHeaders
  34110. googleapi.Expand(req.URL, map[string]string{
  34111. "project": c.project,
  34112. "zone": c.zone,
  34113. "resource": c.resource,
  34114. })
  34115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34116. }
  34117. // Do executes the "compute.disks.testIamPermissions" call.
  34118. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  34119. // non-2xx status code is an error. Response headers are in either
  34120. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  34121. // returned at all) in error.(*googleapi.Error).Header. Use
  34122. // googleapi.IsNotModified to check whether the returned error was
  34123. // because http.StatusNotModified was returned.
  34124. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  34125. gensupport.SetOptions(c.urlParams_, opts...)
  34126. res, err := c.doRequest("json")
  34127. if res != nil && res.StatusCode == http.StatusNotModified {
  34128. if res.Body != nil {
  34129. res.Body.Close()
  34130. }
  34131. return nil, &googleapi.Error{
  34132. Code: res.StatusCode,
  34133. Header: res.Header,
  34134. }
  34135. }
  34136. if err != nil {
  34137. return nil, err
  34138. }
  34139. defer googleapi.CloseBody(res)
  34140. if err := googleapi.CheckResponse(res); err != nil {
  34141. return nil, err
  34142. }
  34143. ret := &TestPermissionsResponse{
  34144. ServerResponse: googleapi.ServerResponse{
  34145. Header: res.Header,
  34146. HTTPStatusCode: res.StatusCode,
  34147. },
  34148. }
  34149. target := &ret
  34150. if err := gensupport.DecodeResponse(target, res); err != nil {
  34151. return nil, err
  34152. }
  34153. return ret, nil
  34154. // {
  34155. // "description": "Returns permissions that a caller has on the specified resource.",
  34156. // "httpMethod": "POST",
  34157. // "id": "compute.disks.testIamPermissions",
  34158. // "parameterOrder": [
  34159. // "project",
  34160. // "zone",
  34161. // "resource"
  34162. // ],
  34163. // "parameters": {
  34164. // "project": {
  34165. // "description": "Project ID for this request.",
  34166. // "location": "path",
  34167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34168. // "required": true,
  34169. // "type": "string"
  34170. // },
  34171. // "resource": {
  34172. // "description": "Name or id of the resource for this request.",
  34173. // "location": "path",
  34174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34175. // "required": true,
  34176. // "type": "string"
  34177. // },
  34178. // "zone": {
  34179. // "description": "The name of the zone for this request.",
  34180. // "location": "path",
  34181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34182. // "required": true,
  34183. // "type": "string"
  34184. // }
  34185. // },
  34186. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  34187. // "request": {
  34188. // "$ref": "TestPermissionsRequest"
  34189. // },
  34190. // "response": {
  34191. // "$ref": "TestPermissionsResponse"
  34192. // },
  34193. // "scopes": [
  34194. // "https://www.googleapis.com/auth/cloud-platform",
  34195. // "https://www.googleapis.com/auth/compute",
  34196. // "https://www.googleapis.com/auth/compute.readonly"
  34197. // ]
  34198. // }
  34199. }
  34200. // method id "compute.firewalls.delete":
  34201. type FirewallsDeleteCall struct {
  34202. s *Service
  34203. project string
  34204. firewall string
  34205. urlParams_ gensupport.URLParams
  34206. ctx_ context.Context
  34207. header_ http.Header
  34208. }
  34209. // Delete: Deletes the specified firewall.
  34210. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  34211. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  34212. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34213. c.project = project
  34214. c.firewall = firewall
  34215. return c
  34216. }
  34217. // RequestId sets the optional parameter "requestId": An optional
  34218. // request ID to identify requests. Specify a unique request ID so that
  34219. // if you must retry your request, the server will know to ignore the
  34220. // request if it has already been completed.
  34221. //
  34222. // For example, consider a situation where you make an initial request
  34223. // and the request times out. If you make the request again with the
  34224. // same request ID, the server can check if original operation with the
  34225. // same request ID was received, and if so, will ignore the second
  34226. // request. This prevents clients from accidentally creating duplicate
  34227. // commitments.
  34228. //
  34229. // The request ID must be a valid UUID with the exception that zero UUID
  34230. // is not supported (00000000-0000-0000-0000-000000000000).
  34231. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  34232. c.urlParams_.Set("requestId", requestId)
  34233. return c
  34234. }
  34235. // Fields allows partial responses to be retrieved. See
  34236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34237. // for more information.
  34238. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  34239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34240. return c
  34241. }
  34242. // Context sets the context to be used in this call's Do method. Any
  34243. // pending HTTP request will be aborted if the provided context is
  34244. // canceled.
  34245. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  34246. c.ctx_ = ctx
  34247. return c
  34248. }
  34249. // Header returns an http.Header that can be modified by the caller to
  34250. // add HTTP headers to the request.
  34251. func (c *FirewallsDeleteCall) Header() http.Header {
  34252. if c.header_ == nil {
  34253. c.header_ = make(http.Header)
  34254. }
  34255. return c.header_
  34256. }
  34257. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  34258. reqHeaders := make(http.Header)
  34259. for k, v := range c.header_ {
  34260. reqHeaders[k] = v
  34261. }
  34262. reqHeaders.Set("User-Agent", c.s.userAgent())
  34263. var body io.Reader = nil
  34264. c.urlParams_.Set("alt", alt)
  34265. c.urlParams_.Set("prettyPrint", "false")
  34266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  34267. urls += "?" + c.urlParams_.Encode()
  34268. req, err := http.NewRequest("DELETE", urls, body)
  34269. if err != nil {
  34270. return nil, err
  34271. }
  34272. req.Header = reqHeaders
  34273. googleapi.Expand(req.URL, map[string]string{
  34274. "project": c.project,
  34275. "firewall": c.firewall,
  34276. })
  34277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34278. }
  34279. // Do executes the "compute.firewalls.delete" call.
  34280. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34281. // status code is an error. Response headers are in either
  34282. // *Operation.ServerResponse.Header or (if a response was returned at
  34283. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34284. // to check whether the returned error was because
  34285. // http.StatusNotModified was returned.
  34286. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34287. gensupport.SetOptions(c.urlParams_, opts...)
  34288. res, err := c.doRequest("json")
  34289. if res != nil && res.StatusCode == http.StatusNotModified {
  34290. if res.Body != nil {
  34291. res.Body.Close()
  34292. }
  34293. return nil, &googleapi.Error{
  34294. Code: res.StatusCode,
  34295. Header: res.Header,
  34296. }
  34297. }
  34298. if err != nil {
  34299. return nil, err
  34300. }
  34301. defer googleapi.CloseBody(res)
  34302. if err := googleapi.CheckResponse(res); err != nil {
  34303. return nil, err
  34304. }
  34305. ret := &Operation{
  34306. ServerResponse: googleapi.ServerResponse{
  34307. Header: res.Header,
  34308. HTTPStatusCode: res.StatusCode,
  34309. },
  34310. }
  34311. target := &ret
  34312. if err := gensupport.DecodeResponse(target, res); err != nil {
  34313. return nil, err
  34314. }
  34315. return ret, nil
  34316. // {
  34317. // "description": "Deletes the specified firewall.",
  34318. // "httpMethod": "DELETE",
  34319. // "id": "compute.firewalls.delete",
  34320. // "parameterOrder": [
  34321. // "project",
  34322. // "firewall"
  34323. // ],
  34324. // "parameters": {
  34325. // "firewall": {
  34326. // "description": "Name of the firewall rule to delete.",
  34327. // "location": "path",
  34328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34329. // "required": true,
  34330. // "type": "string"
  34331. // },
  34332. // "project": {
  34333. // "description": "Project ID for this request.",
  34334. // "location": "path",
  34335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34336. // "required": true,
  34337. // "type": "string"
  34338. // },
  34339. // "requestId": {
  34340. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34341. // "location": "query",
  34342. // "type": "string"
  34343. // }
  34344. // },
  34345. // "path": "{project}/global/firewalls/{firewall}",
  34346. // "response": {
  34347. // "$ref": "Operation"
  34348. // },
  34349. // "scopes": [
  34350. // "https://www.googleapis.com/auth/cloud-platform",
  34351. // "https://www.googleapis.com/auth/compute"
  34352. // ]
  34353. // }
  34354. }
  34355. // method id "compute.firewalls.get":
  34356. type FirewallsGetCall struct {
  34357. s *Service
  34358. project string
  34359. firewall string
  34360. urlParams_ gensupport.URLParams
  34361. ifNoneMatch_ string
  34362. ctx_ context.Context
  34363. header_ http.Header
  34364. }
  34365. // Get: Returns the specified firewall.
  34366. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  34367. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  34368. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34369. c.project = project
  34370. c.firewall = firewall
  34371. return c
  34372. }
  34373. // Fields allows partial responses to be retrieved. See
  34374. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34375. // for more information.
  34376. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  34377. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34378. return c
  34379. }
  34380. // IfNoneMatch sets the optional parameter which makes the operation
  34381. // fail if the object's ETag matches the given value. This is useful for
  34382. // getting updates only after the object has changed since the last
  34383. // request. Use googleapi.IsNotModified to check whether the response
  34384. // error from Do is the result of In-None-Match.
  34385. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  34386. c.ifNoneMatch_ = entityTag
  34387. return c
  34388. }
  34389. // Context sets the context to be used in this call's Do method. Any
  34390. // pending HTTP request will be aborted if the provided context is
  34391. // canceled.
  34392. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  34393. c.ctx_ = ctx
  34394. return c
  34395. }
  34396. // Header returns an http.Header that can be modified by the caller to
  34397. // add HTTP headers to the request.
  34398. func (c *FirewallsGetCall) Header() http.Header {
  34399. if c.header_ == nil {
  34400. c.header_ = make(http.Header)
  34401. }
  34402. return c.header_
  34403. }
  34404. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  34405. reqHeaders := make(http.Header)
  34406. for k, v := range c.header_ {
  34407. reqHeaders[k] = v
  34408. }
  34409. reqHeaders.Set("User-Agent", c.s.userAgent())
  34410. if c.ifNoneMatch_ != "" {
  34411. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34412. }
  34413. var body io.Reader = nil
  34414. c.urlParams_.Set("alt", alt)
  34415. c.urlParams_.Set("prettyPrint", "false")
  34416. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  34417. urls += "?" + c.urlParams_.Encode()
  34418. req, err := http.NewRequest("GET", urls, body)
  34419. if err != nil {
  34420. return nil, err
  34421. }
  34422. req.Header = reqHeaders
  34423. googleapi.Expand(req.URL, map[string]string{
  34424. "project": c.project,
  34425. "firewall": c.firewall,
  34426. })
  34427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34428. }
  34429. // Do executes the "compute.firewalls.get" call.
  34430. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  34431. // code is an error. Response headers are in either
  34432. // *Firewall.ServerResponse.Header or (if a response was returned at
  34433. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34434. // to check whether the returned error was because
  34435. // http.StatusNotModified was returned.
  34436. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  34437. gensupport.SetOptions(c.urlParams_, opts...)
  34438. res, err := c.doRequest("json")
  34439. if res != nil && res.StatusCode == http.StatusNotModified {
  34440. if res.Body != nil {
  34441. res.Body.Close()
  34442. }
  34443. return nil, &googleapi.Error{
  34444. Code: res.StatusCode,
  34445. Header: res.Header,
  34446. }
  34447. }
  34448. if err != nil {
  34449. return nil, err
  34450. }
  34451. defer googleapi.CloseBody(res)
  34452. if err := googleapi.CheckResponse(res); err != nil {
  34453. return nil, err
  34454. }
  34455. ret := &Firewall{
  34456. ServerResponse: googleapi.ServerResponse{
  34457. Header: res.Header,
  34458. HTTPStatusCode: res.StatusCode,
  34459. },
  34460. }
  34461. target := &ret
  34462. if err := gensupport.DecodeResponse(target, res); err != nil {
  34463. return nil, err
  34464. }
  34465. return ret, nil
  34466. // {
  34467. // "description": "Returns the specified firewall.",
  34468. // "httpMethod": "GET",
  34469. // "id": "compute.firewalls.get",
  34470. // "parameterOrder": [
  34471. // "project",
  34472. // "firewall"
  34473. // ],
  34474. // "parameters": {
  34475. // "firewall": {
  34476. // "description": "Name of the firewall rule to return.",
  34477. // "location": "path",
  34478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34479. // "required": true,
  34480. // "type": "string"
  34481. // },
  34482. // "project": {
  34483. // "description": "Project ID for this request.",
  34484. // "location": "path",
  34485. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34486. // "required": true,
  34487. // "type": "string"
  34488. // }
  34489. // },
  34490. // "path": "{project}/global/firewalls/{firewall}",
  34491. // "response": {
  34492. // "$ref": "Firewall"
  34493. // },
  34494. // "scopes": [
  34495. // "https://www.googleapis.com/auth/cloud-platform",
  34496. // "https://www.googleapis.com/auth/compute",
  34497. // "https://www.googleapis.com/auth/compute.readonly"
  34498. // ]
  34499. // }
  34500. }
  34501. // method id "compute.firewalls.insert":
  34502. type FirewallsInsertCall struct {
  34503. s *Service
  34504. project string
  34505. firewall *Firewall
  34506. urlParams_ gensupport.URLParams
  34507. ctx_ context.Context
  34508. header_ http.Header
  34509. }
  34510. // Insert: Creates a firewall rule in the specified project using the
  34511. // data included in the request.
  34512. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  34513. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  34514. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34515. c.project = project
  34516. c.firewall = firewall
  34517. return c
  34518. }
  34519. // RequestId sets the optional parameter "requestId": An optional
  34520. // request ID to identify requests. Specify a unique request ID so that
  34521. // if you must retry your request, the server will know to ignore the
  34522. // request if it has already been completed.
  34523. //
  34524. // For example, consider a situation where you make an initial request
  34525. // and the request times out. If you make the request again with the
  34526. // same request ID, the server can check if original operation with the
  34527. // same request ID was received, and if so, will ignore the second
  34528. // request. This prevents clients from accidentally creating duplicate
  34529. // commitments.
  34530. //
  34531. // The request ID must be a valid UUID with the exception that zero UUID
  34532. // is not supported (00000000-0000-0000-0000-000000000000).
  34533. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  34534. c.urlParams_.Set("requestId", requestId)
  34535. return c
  34536. }
  34537. // Fields allows partial responses to be retrieved. See
  34538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34539. // for more information.
  34540. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  34541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34542. return c
  34543. }
  34544. // Context sets the context to be used in this call's Do method. Any
  34545. // pending HTTP request will be aborted if the provided context is
  34546. // canceled.
  34547. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  34548. c.ctx_ = ctx
  34549. return c
  34550. }
  34551. // Header returns an http.Header that can be modified by the caller to
  34552. // add HTTP headers to the request.
  34553. func (c *FirewallsInsertCall) Header() http.Header {
  34554. if c.header_ == nil {
  34555. c.header_ = make(http.Header)
  34556. }
  34557. return c.header_
  34558. }
  34559. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  34560. reqHeaders := make(http.Header)
  34561. for k, v := range c.header_ {
  34562. reqHeaders[k] = v
  34563. }
  34564. reqHeaders.Set("User-Agent", c.s.userAgent())
  34565. var body io.Reader = nil
  34566. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  34567. if err != nil {
  34568. return nil, err
  34569. }
  34570. reqHeaders.Set("Content-Type", "application/json")
  34571. c.urlParams_.Set("alt", alt)
  34572. c.urlParams_.Set("prettyPrint", "false")
  34573. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  34574. urls += "?" + c.urlParams_.Encode()
  34575. req, err := http.NewRequest("POST", urls, body)
  34576. if err != nil {
  34577. return nil, err
  34578. }
  34579. req.Header = reqHeaders
  34580. googleapi.Expand(req.URL, map[string]string{
  34581. "project": c.project,
  34582. })
  34583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34584. }
  34585. // Do executes the "compute.firewalls.insert" call.
  34586. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34587. // status code is an error. Response headers are in either
  34588. // *Operation.ServerResponse.Header or (if a response was returned at
  34589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34590. // to check whether the returned error was because
  34591. // http.StatusNotModified was returned.
  34592. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34593. gensupport.SetOptions(c.urlParams_, opts...)
  34594. res, err := c.doRequest("json")
  34595. if res != nil && res.StatusCode == http.StatusNotModified {
  34596. if res.Body != nil {
  34597. res.Body.Close()
  34598. }
  34599. return nil, &googleapi.Error{
  34600. Code: res.StatusCode,
  34601. Header: res.Header,
  34602. }
  34603. }
  34604. if err != nil {
  34605. return nil, err
  34606. }
  34607. defer googleapi.CloseBody(res)
  34608. if err := googleapi.CheckResponse(res); err != nil {
  34609. return nil, err
  34610. }
  34611. ret := &Operation{
  34612. ServerResponse: googleapi.ServerResponse{
  34613. Header: res.Header,
  34614. HTTPStatusCode: res.StatusCode,
  34615. },
  34616. }
  34617. target := &ret
  34618. if err := gensupport.DecodeResponse(target, res); err != nil {
  34619. return nil, err
  34620. }
  34621. return ret, nil
  34622. // {
  34623. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  34624. // "httpMethod": "POST",
  34625. // "id": "compute.firewalls.insert",
  34626. // "parameterOrder": [
  34627. // "project"
  34628. // ],
  34629. // "parameters": {
  34630. // "project": {
  34631. // "description": "Project ID for this request.",
  34632. // "location": "path",
  34633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34634. // "required": true,
  34635. // "type": "string"
  34636. // },
  34637. // "requestId": {
  34638. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34639. // "location": "query",
  34640. // "type": "string"
  34641. // }
  34642. // },
  34643. // "path": "{project}/global/firewalls",
  34644. // "request": {
  34645. // "$ref": "Firewall"
  34646. // },
  34647. // "response": {
  34648. // "$ref": "Operation"
  34649. // },
  34650. // "scopes": [
  34651. // "https://www.googleapis.com/auth/cloud-platform",
  34652. // "https://www.googleapis.com/auth/compute"
  34653. // ]
  34654. // }
  34655. }
  34656. // method id "compute.firewalls.list":
  34657. type FirewallsListCall struct {
  34658. s *Service
  34659. project string
  34660. urlParams_ gensupport.URLParams
  34661. ifNoneMatch_ string
  34662. ctx_ context.Context
  34663. header_ http.Header
  34664. }
  34665. // List: Retrieves the list of firewall rules available to the specified
  34666. // project.
  34667. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  34668. func (r *FirewallsService) List(project string) *FirewallsListCall {
  34669. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34670. c.project = project
  34671. return c
  34672. }
  34673. // Filter sets the optional parameter "filter": A filter expression that
  34674. // filters resources listed in the response. The expression must specify
  34675. // the field name, a comparison operator, and the value that you want to
  34676. // use for filtering. The value must be a string, a number, or a
  34677. // boolean. The comparison operator must be either =, !=, >, or <.
  34678. //
  34679. // For example, if you are filtering Compute Engine instances, you can
  34680. // exclude instances named example-instance by specifying name !=
  34681. // example-instance.
  34682. //
  34683. // You can also filter nested fields. For example, you could specify
  34684. // scheduling.automaticRestart = false to include instances only if they
  34685. // are not scheduled for automatic restarts. You can use filtering on
  34686. // nested fields to filter based on resource labels.
  34687. //
  34688. // To filter on multiple expressions, provide each separate expression
  34689. // within parentheses. For example, (scheduling.automaticRestart = true)
  34690. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34691. // AND expression. However, you can include AND and OR expressions
  34692. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34693. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34694. // true).
  34695. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  34696. c.urlParams_.Set("filter", filter)
  34697. return c
  34698. }
  34699. // MaxResults sets the optional parameter "maxResults": The maximum
  34700. // number of results per page that should be returned. If the number of
  34701. // available results is larger than maxResults, Compute Engine returns a
  34702. // nextPageToken that can be used to get the next page of results in
  34703. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34704. // (Default: 500)
  34705. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  34706. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34707. return c
  34708. }
  34709. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34710. // a certain order. By default, results are returned in alphanumerical
  34711. // order based on the resource name.
  34712. //
  34713. // You can also sort results in descending order based on the creation
  34714. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34715. // based on the creationTimestamp field in reverse chronological order
  34716. // (newest result first). Use this to sort resources like operations so
  34717. // that the newest operation is returned first.
  34718. //
  34719. // Currently, only sorting by name or creationTimestamp desc is
  34720. // supported.
  34721. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  34722. c.urlParams_.Set("orderBy", orderBy)
  34723. return c
  34724. }
  34725. // PageToken sets the optional parameter "pageToken": Specifies a page
  34726. // token to use. Set pageToken to the nextPageToken returned by a
  34727. // previous list request to get the next page of results.
  34728. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  34729. c.urlParams_.Set("pageToken", pageToken)
  34730. return c
  34731. }
  34732. // Fields allows partial responses to be retrieved. See
  34733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34734. // for more information.
  34735. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  34736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34737. return c
  34738. }
  34739. // IfNoneMatch sets the optional parameter which makes the operation
  34740. // fail if the object's ETag matches the given value. This is useful for
  34741. // getting updates only after the object has changed since the last
  34742. // request. Use googleapi.IsNotModified to check whether the response
  34743. // error from Do is the result of In-None-Match.
  34744. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  34745. c.ifNoneMatch_ = entityTag
  34746. return c
  34747. }
  34748. // Context sets the context to be used in this call's Do method. Any
  34749. // pending HTTP request will be aborted if the provided context is
  34750. // canceled.
  34751. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  34752. c.ctx_ = ctx
  34753. return c
  34754. }
  34755. // Header returns an http.Header that can be modified by the caller to
  34756. // add HTTP headers to the request.
  34757. func (c *FirewallsListCall) Header() http.Header {
  34758. if c.header_ == nil {
  34759. c.header_ = make(http.Header)
  34760. }
  34761. return c.header_
  34762. }
  34763. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  34764. reqHeaders := make(http.Header)
  34765. for k, v := range c.header_ {
  34766. reqHeaders[k] = v
  34767. }
  34768. reqHeaders.Set("User-Agent", c.s.userAgent())
  34769. if c.ifNoneMatch_ != "" {
  34770. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34771. }
  34772. var body io.Reader = nil
  34773. c.urlParams_.Set("alt", alt)
  34774. c.urlParams_.Set("prettyPrint", "false")
  34775. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  34776. urls += "?" + c.urlParams_.Encode()
  34777. req, err := http.NewRequest("GET", urls, body)
  34778. if err != nil {
  34779. return nil, err
  34780. }
  34781. req.Header = reqHeaders
  34782. googleapi.Expand(req.URL, map[string]string{
  34783. "project": c.project,
  34784. })
  34785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34786. }
  34787. // Do executes the "compute.firewalls.list" call.
  34788. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  34789. // status code is an error. Response headers are in either
  34790. // *FirewallList.ServerResponse.Header or (if a response was returned at
  34791. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34792. // to check whether the returned error was because
  34793. // http.StatusNotModified was returned.
  34794. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  34795. gensupport.SetOptions(c.urlParams_, opts...)
  34796. res, err := c.doRequest("json")
  34797. if res != nil && res.StatusCode == http.StatusNotModified {
  34798. if res.Body != nil {
  34799. res.Body.Close()
  34800. }
  34801. return nil, &googleapi.Error{
  34802. Code: res.StatusCode,
  34803. Header: res.Header,
  34804. }
  34805. }
  34806. if err != nil {
  34807. return nil, err
  34808. }
  34809. defer googleapi.CloseBody(res)
  34810. if err := googleapi.CheckResponse(res); err != nil {
  34811. return nil, err
  34812. }
  34813. ret := &FirewallList{
  34814. ServerResponse: googleapi.ServerResponse{
  34815. Header: res.Header,
  34816. HTTPStatusCode: res.StatusCode,
  34817. },
  34818. }
  34819. target := &ret
  34820. if err := gensupport.DecodeResponse(target, res); err != nil {
  34821. return nil, err
  34822. }
  34823. return ret, nil
  34824. // {
  34825. // "description": "Retrieves the list of firewall rules available to the specified project.",
  34826. // "httpMethod": "GET",
  34827. // "id": "compute.firewalls.list",
  34828. // "parameterOrder": [
  34829. // "project"
  34830. // ],
  34831. // "parameters": {
  34832. // "filter": {
  34833. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  34834. // "location": "query",
  34835. // "type": "string"
  34836. // },
  34837. // "maxResults": {
  34838. // "default": "500",
  34839. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  34840. // "format": "uint32",
  34841. // "location": "query",
  34842. // "minimum": "0",
  34843. // "type": "integer"
  34844. // },
  34845. // "orderBy": {
  34846. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34847. // "location": "query",
  34848. // "type": "string"
  34849. // },
  34850. // "pageToken": {
  34851. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34852. // "location": "query",
  34853. // "type": "string"
  34854. // },
  34855. // "project": {
  34856. // "description": "Project ID for this request.",
  34857. // "location": "path",
  34858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34859. // "required": true,
  34860. // "type": "string"
  34861. // }
  34862. // },
  34863. // "path": "{project}/global/firewalls",
  34864. // "response": {
  34865. // "$ref": "FirewallList"
  34866. // },
  34867. // "scopes": [
  34868. // "https://www.googleapis.com/auth/cloud-platform",
  34869. // "https://www.googleapis.com/auth/compute",
  34870. // "https://www.googleapis.com/auth/compute.readonly"
  34871. // ]
  34872. // }
  34873. }
  34874. // Pages invokes f for each page of results.
  34875. // A non-nil error returned from f will halt the iteration.
  34876. // The provided context supersedes any context provided to the Context method.
  34877. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  34878. c.ctx_ = ctx
  34879. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34880. for {
  34881. x, err := c.Do()
  34882. if err != nil {
  34883. return err
  34884. }
  34885. if err := f(x); err != nil {
  34886. return err
  34887. }
  34888. if x.NextPageToken == "" {
  34889. return nil
  34890. }
  34891. c.PageToken(x.NextPageToken)
  34892. }
  34893. }
  34894. // method id "compute.firewalls.patch":
  34895. type FirewallsPatchCall struct {
  34896. s *Service
  34897. project string
  34898. firewall string
  34899. firewall2 *Firewall
  34900. urlParams_ gensupport.URLParams
  34901. ctx_ context.Context
  34902. header_ http.Header
  34903. }
  34904. // Patch: Updates the specified firewall rule with the data included in
  34905. // the request. This method supports PATCH semantics and uses the JSON
  34906. // merge patch format and processing rules.
  34907. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  34908. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  34909. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34910. c.project = project
  34911. c.firewall = firewall
  34912. c.firewall2 = firewall2
  34913. return c
  34914. }
  34915. // RequestId sets the optional parameter "requestId": An optional
  34916. // request ID to identify requests. Specify a unique request ID so that
  34917. // if you must retry your request, the server will know to ignore the
  34918. // request if it has already been completed.
  34919. //
  34920. // For example, consider a situation where you make an initial request
  34921. // and the request times out. If you make the request again with the
  34922. // same request ID, the server can check if original operation with the
  34923. // same request ID was received, and if so, will ignore the second
  34924. // request. This prevents clients from accidentally creating duplicate
  34925. // commitments.
  34926. //
  34927. // The request ID must be a valid UUID with the exception that zero UUID
  34928. // is not supported (00000000-0000-0000-0000-000000000000).
  34929. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  34930. c.urlParams_.Set("requestId", requestId)
  34931. return c
  34932. }
  34933. // Fields allows partial responses to be retrieved. See
  34934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34935. // for more information.
  34936. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  34937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34938. return c
  34939. }
  34940. // Context sets the context to be used in this call's Do method. Any
  34941. // pending HTTP request will be aborted if the provided context is
  34942. // canceled.
  34943. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  34944. c.ctx_ = ctx
  34945. return c
  34946. }
  34947. // Header returns an http.Header that can be modified by the caller to
  34948. // add HTTP headers to the request.
  34949. func (c *FirewallsPatchCall) Header() http.Header {
  34950. if c.header_ == nil {
  34951. c.header_ = make(http.Header)
  34952. }
  34953. return c.header_
  34954. }
  34955. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  34956. reqHeaders := make(http.Header)
  34957. for k, v := range c.header_ {
  34958. reqHeaders[k] = v
  34959. }
  34960. reqHeaders.Set("User-Agent", c.s.userAgent())
  34961. var body io.Reader = nil
  34962. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  34963. if err != nil {
  34964. return nil, err
  34965. }
  34966. reqHeaders.Set("Content-Type", "application/json")
  34967. c.urlParams_.Set("alt", alt)
  34968. c.urlParams_.Set("prettyPrint", "false")
  34969. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  34970. urls += "?" + c.urlParams_.Encode()
  34971. req, err := http.NewRequest("PATCH", urls, body)
  34972. if err != nil {
  34973. return nil, err
  34974. }
  34975. req.Header = reqHeaders
  34976. googleapi.Expand(req.URL, map[string]string{
  34977. "project": c.project,
  34978. "firewall": c.firewall,
  34979. })
  34980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34981. }
  34982. // Do executes the "compute.firewalls.patch" call.
  34983. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34984. // status code is an error. Response headers are in either
  34985. // *Operation.ServerResponse.Header or (if a response was returned at
  34986. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34987. // to check whether the returned error was because
  34988. // http.StatusNotModified was returned.
  34989. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34990. gensupport.SetOptions(c.urlParams_, opts...)
  34991. res, err := c.doRequest("json")
  34992. if res != nil && res.StatusCode == http.StatusNotModified {
  34993. if res.Body != nil {
  34994. res.Body.Close()
  34995. }
  34996. return nil, &googleapi.Error{
  34997. Code: res.StatusCode,
  34998. Header: res.Header,
  34999. }
  35000. }
  35001. if err != nil {
  35002. return nil, err
  35003. }
  35004. defer googleapi.CloseBody(res)
  35005. if err := googleapi.CheckResponse(res); err != nil {
  35006. return nil, err
  35007. }
  35008. ret := &Operation{
  35009. ServerResponse: googleapi.ServerResponse{
  35010. Header: res.Header,
  35011. HTTPStatusCode: res.StatusCode,
  35012. },
  35013. }
  35014. target := &ret
  35015. if err := gensupport.DecodeResponse(target, res); err != nil {
  35016. return nil, err
  35017. }
  35018. return ret, nil
  35019. // {
  35020. // "description": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  35021. // "httpMethod": "PATCH",
  35022. // "id": "compute.firewalls.patch",
  35023. // "parameterOrder": [
  35024. // "project",
  35025. // "firewall"
  35026. // ],
  35027. // "parameters": {
  35028. // "firewall": {
  35029. // "description": "Name of the firewall rule to patch.",
  35030. // "location": "path",
  35031. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35032. // "required": true,
  35033. // "type": "string"
  35034. // },
  35035. // "project": {
  35036. // "description": "Project ID for this request.",
  35037. // "location": "path",
  35038. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35039. // "required": true,
  35040. // "type": "string"
  35041. // },
  35042. // "requestId": {
  35043. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35044. // "location": "query",
  35045. // "type": "string"
  35046. // }
  35047. // },
  35048. // "path": "{project}/global/firewalls/{firewall}",
  35049. // "request": {
  35050. // "$ref": "Firewall"
  35051. // },
  35052. // "response": {
  35053. // "$ref": "Operation"
  35054. // },
  35055. // "scopes": [
  35056. // "https://www.googleapis.com/auth/cloud-platform",
  35057. // "https://www.googleapis.com/auth/compute"
  35058. // ]
  35059. // }
  35060. }
  35061. // method id "compute.firewalls.update":
  35062. type FirewallsUpdateCall struct {
  35063. s *Service
  35064. project string
  35065. firewall string
  35066. firewall2 *Firewall
  35067. urlParams_ gensupport.URLParams
  35068. ctx_ context.Context
  35069. header_ http.Header
  35070. }
  35071. // Update: Updates the specified firewall rule with the data included in
  35072. // the request. The PUT method can only update the following fields of
  35073. // firewall rule: allowed, description, sourceRanges, sourceTags,
  35074. // targetTags.
  35075. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  35076. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  35077. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35078. c.project = project
  35079. c.firewall = firewall
  35080. c.firewall2 = firewall2
  35081. return c
  35082. }
  35083. // RequestId sets the optional parameter "requestId": An optional
  35084. // request ID to identify requests. Specify a unique request ID so that
  35085. // if you must retry your request, the server will know to ignore the
  35086. // request if it has already been completed.
  35087. //
  35088. // For example, consider a situation where you make an initial request
  35089. // and the request times out. If you make the request again with the
  35090. // same request ID, the server can check if original operation with the
  35091. // same request ID was received, and if so, will ignore the second
  35092. // request. This prevents clients from accidentally creating duplicate
  35093. // commitments.
  35094. //
  35095. // The request ID must be a valid UUID with the exception that zero UUID
  35096. // is not supported (00000000-0000-0000-0000-000000000000).
  35097. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  35098. c.urlParams_.Set("requestId", requestId)
  35099. return c
  35100. }
  35101. // Fields allows partial responses to be retrieved. See
  35102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35103. // for more information.
  35104. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  35105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35106. return c
  35107. }
  35108. // Context sets the context to be used in this call's Do method. Any
  35109. // pending HTTP request will be aborted if the provided context is
  35110. // canceled.
  35111. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  35112. c.ctx_ = ctx
  35113. return c
  35114. }
  35115. // Header returns an http.Header that can be modified by the caller to
  35116. // add HTTP headers to the request.
  35117. func (c *FirewallsUpdateCall) Header() http.Header {
  35118. if c.header_ == nil {
  35119. c.header_ = make(http.Header)
  35120. }
  35121. return c.header_
  35122. }
  35123. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35124. reqHeaders := make(http.Header)
  35125. for k, v := range c.header_ {
  35126. reqHeaders[k] = v
  35127. }
  35128. reqHeaders.Set("User-Agent", c.s.userAgent())
  35129. var body io.Reader = nil
  35130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  35131. if err != nil {
  35132. return nil, err
  35133. }
  35134. reqHeaders.Set("Content-Type", "application/json")
  35135. c.urlParams_.Set("alt", alt)
  35136. c.urlParams_.Set("prettyPrint", "false")
  35137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  35138. urls += "?" + c.urlParams_.Encode()
  35139. req, err := http.NewRequest("PUT", urls, body)
  35140. if err != nil {
  35141. return nil, err
  35142. }
  35143. req.Header = reqHeaders
  35144. googleapi.Expand(req.URL, map[string]string{
  35145. "project": c.project,
  35146. "firewall": c.firewall,
  35147. })
  35148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35149. }
  35150. // Do executes the "compute.firewalls.update" call.
  35151. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35152. // status code is an error. Response headers are in either
  35153. // *Operation.ServerResponse.Header or (if a response was returned at
  35154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35155. // to check whether the returned error was because
  35156. // http.StatusNotModified was returned.
  35157. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35158. gensupport.SetOptions(c.urlParams_, opts...)
  35159. res, err := c.doRequest("json")
  35160. if res != nil && res.StatusCode == http.StatusNotModified {
  35161. if res.Body != nil {
  35162. res.Body.Close()
  35163. }
  35164. return nil, &googleapi.Error{
  35165. Code: res.StatusCode,
  35166. Header: res.Header,
  35167. }
  35168. }
  35169. if err != nil {
  35170. return nil, err
  35171. }
  35172. defer googleapi.CloseBody(res)
  35173. if err := googleapi.CheckResponse(res); err != nil {
  35174. return nil, err
  35175. }
  35176. ret := &Operation{
  35177. ServerResponse: googleapi.ServerResponse{
  35178. Header: res.Header,
  35179. HTTPStatusCode: res.StatusCode,
  35180. },
  35181. }
  35182. target := &ret
  35183. if err := gensupport.DecodeResponse(target, res); err != nil {
  35184. return nil, err
  35185. }
  35186. return ret, nil
  35187. // {
  35188. // "description": "Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.",
  35189. // "httpMethod": "PUT",
  35190. // "id": "compute.firewalls.update",
  35191. // "parameterOrder": [
  35192. // "project",
  35193. // "firewall"
  35194. // ],
  35195. // "parameters": {
  35196. // "firewall": {
  35197. // "description": "Name of the firewall rule to update.",
  35198. // "location": "path",
  35199. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35200. // "required": true,
  35201. // "type": "string"
  35202. // },
  35203. // "project": {
  35204. // "description": "Project ID for this request.",
  35205. // "location": "path",
  35206. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35207. // "required": true,
  35208. // "type": "string"
  35209. // },
  35210. // "requestId": {
  35211. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35212. // "location": "query",
  35213. // "type": "string"
  35214. // }
  35215. // },
  35216. // "path": "{project}/global/firewalls/{firewall}",
  35217. // "request": {
  35218. // "$ref": "Firewall"
  35219. // },
  35220. // "response": {
  35221. // "$ref": "Operation"
  35222. // },
  35223. // "scopes": [
  35224. // "https://www.googleapis.com/auth/cloud-platform",
  35225. // "https://www.googleapis.com/auth/compute"
  35226. // ]
  35227. // }
  35228. }
  35229. // method id "compute.forwardingRules.aggregatedList":
  35230. type ForwardingRulesAggregatedListCall struct {
  35231. s *Service
  35232. project string
  35233. urlParams_ gensupport.URLParams
  35234. ifNoneMatch_ string
  35235. ctx_ context.Context
  35236. header_ http.Header
  35237. }
  35238. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  35239. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  35240. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  35241. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35242. c.project = project
  35243. return c
  35244. }
  35245. // Filter sets the optional parameter "filter": A filter expression that
  35246. // filters resources listed in the response. The expression must specify
  35247. // the field name, a comparison operator, and the value that you want to
  35248. // use for filtering. The value must be a string, a number, or a
  35249. // boolean. The comparison operator must be either =, !=, >, or <.
  35250. //
  35251. // For example, if you are filtering Compute Engine instances, you can
  35252. // exclude instances named example-instance by specifying name !=
  35253. // example-instance.
  35254. //
  35255. // You can also filter nested fields. For example, you could specify
  35256. // scheduling.automaticRestart = false to include instances only if they
  35257. // are not scheduled for automatic restarts. You can use filtering on
  35258. // nested fields to filter based on resource labels.
  35259. //
  35260. // To filter on multiple expressions, provide each separate expression
  35261. // within parentheses. For example, (scheduling.automaticRestart = true)
  35262. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35263. // AND expression. However, you can include AND and OR expressions
  35264. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35265. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35266. // true).
  35267. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  35268. c.urlParams_.Set("filter", filter)
  35269. return c
  35270. }
  35271. // MaxResults sets the optional parameter "maxResults": The maximum
  35272. // number of results per page that should be returned. If the number of
  35273. // available results is larger than maxResults, Compute Engine returns a
  35274. // nextPageToken that can be used to get the next page of results in
  35275. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35276. // (Default: 500)
  35277. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  35278. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35279. return c
  35280. }
  35281. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35282. // a certain order. By default, results are returned in alphanumerical
  35283. // order based on the resource name.
  35284. //
  35285. // You can also sort results in descending order based on the creation
  35286. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35287. // based on the creationTimestamp field in reverse chronological order
  35288. // (newest result first). Use this to sort resources like operations so
  35289. // that the newest operation is returned first.
  35290. //
  35291. // Currently, only sorting by name or creationTimestamp desc is
  35292. // supported.
  35293. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  35294. c.urlParams_.Set("orderBy", orderBy)
  35295. return c
  35296. }
  35297. // PageToken sets the optional parameter "pageToken": Specifies a page
  35298. // token to use. Set pageToken to the nextPageToken returned by a
  35299. // previous list request to get the next page of results.
  35300. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  35301. c.urlParams_.Set("pageToken", pageToken)
  35302. return c
  35303. }
  35304. // Fields allows partial responses to be retrieved. See
  35305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35306. // for more information.
  35307. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  35308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35309. return c
  35310. }
  35311. // IfNoneMatch sets the optional parameter which makes the operation
  35312. // fail if the object's ETag matches the given value. This is useful for
  35313. // getting updates only after the object has changed since the last
  35314. // request. Use googleapi.IsNotModified to check whether the response
  35315. // error from Do is the result of In-None-Match.
  35316. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  35317. c.ifNoneMatch_ = entityTag
  35318. return c
  35319. }
  35320. // Context sets the context to be used in this call's Do method. Any
  35321. // pending HTTP request will be aborted if the provided context is
  35322. // canceled.
  35323. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  35324. c.ctx_ = ctx
  35325. return c
  35326. }
  35327. // Header returns an http.Header that can be modified by the caller to
  35328. // add HTTP headers to the request.
  35329. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  35330. if c.header_ == nil {
  35331. c.header_ = make(http.Header)
  35332. }
  35333. return c.header_
  35334. }
  35335. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  35336. reqHeaders := make(http.Header)
  35337. for k, v := range c.header_ {
  35338. reqHeaders[k] = v
  35339. }
  35340. reqHeaders.Set("User-Agent", c.s.userAgent())
  35341. if c.ifNoneMatch_ != "" {
  35342. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35343. }
  35344. var body io.Reader = nil
  35345. c.urlParams_.Set("alt", alt)
  35346. c.urlParams_.Set("prettyPrint", "false")
  35347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  35348. urls += "?" + c.urlParams_.Encode()
  35349. req, err := http.NewRequest("GET", urls, body)
  35350. if err != nil {
  35351. return nil, err
  35352. }
  35353. req.Header = reqHeaders
  35354. googleapi.Expand(req.URL, map[string]string{
  35355. "project": c.project,
  35356. })
  35357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35358. }
  35359. // Do executes the "compute.forwardingRules.aggregatedList" call.
  35360. // Exactly one of *ForwardingRuleAggregatedList or error will be
  35361. // non-nil. Any non-2xx status code is an error. Response headers are in
  35362. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  35363. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35364. // googleapi.IsNotModified to check whether the returned error was
  35365. // because http.StatusNotModified was returned.
  35366. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  35367. gensupport.SetOptions(c.urlParams_, opts...)
  35368. res, err := c.doRequest("json")
  35369. if res != nil && res.StatusCode == http.StatusNotModified {
  35370. if res.Body != nil {
  35371. res.Body.Close()
  35372. }
  35373. return nil, &googleapi.Error{
  35374. Code: res.StatusCode,
  35375. Header: res.Header,
  35376. }
  35377. }
  35378. if err != nil {
  35379. return nil, err
  35380. }
  35381. defer googleapi.CloseBody(res)
  35382. if err := googleapi.CheckResponse(res); err != nil {
  35383. return nil, err
  35384. }
  35385. ret := &ForwardingRuleAggregatedList{
  35386. ServerResponse: googleapi.ServerResponse{
  35387. Header: res.Header,
  35388. HTTPStatusCode: res.StatusCode,
  35389. },
  35390. }
  35391. target := &ret
  35392. if err := gensupport.DecodeResponse(target, res); err != nil {
  35393. return nil, err
  35394. }
  35395. return ret, nil
  35396. // {
  35397. // "description": "Retrieves an aggregated list of forwarding rules.",
  35398. // "httpMethod": "GET",
  35399. // "id": "compute.forwardingRules.aggregatedList",
  35400. // "parameterOrder": [
  35401. // "project"
  35402. // ],
  35403. // "parameters": {
  35404. // "filter": {
  35405. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  35406. // "location": "query",
  35407. // "type": "string"
  35408. // },
  35409. // "maxResults": {
  35410. // "default": "500",
  35411. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35412. // "format": "uint32",
  35413. // "location": "query",
  35414. // "minimum": "0",
  35415. // "type": "integer"
  35416. // },
  35417. // "orderBy": {
  35418. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35419. // "location": "query",
  35420. // "type": "string"
  35421. // },
  35422. // "pageToken": {
  35423. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35424. // "location": "query",
  35425. // "type": "string"
  35426. // },
  35427. // "project": {
  35428. // "description": "Project ID for this request.",
  35429. // "location": "path",
  35430. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35431. // "required": true,
  35432. // "type": "string"
  35433. // }
  35434. // },
  35435. // "path": "{project}/aggregated/forwardingRules",
  35436. // "response": {
  35437. // "$ref": "ForwardingRuleAggregatedList"
  35438. // },
  35439. // "scopes": [
  35440. // "https://www.googleapis.com/auth/cloud-platform",
  35441. // "https://www.googleapis.com/auth/compute",
  35442. // "https://www.googleapis.com/auth/compute.readonly"
  35443. // ]
  35444. // }
  35445. }
  35446. // Pages invokes f for each page of results.
  35447. // A non-nil error returned from f will halt the iteration.
  35448. // The provided context supersedes any context provided to the Context method.
  35449. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  35450. c.ctx_ = ctx
  35451. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35452. for {
  35453. x, err := c.Do()
  35454. if err != nil {
  35455. return err
  35456. }
  35457. if err := f(x); err != nil {
  35458. return err
  35459. }
  35460. if x.NextPageToken == "" {
  35461. return nil
  35462. }
  35463. c.PageToken(x.NextPageToken)
  35464. }
  35465. }
  35466. // method id "compute.forwardingRules.delete":
  35467. type ForwardingRulesDeleteCall struct {
  35468. s *Service
  35469. project string
  35470. region string
  35471. forwardingRule string
  35472. urlParams_ gensupport.URLParams
  35473. ctx_ context.Context
  35474. header_ http.Header
  35475. }
  35476. // Delete: Deletes the specified ForwardingRule resource.
  35477. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  35478. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  35479. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35480. c.project = project
  35481. c.region = region
  35482. c.forwardingRule = forwardingRule
  35483. return c
  35484. }
  35485. // RequestId sets the optional parameter "requestId": An optional
  35486. // request ID to identify requests. Specify a unique request ID so that
  35487. // if you must retry your request, the server will know to ignore the
  35488. // request if it has already been completed.
  35489. //
  35490. // For example, consider a situation where you make an initial request
  35491. // and the request times out. If you make the request again with the
  35492. // same request ID, the server can check if original operation with the
  35493. // same request ID was received, and if so, will ignore the second
  35494. // request. This prevents clients from accidentally creating duplicate
  35495. // commitments.
  35496. //
  35497. // The request ID must be a valid UUID with the exception that zero UUID
  35498. // is not supported (00000000-0000-0000-0000-000000000000).
  35499. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  35500. c.urlParams_.Set("requestId", requestId)
  35501. return c
  35502. }
  35503. // Fields allows partial responses to be retrieved. See
  35504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35505. // for more information.
  35506. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  35507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35508. return c
  35509. }
  35510. // Context sets the context to be used in this call's Do method. Any
  35511. // pending HTTP request will be aborted if the provided context is
  35512. // canceled.
  35513. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  35514. c.ctx_ = ctx
  35515. return c
  35516. }
  35517. // Header returns an http.Header that can be modified by the caller to
  35518. // add HTTP headers to the request.
  35519. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  35520. if c.header_ == nil {
  35521. c.header_ = make(http.Header)
  35522. }
  35523. return c.header_
  35524. }
  35525. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  35526. reqHeaders := make(http.Header)
  35527. for k, v := range c.header_ {
  35528. reqHeaders[k] = v
  35529. }
  35530. reqHeaders.Set("User-Agent", c.s.userAgent())
  35531. var body io.Reader = nil
  35532. c.urlParams_.Set("alt", alt)
  35533. c.urlParams_.Set("prettyPrint", "false")
  35534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  35535. urls += "?" + c.urlParams_.Encode()
  35536. req, err := http.NewRequest("DELETE", urls, body)
  35537. if err != nil {
  35538. return nil, err
  35539. }
  35540. req.Header = reqHeaders
  35541. googleapi.Expand(req.URL, map[string]string{
  35542. "project": c.project,
  35543. "region": c.region,
  35544. "forwardingRule": c.forwardingRule,
  35545. })
  35546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35547. }
  35548. // Do executes the "compute.forwardingRules.delete" call.
  35549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35550. // status code is an error. Response headers are in either
  35551. // *Operation.ServerResponse.Header or (if a response was returned at
  35552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35553. // to check whether the returned error was because
  35554. // http.StatusNotModified was returned.
  35555. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35556. gensupport.SetOptions(c.urlParams_, opts...)
  35557. res, err := c.doRequest("json")
  35558. if res != nil && res.StatusCode == http.StatusNotModified {
  35559. if res.Body != nil {
  35560. res.Body.Close()
  35561. }
  35562. return nil, &googleapi.Error{
  35563. Code: res.StatusCode,
  35564. Header: res.Header,
  35565. }
  35566. }
  35567. if err != nil {
  35568. return nil, err
  35569. }
  35570. defer googleapi.CloseBody(res)
  35571. if err := googleapi.CheckResponse(res); err != nil {
  35572. return nil, err
  35573. }
  35574. ret := &Operation{
  35575. ServerResponse: googleapi.ServerResponse{
  35576. Header: res.Header,
  35577. HTTPStatusCode: res.StatusCode,
  35578. },
  35579. }
  35580. target := &ret
  35581. if err := gensupport.DecodeResponse(target, res); err != nil {
  35582. return nil, err
  35583. }
  35584. return ret, nil
  35585. // {
  35586. // "description": "Deletes the specified ForwardingRule resource.",
  35587. // "httpMethod": "DELETE",
  35588. // "id": "compute.forwardingRules.delete",
  35589. // "parameterOrder": [
  35590. // "project",
  35591. // "region",
  35592. // "forwardingRule"
  35593. // ],
  35594. // "parameters": {
  35595. // "forwardingRule": {
  35596. // "description": "Name of the ForwardingRule resource to delete.",
  35597. // "location": "path",
  35598. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35599. // "required": true,
  35600. // "type": "string"
  35601. // },
  35602. // "project": {
  35603. // "description": "Project ID for this request.",
  35604. // "location": "path",
  35605. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35606. // "required": true,
  35607. // "type": "string"
  35608. // },
  35609. // "region": {
  35610. // "description": "Name of the region scoping this request.",
  35611. // "location": "path",
  35612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35613. // "required": true,
  35614. // "type": "string"
  35615. // },
  35616. // "requestId": {
  35617. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35618. // "location": "query",
  35619. // "type": "string"
  35620. // }
  35621. // },
  35622. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  35623. // "response": {
  35624. // "$ref": "Operation"
  35625. // },
  35626. // "scopes": [
  35627. // "https://www.googleapis.com/auth/cloud-platform",
  35628. // "https://www.googleapis.com/auth/compute"
  35629. // ]
  35630. // }
  35631. }
  35632. // method id "compute.forwardingRules.get":
  35633. type ForwardingRulesGetCall struct {
  35634. s *Service
  35635. project string
  35636. region string
  35637. forwardingRule string
  35638. urlParams_ gensupport.URLParams
  35639. ifNoneMatch_ string
  35640. ctx_ context.Context
  35641. header_ http.Header
  35642. }
  35643. // Get: Returns the specified ForwardingRule resource.
  35644. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  35645. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  35646. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35647. c.project = project
  35648. c.region = region
  35649. c.forwardingRule = forwardingRule
  35650. return c
  35651. }
  35652. // Fields allows partial responses to be retrieved. See
  35653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35654. // for more information.
  35655. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  35656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35657. return c
  35658. }
  35659. // IfNoneMatch sets the optional parameter which makes the operation
  35660. // fail if the object's ETag matches the given value. This is useful for
  35661. // getting updates only after the object has changed since the last
  35662. // request. Use googleapi.IsNotModified to check whether the response
  35663. // error from Do is the result of In-None-Match.
  35664. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  35665. c.ifNoneMatch_ = entityTag
  35666. return c
  35667. }
  35668. // Context sets the context to be used in this call's Do method. Any
  35669. // pending HTTP request will be aborted if the provided context is
  35670. // canceled.
  35671. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  35672. c.ctx_ = ctx
  35673. return c
  35674. }
  35675. // Header returns an http.Header that can be modified by the caller to
  35676. // add HTTP headers to the request.
  35677. func (c *ForwardingRulesGetCall) Header() http.Header {
  35678. if c.header_ == nil {
  35679. c.header_ = make(http.Header)
  35680. }
  35681. return c.header_
  35682. }
  35683. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  35684. reqHeaders := make(http.Header)
  35685. for k, v := range c.header_ {
  35686. reqHeaders[k] = v
  35687. }
  35688. reqHeaders.Set("User-Agent", c.s.userAgent())
  35689. if c.ifNoneMatch_ != "" {
  35690. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35691. }
  35692. var body io.Reader = nil
  35693. c.urlParams_.Set("alt", alt)
  35694. c.urlParams_.Set("prettyPrint", "false")
  35695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  35696. urls += "?" + c.urlParams_.Encode()
  35697. req, err := http.NewRequest("GET", urls, body)
  35698. if err != nil {
  35699. return nil, err
  35700. }
  35701. req.Header = reqHeaders
  35702. googleapi.Expand(req.URL, map[string]string{
  35703. "project": c.project,
  35704. "region": c.region,
  35705. "forwardingRule": c.forwardingRule,
  35706. })
  35707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35708. }
  35709. // Do executes the "compute.forwardingRules.get" call.
  35710. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  35711. // status code is an error. Response headers are in either
  35712. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  35713. // at all) in error.(*googleapi.Error).Header. Use
  35714. // googleapi.IsNotModified to check whether the returned error was
  35715. // because http.StatusNotModified was returned.
  35716. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  35717. gensupport.SetOptions(c.urlParams_, opts...)
  35718. res, err := c.doRequest("json")
  35719. if res != nil && res.StatusCode == http.StatusNotModified {
  35720. if res.Body != nil {
  35721. res.Body.Close()
  35722. }
  35723. return nil, &googleapi.Error{
  35724. Code: res.StatusCode,
  35725. Header: res.Header,
  35726. }
  35727. }
  35728. if err != nil {
  35729. return nil, err
  35730. }
  35731. defer googleapi.CloseBody(res)
  35732. if err := googleapi.CheckResponse(res); err != nil {
  35733. return nil, err
  35734. }
  35735. ret := &ForwardingRule{
  35736. ServerResponse: googleapi.ServerResponse{
  35737. Header: res.Header,
  35738. HTTPStatusCode: res.StatusCode,
  35739. },
  35740. }
  35741. target := &ret
  35742. if err := gensupport.DecodeResponse(target, res); err != nil {
  35743. return nil, err
  35744. }
  35745. return ret, nil
  35746. // {
  35747. // "description": "Returns the specified ForwardingRule resource.",
  35748. // "httpMethod": "GET",
  35749. // "id": "compute.forwardingRules.get",
  35750. // "parameterOrder": [
  35751. // "project",
  35752. // "region",
  35753. // "forwardingRule"
  35754. // ],
  35755. // "parameters": {
  35756. // "forwardingRule": {
  35757. // "description": "Name of the ForwardingRule resource to return.",
  35758. // "location": "path",
  35759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35760. // "required": true,
  35761. // "type": "string"
  35762. // },
  35763. // "project": {
  35764. // "description": "Project ID for this request.",
  35765. // "location": "path",
  35766. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35767. // "required": true,
  35768. // "type": "string"
  35769. // },
  35770. // "region": {
  35771. // "description": "Name of the region scoping this request.",
  35772. // "location": "path",
  35773. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35774. // "required": true,
  35775. // "type": "string"
  35776. // }
  35777. // },
  35778. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  35779. // "response": {
  35780. // "$ref": "ForwardingRule"
  35781. // },
  35782. // "scopes": [
  35783. // "https://www.googleapis.com/auth/cloud-platform",
  35784. // "https://www.googleapis.com/auth/compute",
  35785. // "https://www.googleapis.com/auth/compute.readonly"
  35786. // ]
  35787. // }
  35788. }
  35789. // method id "compute.forwardingRules.insert":
  35790. type ForwardingRulesInsertCall struct {
  35791. s *Service
  35792. project string
  35793. region string
  35794. forwardingrule *ForwardingRule
  35795. urlParams_ gensupport.URLParams
  35796. ctx_ context.Context
  35797. header_ http.Header
  35798. }
  35799. // Insert: Creates a ForwardingRule resource in the specified project
  35800. // and region using the data included in the request.
  35801. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  35802. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  35803. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35804. c.project = project
  35805. c.region = region
  35806. c.forwardingrule = forwardingrule
  35807. return c
  35808. }
  35809. // RequestId sets the optional parameter "requestId": An optional
  35810. // request ID to identify requests. Specify a unique request ID so that
  35811. // if you must retry your request, the server will know to ignore the
  35812. // request if it has already been completed.
  35813. //
  35814. // For example, consider a situation where you make an initial request
  35815. // and the request times out. If you make the request again with the
  35816. // same request ID, the server can check if original operation with the
  35817. // same request ID was received, and if so, will ignore the second
  35818. // request. This prevents clients from accidentally creating duplicate
  35819. // commitments.
  35820. //
  35821. // The request ID must be a valid UUID with the exception that zero UUID
  35822. // is not supported (00000000-0000-0000-0000-000000000000).
  35823. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  35824. c.urlParams_.Set("requestId", requestId)
  35825. return c
  35826. }
  35827. // Fields allows partial responses to be retrieved. See
  35828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35829. // for more information.
  35830. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  35831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35832. return c
  35833. }
  35834. // Context sets the context to be used in this call's Do method. Any
  35835. // pending HTTP request will be aborted if the provided context is
  35836. // canceled.
  35837. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  35838. c.ctx_ = ctx
  35839. return c
  35840. }
  35841. // Header returns an http.Header that can be modified by the caller to
  35842. // add HTTP headers to the request.
  35843. func (c *ForwardingRulesInsertCall) Header() http.Header {
  35844. if c.header_ == nil {
  35845. c.header_ = make(http.Header)
  35846. }
  35847. return c.header_
  35848. }
  35849. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  35850. reqHeaders := make(http.Header)
  35851. for k, v := range c.header_ {
  35852. reqHeaders[k] = v
  35853. }
  35854. reqHeaders.Set("User-Agent", c.s.userAgent())
  35855. var body io.Reader = nil
  35856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  35857. if err != nil {
  35858. return nil, err
  35859. }
  35860. reqHeaders.Set("Content-Type", "application/json")
  35861. c.urlParams_.Set("alt", alt)
  35862. c.urlParams_.Set("prettyPrint", "false")
  35863. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  35864. urls += "?" + c.urlParams_.Encode()
  35865. req, err := http.NewRequest("POST", urls, body)
  35866. if err != nil {
  35867. return nil, err
  35868. }
  35869. req.Header = reqHeaders
  35870. googleapi.Expand(req.URL, map[string]string{
  35871. "project": c.project,
  35872. "region": c.region,
  35873. })
  35874. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35875. }
  35876. // Do executes the "compute.forwardingRules.insert" call.
  35877. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35878. // status code is an error. Response headers are in either
  35879. // *Operation.ServerResponse.Header or (if a response was returned at
  35880. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35881. // to check whether the returned error was because
  35882. // http.StatusNotModified was returned.
  35883. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35884. gensupport.SetOptions(c.urlParams_, opts...)
  35885. res, err := c.doRequest("json")
  35886. if res != nil && res.StatusCode == http.StatusNotModified {
  35887. if res.Body != nil {
  35888. res.Body.Close()
  35889. }
  35890. return nil, &googleapi.Error{
  35891. Code: res.StatusCode,
  35892. Header: res.Header,
  35893. }
  35894. }
  35895. if err != nil {
  35896. return nil, err
  35897. }
  35898. defer googleapi.CloseBody(res)
  35899. if err := googleapi.CheckResponse(res); err != nil {
  35900. return nil, err
  35901. }
  35902. ret := &Operation{
  35903. ServerResponse: googleapi.ServerResponse{
  35904. Header: res.Header,
  35905. HTTPStatusCode: res.StatusCode,
  35906. },
  35907. }
  35908. target := &ret
  35909. if err := gensupport.DecodeResponse(target, res); err != nil {
  35910. return nil, err
  35911. }
  35912. return ret, nil
  35913. // {
  35914. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  35915. // "httpMethod": "POST",
  35916. // "id": "compute.forwardingRules.insert",
  35917. // "parameterOrder": [
  35918. // "project",
  35919. // "region"
  35920. // ],
  35921. // "parameters": {
  35922. // "project": {
  35923. // "description": "Project ID for this request.",
  35924. // "location": "path",
  35925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35926. // "required": true,
  35927. // "type": "string"
  35928. // },
  35929. // "region": {
  35930. // "description": "Name of the region scoping this request.",
  35931. // "location": "path",
  35932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35933. // "required": true,
  35934. // "type": "string"
  35935. // },
  35936. // "requestId": {
  35937. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35938. // "location": "query",
  35939. // "type": "string"
  35940. // }
  35941. // },
  35942. // "path": "{project}/regions/{region}/forwardingRules",
  35943. // "request": {
  35944. // "$ref": "ForwardingRule"
  35945. // },
  35946. // "response": {
  35947. // "$ref": "Operation"
  35948. // },
  35949. // "scopes": [
  35950. // "https://www.googleapis.com/auth/cloud-platform",
  35951. // "https://www.googleapis.com/auth/compute"
  35952. // ]
  35953. // }
  35954. }
  35955. // method id "compute.forwardingRules.list":
  35956. type ForwardingRulesListCall struct {
  35957. s *Service
  35958. project string
  35959. region string
  35960. urlParams_ gensupport.URLParams
  35961. ifNoneMatch_ string
  35962. ctx_ context.Context
  35963. header_ http.Header
  35964. }
  35965. // List: Retrieves a list of ForwardingRule resources available to the
  35966. // specified project and region.
  35967. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  35968. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  35969. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35970. c.project = project
  35971. c.region = region
  35972. return c
  35973. }
  35974. // Filter sets the optional parameter "filter": A filter expression that
  35975. // filters resources listed in the response. The expression must specify
  35976. // the field name, a comparison operator, and the value that you want to
  35977. // use for filtering. The value must be a string, a number, or a
  35978. // boolean. The comparison operator must be either =, !=, >, or <.
  35979. //
  35980. // For example, if you are filtering Compute Engine instances, you can
  35981. // exclude instances named example-instance by specifying name !=
  35982. // example-instance.
  35983. //
  35984. // You can also filter nested fields. For example, you could specify
  35985. // scheduling.automaticRestart = false to include instances only if they
  35986. // are not scheduled for automatic restarts. You can use filtering on
  35987. // nested fields to filter based on resource labels.
  35988. //
  35989. // To filter on multiple expressions, provide each separate expression
  35990. // within parentheses. For example, (scheduling.automaticRestart = true)
  35991. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35992. // AND expression. However, you can include AND and OR expressions
  35993. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35994. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35995. // true).
  35996. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  35997. c.urlParams_.Set("filter", filter)
  35998. return c
  35999. }
  36000. // MaxResults sets the optional parameter "maxResults": The maximum
  36001. // number of results per page that should be returned. If the number of
  36002. // available results is larger than maxResults, Compute Engine returns a
  36003. // nextPageToken that can be used to get the next page of results in
  36004. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36005. // (Default: 500)
  36006. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  36007. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36008. return c
  36009. }
  36010. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36011. // a certain order. By default, results are returned in alphanumerical
  36012. // order based on the resource name.
  36013. //
  36014. // You can also sort results in descending order based on the creation
  36015. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36016. // based on the creationTimestamp field in reverse chronological order
  36017. // (newest result first). Use this to sort resources like operations so
  36018. // that the newest operation is returned first.
  36019. //
  36020. // Currently, only sorting by name or creationTimestamp desc is
  36021. // supported.
  36022. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  36023. c.urlParams_.Set("orderBy", orderBy)
  36024. return c
  36025. }
  36026. // PageToken sets the optional parameter "pageToken": Specifies a page
  36027. // token to use. Set pageToken to the nextPageToken returned by a
  36028. // previous list request to get the next page of results.
  36029. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  36030. c.urlParams_.Set("pageToken", pageToken)
  36031. return c
  36032. }
  36033. // Fields allows partial responses to be retrieved. See
  36034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36035. // for more information.
  36036. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  36037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36038. return c
  36039. }
  36040. // IfNoneMatch sets the optional parameter which makes the operation
  36041. // fail if the object's ETag matches the given value. This is useful for
  36042. // getting updates only after the object has changed since the last
  36043. // request. Use googleapi.IsNotModified to check whether the response
  36044. // error from Do is the result of In-None-Match.
  36045. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  36046. c.ifNoneMatch_ = entityTag
  36047. return c
  36048. }
  36049. // Context sets the context to be used in this call's Do method. Any
  36050. // pending HTTP request will be aborted if the provided context is
  36051. // canceled.
  36052. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  36053. c.ctx_ = ctx
  36054. return c
  36055. }
  36056. // Header returns an http.Header that can be modified by the caller to
  36057. // add HTTP headers to the request.
  36058. func (c *ForwardingRulesListCall) Header() http.Header {
  36059. if c.header_ == nil {
  36060. c.header_ = make(http.Header)
  36061. }
  36062. return c.header_
  36063. }
  36064. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  36065. reqHeaders := make(http.Header)
  36066. for k, v := range c.header_ {
  36067. reqHeaders[k] = v
  36068. }
  36069. reqHeaders.Set("User-Agent", c.s.userAgent())
  36070. if c.ifNoneMatch_ != "" {
  36071. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36072. }
  36073. var body io.Reader = nil
  36074. c.urlParams_.Set("alt", alt)
  36075. c.urlParams_.Set("prettyPrint", "false")
  36076. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  36077. urls += "?" + c.urlParams_.Encode()
  36078. req, err := http.NewRequest("GET", urls, body)
  36079. if err != nil {
  36080. return nil, err
  36081. }
  36082. req.Header = reqHeaders
  36083. googleapi.Expand(req.URL, map[string]string{
  36084. "project": c.project,
  36085. "region": c.region,
  36086. })
  36087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36088. }
  36089. // Do executes the "compute.forwardingRules.list" call.
  36090. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  36091. // non-2xx status code is an error. Response headers are in either
  36092. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  36093. // returned at all) in error.(*googleapi.Error).Header. Use
  36094. // googleapi.IsNotModified to check whether the returned error was
  36095. // because http.StatusNotModified was returned.
  36096. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  36097. gensupport.SetOptions(c.urlParams_, opts...)
  36098. res, err := c.doRequest("json")
  36099. if res != nil && res.StatusCode == http.StatusNotModified {
  36100. if res.Body != nil {
  36101. res.Body.Close()
  36102. }
  36103. return nil, &googleapi.Error{
  36104. Code: res.StatusCode,
  36105. Header: res.Header,
  36106. }
  36107. }
  36108. if err != nil {
  36109. return nil, err
  36110. }
  36111. defer googleapi.CloseBody(res)
  36112. if err := googleapi.CheckResponse(res); err != nil {
  36113. return nil, err
  36114. }
  36115. ret := &ForwardingRuleList{
  36116. ServerResponse: googleapi.ServerResponse{
  36117. Header: res.Header,
  36118. HTTPStatusCode: res.StatusCode,
  36119. },
  36120. }
  36121. target := &ret
  36122. if err := gensupport.DecodeResponse(target, res); err != nil {
  36123. return nil, err
  36124. }
  36125. return ret, nil
  36126. // {
  36127. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  36128. // "httpMethod": "GET",
  36129. // "id": "compute.forwardingRules.list",
  36130. // "parameterOrder": [
  36131. // "project",
  36132. // "region"
  36133. // ],
  36134. // "parameters": {
  36135. // "filter": {
  36136. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  36137. // "location": "query",
  36138. // "type": "string"
  36139. // },
  36140. // "maxResults": {
  36141. // "default": "500",
  36142. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  36143. // "format": "uint32",
  36144. // "location": "query",
  36145. // "minimum": "0",
  36146. // "type": "integer"
  36147. // },
  36148. // "orderBy": {
  36149. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  36150. // "location": "query",
  36151. // "type": "string"
  36152. // },
  36153. // "pageToken": {
  36154. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  36155. // "location": "query",
  36156. // "type": "string"
  36157. // },
  36158. // "project": {
  36159. // "description": "Project ID for this request.",
  36160. // "location": "path",
  36161. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36162. // "required": true,
  36163. // "type": "string"
  36164. // },
  36165. // "region": {
  36166. // "description": "Name of the region scoping this request.",
  36167. // "location": "path",
  36168. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36169. // "required": true,
  36170. // "type": "string"
  36171. // }
  36172. // },
  36173. // "path": "{project}/regions/{region}/forwardingRules",
  36174. // "response": {
  36175. // "$ref": "ForwardingRuleList"
  36176. // },
  36177. // "scopes": [
  36178. // "https://www.googleapis.com/auth/cloud-platform",
  36179. // "https://www.googleapis.com/auth/compute",
  36180. // "https://www.googleapis.com/auth/compute.readonly"
  36181. // ]
  36182. // }
  36183. }
  36184. // Pages invokes f for each page of results.
  36185. // A non-nil error returned from f will halt the iteration.
  36186. // The provided context supersedes any context provided to the Context method.
  36187. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  36188. c.ctx_ = ctx
  36189. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36190. for {
  36191. x, err := c.Do()
  36192. if err != nil {
  36193. return err
  36194. }
  36195. if err := f(x); err != nil {
  36196. return err
  36197. }
  36198. if x.NextPageToken == "" {
  36199. return nil
  36200. }
  36201. c.PageToken(x.NextPageToken)
  36202. }
  36203. }
  36204. // method id "compute.forwardingRules.setTarget":
  36205. type ForwardingRulesSetTargetCall struct {
  36206. s *Service
  36207. project string
  36208. region string
  36209. forwardingRule string
  36210. targetreference *TargetReference
  36211. urlParams_ gensupport.URLParams
  36212. ctx_ context.Context
  36213. header_ http.Header
  36214. }
  36215. // SetTarget: Changes target URL for forwarding rule. The new target
  36216. // should be of the same type as the old target.
  36217. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  36218. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  36219. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36220. c.project = project
  36221. c.region = region
  36222. c.forwardingRule = forwardingRule
  36223. c.targetreference = targetreference
  36224. return c
  36225. }
  36226. // RequestId sets the optional parameter "requestId": An optional
  36227. // request ID to identify requests. Specify a unique request ID so that
  36228. // if you must retry your request, the server will know to ignore the
  36229. // request if it has already been completed.
  36230. //
  36231. // For example, consider a situation where you make an initial request
  36232. // and the request times out. If you make the request again with the
  36233. // same request ID, the server can check if original operation with the
  36234. // same request ID was received, and if so, will ignore the second
  36235. // request. This prevents clients from accidentally creating duplicate
  36236. // commitments.
  36237. //
  36238. // The request ID must be a valid UUID with the exception that zero UUID
  36239. // is not supported (00000000-0000-0000-0000-000000000000).
  36240. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  36241. c.urlParams_.Set("requestId", requestId)
  36242. return c
  36243. }
  36244. // Fields allows partial responses to be retrieved. See
  36245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36246. // for more information.
  36247. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  36248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36249. return c
  36250. }
  36251. // Context sets the context to be used in this call's Do method. Any
  36252. // pending HTTP request will be aborted if the provided context is
  36253. // canceled.
  36254. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  36255. c.ctx_ = ctx
  36256. return c
  36257. }
  36258. // Header returns an http.Header that can be modified by the caller to
  36259. // add HTTP headers to the request.
  36260. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  36261. if c.header_ == nil {
  36262. c.header_ = make(http.Header)
  36263. }
  36264. return c.header_
  36265. }
  36266. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  36267. reqHeaders := make(http.Header)
  36268. for k, v := range c.header_ {
  36269. reqHeaders[k] = v
  36270. }
  36271. reqHeaders.Set("User-Agent", c.s.userAgent())
  36272. var body io.Reader = nil
  36273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  36274. if err != nil {
  36275. return nil, err
  36276. }
  36277. reqHeaders.Set("Content-Type", "application/json")
  36278. c.urlParams_.Set("alt", alt)
  36279. c.urlParams_.Set("prettyPrint", "false")
  36280. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  36281. urls += "?" + c.urlParams_.Encode()
  36282. req, err := http.NewRequest("POST", urls, body)
  36283. if err != nil {
  36284. return nil, err
  36285. }
  36286. req.Header = reqHeaders
  36287. googleapi.Expand(req.URL, map[string]string{
  36288. "project": c.project,
  36289. "region": c.region,
  36290. "forwardingRule": c.forwardingRule,
  36291. })
  36292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36293. }
  36294. // Do executes the "compute.forwardingRules.setTarget" call.
  36295. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36296. // status code is an error. Response headers are in either
  36297. // *Operation.ServerResponse.Header or (if a response was returned at
  36298. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36299. // to check whether the returned error was because
  36300. // http.StatusNotModified was returned.
  36301. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36302. gensupport.SetOptions(c.urlParams_, opts...)
  36303. res, err := c.doRequest("json")
  36304. if res != nil && res.StatusCode == http.StatusNotModified {
  36305. if res.Body != nil {
  36306. res.Body.Close()
  36307. }
  36308. return nil, &googleapi.Error{
  36309. Code: res.StatusCode,
  36310. Header: res.Header,
  36311. }
  36312. }
  36313. if err != nil {
  36314. return nil, err
  36315. }
  36316. defer googleapi.CloseBody(res)
  36317. if err := googleapi.CheckResponse(res); err != nil {
  36318. return nil, err
  36319. }
  36320. ret := &Operation{
  36321. ServerResponse: googleapi.ServerResponse{
  36322. Header: res.Header,
  36323. HTTPStatusCode: res.StatusCode,
  36324. },
  36325. }
  36326. target := &ret
  36327. if err := gensupport.DecodeResponse(target, res); err != nil {
  36328. return nil, err
  36329. }
  36330. return ret, nil
  36331. // {
  36332. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  36333. // "httpMethod": "POST",
  36334. // "id": "compute.forwardingRules.setTarget",
  36335. // "parameterOrder": [
  36336. // "project",
  36337. // "region",
  36338. // "forwardingRule"
  36339. // ],
  36340. // "parameters": {
  36341. // "forwardingRule": {
  36342. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  36343. // "location": "path",
  36344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36345. // "required": true,
  36346. // "type": "string"
  36347. // },
  36348. // "project": {
  36349. // "description": "Project ID for this request.",
  36350. // "location": "path",
  36351. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36352. // "required": true,
  36353. // "type": "string"
  36354. // },
  36355. // "region": {
  36356. // "description": "Name of the region scoping this request.",
  36357. // "location": "path",
  36358. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36359. // "required": true,
  36360. // "type": "string"
  36361. // },
  36362. // "requestId": {
  36363. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36364. // "location": "query",
  36365. // "type": "string"
  36366. // }
  36367. // },
  36368. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  36369. // "request": {
  36370. // "$ref": "TargetReference"
  36371. // },
  36372. // "response": {
  36373. // "$ref": "Operation"
  36374. // },
  36375. // "scopes": [
  36376. // "https://www.googleapis.com/auth/cloud-platform",
  36377. // "https://www.googleapis.com/auth/compute"
  36378. // ]
  36379. // }
  36380. }
  36381. // method id "compute.globalAddresses.delete":
  36382. type GlobalAddressesDeleteCall struct {
  36383. s *Service
  36384. project string
  36385. address string
  36386. urlParams_ gensupport.URLParams
  36387. ctx_ context.Context
  36388. header_ http.Header
  36389. }
  36390. // Delete: Deletes the specified address resource.
  36391. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  36392. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  36393. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36394. c.project = project
  36395. c.address = address
  36396. return c
  36397. }
  36398. // RequestId sets the optional parameter "requestId": An optional
  36399. // request ID to identify requests. Specify a unique request ID so that
  36400. // if you must retry your request, the server will know to ignore the
  36401. // request if it has already been completed.
  36402. //
  36403. // For example, consider a situation where you make an initial request
  36404. // and the request times out. If you make the request again with the
  36405. // same request ID, the server can check if original operation with the
  36406. // same request ID was received, and if so, will ignore the second
  36407. // request. This prevents clients from accidentally creating duplicate
  36408. // commitments.
  36409. //
  36410. // The request ID must be a valid UUID with the exception that zero UUID
  36411. // is not supported (00000000-0000-0000-0000-000000000000).
  36412. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  36413. c.urlParams_.Set("requestId", requestId)
  36414. return c
  36415. }
  36416. // Fields allows partial responses to be retrieved. See
  36417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36418. // for more information.
  36419. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  36420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36421. return c
  36422. }
  36423. // Context sets the context to be used in this call's Do method. Any
  36424. // pending HTTP request will be aborted if the provided context is
  36425. // canceled.
  36426. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  36427. c.ctx_ = ctx
  36428. return c
  36429. }
  36430. // Header returns an http.Header that can be modified by the caller to
  36431. // add HTTP headers to the request.
  36432. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  36433. if c.header_ == nil {
  36434. c.header_ = make(http.Header)
  36435. }
  36436. return c.header_
  36437. }
  36438. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  36439. reqHeaders := make(http.Header)
  36440. for k, v := range c.header_ {
  36441. reqHeaders[k] = v
  36442. }
  36443. reqHeaders.Set("User-Agent", c.s.userAgent())
  36444. var body io.Reader = nil
  36445. c.urlParams_.Set("alt", alt)
  36446. c.urlParams_.Set("prettyPrint", "false")
  36447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  36448. urls += "?" + c.urlParams_.Encode()
  36449. req, err := http.NewRequest("DELETE", urls, body)
  36450. if err != nil {
  36451. return nil, err
  36452. }
  36453. req.Header = reqHeaders
  36454. googleapi.Expand(req.URL, map[string]string{
  36455. "project": c.project,
  36456. "address": c.address,
  36457. })
  36458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36459. }
  36460. // Do executes the "compute.globalAddresses.delete" call.
  36461. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36462. // status code is an error. Response headers are in either
  36463. // *Operation.ServerResponse.Header or (if a response was returned at
  36464. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36465. // to check whether the returned error was because
  36466. // http.StatusNotModified was returned.
  36467. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36468. gensupport.SetOptions(c.urlParams_, opts...)
  36469. res, err := c.doRequest("json")
  36470. if res != nil && res.StatusCode == http.StatusNotModified {
  36471. if res.Body != nil {
  36472. res.Body.Close()
  36473. }
  36474. return nil, &googleapi.Error{
  36475. Code: res.StatusCode,
  36476. Header: res.Header,
  36477. }
  36478. }
  36479. if err != nil {
  36480. return nil, err
  36481. }
  36482. defer googleapi.CloseBody(res)
  36483. if err := googleapi.CheckResponse(res); err != nil {
  36484. return nil, err
  36485. }
  36486. ret := &Operation{
  36487. ServerResponse: googleapi.ServerResponse{
  36488. Header: res.Header,
  36489. HTTPStatusCode: res.StatusCode,
  36490. },
  36491. }
  36492. target := &ret
  36493. if err := gensupport.DecodeResponse(target, res); err != nil {
  36494. return nil, err
  36495. }
  36496. return ret, nil
  36497. // {
  36498. // "description": "Deletes the specified address resource.",
  36499. // "httpMethod": "DELETE",
  36500. // "id": "compute.globalAddresses.delete",
  36501. // "parameterOrder": [
  36502. // "project",
  36503. // "address"
  36504. // ],
  36505. // "parameters": {
  36506. // "address": {
  36507. // "description": "Name of the address resource to delete.",
  36508. // "location": "path",
  36509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36510. // "required": true,
  36511. // "type": "string"
  36512. // },
  36513. // "project": {
  36514. // "description": "Project ID for this request.",
  36515. // "location": "path",
  36516. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36517. // "required": true,
  36518. // "type": "string"
  36519. // },
  36520. // "requestId": {
  36521. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36522. // "location": "query",
  36523. // "type": "string"
  36524. // }
  36525. // },
  36526. // "path": "{project}/global/addresses/{address}",
  36527. // "response": {
  36528. // "$ref": "Operation"
  36529. // },
  36530. // "scopes": [
  36531. // "https://www.googleapis.com/auth/cloud-platform",
  36532. // "https://www.googleapis.com/auth/compute"
  36533. // ]
  36534. // }
  36535. }
  36536. // method id "compute.globalAddresses.get":
  36537. type GlobalAddressesGetCall struct {
  36538. s *Service
  36539. project string
  36540. address string
  36541. urlParams_ gensupport.URLParams
  36542. ifNoneMatch_ string
  36543. ctx_ context.Context
  36544. header_ http.Header
  36545. }
  36546. // Get: Returns the specified address resource. Gets a list of available
  36547. // addresses by making a list() request.
  36548. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  36549. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  36550. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36551. c.project = project
  36552. c.address = address
  36553. return c
  36554. }
  36555. // Fields allows partial responses to be retrieved. See
  36556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36557. // for more information.
  36558. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  36559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36560. return c
  36561. }
  36562. // IfNoneMatch sets the optional parameter which makes the operation
  36563. // fail if the object's ETag matches the given value. This is useful for
  36564. // getting updates only after the object has changed since the last
  36565. // request. Use googleapi.IsNotModified to check whether the response
  36566. // error from Do is the result of In-None-Match.
  36567. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  36568. c.ifNoneMatch_ = entityTag
  36569. return c
  36570. }
  36571. // Context sets the context to be used in this call's Do method. Any
  36572. // pending HTTP request will be aborted if the provided context is
  36573. // canceled.
  36574. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  36575. c.ctx_ = ctx
  36576. return c
  36577. }
  36578. // Header returns an http.Header that can be modified by the caller to
  36579. // add HTTP headers to the request.
  36580. func (c *GlobalAddressesGetCall) Header() http.Header {
  36581. if c.header_ == nil {
  36582. c.header_ = make(http.Header)
  36583. }
  36584. return c.header_
  36585. }
  36586. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  36587. reqHeaders := make(http.Header)
  36588. for k, v := range c.header_ {
  36589. reqHeaders[k] = v
  36590. }
  36591. reqHeaders.Set("User-Agent", c.s.userAgent())
  36592. if c.ifNoneMatch_ != "" {
  36593. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36594. }
  36595. var body io.Reader = nil
  36596. c.urlParams_.Set("alt", alt)
  36597. c.urlParams_.Set("prettyPrint", "false")
  36598. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  36599. urls += "?" + c.urlParams_.Encode()
  36600. req, err := http.NewRequest("GET", urls, body)
  36601. if err != nil {
  36602. return nil, err
  36603. }
  36604. req.Header = reqHeaders
  36605. googleapi.Expand(req.URL, map[string]string{
  36606. "project": c.project,
  36607. "address": c.address,
  36608. })
  36609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36610. }
  36611. // Do executes the "compute.globalAddresses.get" call.
  36612. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  36613. // code is an error. Response headers are in either
  36614. // *Address.ServerResponse.Header or (if a response was returned at all)
  36615. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36616. // check whether the returned error was because http.StatusNotModified
  36617. // was returned.
  36618. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  36619. gensupport.SetOptions(c.urlParams_, opts...)
  36620. res, err := c.doRequest("json")
  36621. if res != nil && res.StatusCode == http.StatusNotModified {
  36622. if res.Body != nil {
  36623. res.Body.Close()
  36624. }
  36625. return nil, &googleapi.Error{
  36626. Code: res.StatusCode,
  36627. Header: res.Header,
  36628. }
  36629. }
  36630. if err != nil {
  36631. return nil, err
  36632. }
  36633. defer googleapi.CloseBody(res)
  36634. if err := googleapi.CheckResponse(res); err != nil {
  36635. return nil, err
  36636. }
  36637. ret := &Address{
  36638. ServerResponse: googleapi.ServerResponse{
  36639. Header: res.Header,
  36640. HTTPStatusCode: res.StatusCode,
  36641. },
  36642. }
  36643. target := &ret
  36644. if err := gensupport.DecodeResponse(target, res); err != nil {
  36645. return nil, err
  36646. }
  36647. return ret, nil
  36648. // {
  36649. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  36650. // "httpMethod": "GET",
  36651. // "id": "compute.globalAddresses.get",
  36652. // "parameterOrder": [
  36653. // "project",
  36654. // "address"
  36655. // ],
  36656. // "parameters": {
  36657. // "address": {
  36658. // "description": "Name of the address resource to return.",
  36659. // "location": "path",
  36660. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36661. // "required": true,
  36662. // "type": "string"
  36663. // },
  36664. // "project": {
  36665. // "description": "Project ID for this request.",
  36666. // "location": "path",
  36667. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36668. // "required": true,
  36669. // "type": "string"
  36670. // }
  36671. // },
  36672. // "path": "{project}/global/addresses/{address}",
  36673. // "response": {
  36674. // "$ref": "Address"
  36675. // },
  36676. // "scopes": [
  36677. // "https://www.googleapis.com/auth/cloud-platform",
  36678. // "https://www.googleapis.com/auth/compute",
  36679. // "https://www.googleapis.com/auth/compute.readonly"
  36680. // ]
  36681. // }
  36682. }
  36683. // method id "compute.globalAddresses.insert":
  36684. type GlobalAddressesInsertCall struct {
  36685. s *Service
  36686. project string
  36687. address *Address
  36688. urlParams_ gensupport.URLParams
  36689. ctx_ context.Context
  36690. header_ http.Header
  36691. }
  36692. // Insert: Creates an address resource in the specified project using
  36693. // the data included in the request.
  36694. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  36695. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  36696. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36697. c.project = project
  36698. c.address = address
  36699. return c
  36700. }
  36701. // RequestId sets the optional parameter "requestId": An optional
  36702. // request ID to identify requests. Specify a unique request ID so that
  36703. // if you must retry your request, the server will know to ignore the
  36704. // request if it has already been completed.
  36705. //
  36706. // For example, consider a situation where you make an initial request
  36707. // and the request times out. If you make the request again with the
  36708. // same request ID, the server can check if original operation with the
  36709. // same request ID was received, and if so, will ignore the second
  36710. // request. This prevents clients from accidentally creating duplicate
  36711. // commitments.
  36712. //
  36713. // The request ID must be a valid UUID with the exception that zero UUID
  36714. // is not supported (00000000-0000-0000-0000-000000000000).
  36715. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  36716. c.urlParams_.Set("requestId", requestId)
  36717. return c
  36718. }
  36719. // Fields allows partial responses to be retrieved. See
  36720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36721. // for more information.
  36722. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  36723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36724. return c
  36725. }
  36726. // Context sets the context to be used in this call's Do method. Any
  36727. // pending HTTP request will be aborted if the provided context is
  36728. // canceled.
  36729. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  36730. c.ctx_ = ctx
  36731. return c
  36732. }
  36733. // Header returns an http.Header that can be modified by the caller to
  36734. // add HTTP headers to the request.
  36735. func (c *GlobalAddressesInsertCall) Header() http.Header {
  36736. if c.header_ == nil {
  36737. c.header_ = make(http.Header)
  36738. }
  36739. return c.header_
  36740. }
  36741. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  36742. reqHeaders := make(http.Header)
  36743. for k, v := range c.header_ {
  36744. reqHeaders[k] = v
  36745. }
  36746. reqHeaders.Set("User-Agent", c.s.userAgent())
  36747. var body io.Reader = nil
  36748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  36749. if err != nil {
  36750. return nil, err
  36751. }
  36752. reqHeaders.Set("Content-Type", "application/json")
  36753. c.urlParams_.Set("alt", alt)
  36754. c.urlParams_.Set("prettyPrint", "false")
  36755. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  36756. urls += "?" + c.urlParams_.Encode()
  36757. req, err := http.NewRequest("POST", urls, body)
  36758. if err != nil {
  36759. return nil, err
  36760. }
  36761. req.Header = reqHeaders
  36762. googleapi.Expand(req.URL, map[string]string{
  36763. "project": c.project,
  36764. })
  36765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36766. }
  36767. // Do executes the "compute.globalAddresses.insert" call.
  36768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36769. // status code is an error. Response headers are in either
  36770. // *Operation.ServerResponse.Header or (if a response was returned at
  36771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36772. // to check whether the returned error was because
  36773. // http.StatusNotModified was returned.
  36774. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36775. gensupport.SetOptions(c.urlParams_, opts...)
  36776. res, err := c.doRequest("json")
  36777. if res != nil && res.StatusCode == http.StatusNotModified {
  36778. if res.Body != nil {
  36779. res.Body.Close()
  36780. }
  36781. return nil, &googleapi.Error{
  36782. Code: res.StatusCode,
  36783. Header: res.Header,
  36784. }
  36785. }
  36786. if err != nil {
  36787. return nil, err
  36788. }
  36789. defer googleapi.CloseBody(res)
  36790. if err := googleapi.CheckResponse(res); err != nil {
  36791. return nil, err
  36792. }
  36793. ret := &Operation{
  36794. ServerResponse: googleapi.ServerResponse{
  36795. Header: res.Header,
  36796. HTTPStatusCode: res.StatusCode,
  36797. },
  36798. }
  36799. target := &ret
  36800. if err := gensupport.DecodeResponse(target, res); err != nil {
  36801. return nil, err
  36802. }
  36803. return ret, nil
  36804. // {
  36805. // "description": "Creates an address resource in the specified project using the data included in the request.",
  36806. // "httpMethod": "POST",
  36807. // "id": "compute.globalAddresses.insert",
  36808. // "parameterOrder": [
  36809. // "project"
  36810. // ],
  36811. // "parameters": {
  36812. // "project": {
  36813. // "description": "Project ID for this request.",
  36814. // "location": "path",
  36815. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36816. // "required": true,
  36817. // "type": "string"
  36818. // },
  36819. // "requestId": {
  36820. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36821. // "location": "query",
  36822. // "type": "string"
  36823. // }
  36824. // },
  36825. // "path": "{project}/global/addresses",
  36826. // "request": {
  36827. // "$ref": "Address"
  36828. // },
  36829. // "response": {
  36830. // "$ref": "Operation"
  36831. // },
  36832. // "scopes": [
  36833. // "https://www.googleapis.com/auth/cloud-platform",
  36834. // "https://www.googleapis.com/auth/compute"
  36835. // ]
  36836. // }
  36837. }
  36838. // method id "compute.globalAddresses.list":
  36839. type GlobalAddressesListCall struct {
  36840. s *Service
  36841. project string
  36842. urlParams_ gensupport.URLParams
  36843. ifNoneMatch_ string
  36844. ctx_ context.Context
  36845. header_ http.Header
  36846. }
  36847. // List: Retrieves a list of global addresses.
  36848. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  36849. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  36850. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36851. c.project = project
  36852. return c
  36853. }
  36854. // Filter sets the optional parameter "filter": A filter expression that
  36855. // filters resources listed in the response. The expression must specify
  36856. // the field name, a comparison operator, and the value that you want to
  36857. // use for filtering. The value must be a string, a number, or a
  36858. // boolean. The comparison operator must be either =, !=, >, or <.
  36859. //
  36860. // For example, if you are filtering Compute Engine instances, you can
  36861. // exclude instances named example-instance by specifying name !=
  36862. // example-instance.
  36863. //
  36864. // You can also filter nested fields. For example, you could specify
  36865. // scheduling.automaticRestart = false to include instances only if they
  36866. // are not scheduled for automatic restarts. You can use filtering on
  36867. // nested fields to filter based on resource labels.
  36868. //
  36869. // To filter on multiple expressions, provide each separate expression
  36870. // within parentheses. For example, (scheduling.automaticRestart = true)
  36871. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36872. // AND expression. However, you can include AND and OR expressions
  36873. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36874. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36875. // true).
  36876. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  36877. c.urlParams_.Set("filter", filter)
  36878. return c
  36879. }
  36880. // MaxResults sets the optional parameter "maxResults": The maximum
  36881. // number of results per page that should be returned. If the number of
  36882. // available results is larger than maxResults, Compute Engine returns a
  36883. // nextPageToken that can be used to get the next page of results in
  36884. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36885. // (Default: 500)
  36886. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  36887. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36888. return c
  36889. }
  36890. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36891. // a certain order. By default, results are returned in alphanumerical
  36892. // order based on the resource name.
  36893. //
  36894. // You can also sort results in descending order based on the creation
  36895. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36896. // based on the creationTimestamp field in reverse chronological order
  36897. // (newest result first). Use this to sort resources like operations so
  36898. // that the newest operation is returned first.
  36899. //
  36900. // Currently, only sorting by name or creationTimestamp desc is
  36901. // supported.
  36902. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  36903. c.urlParams_.Set("orderBy", orderBy)
  36904. return c
  36905. }
  36906. // PageToken sets the optional parameter "pageToken": Specifies a page
  36907. // token to use. Set pageToken to the nextPageToken returned by a
  36908. // previous list request to get the next page of results.
  36909. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  36910. c.urlParams_.Set("pageToken", pageToken)
  36911. return c
  36912. }
  36913. // Fields allows partial responses to be retrieved. See
  36914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36915. // for more information.
  36916. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  36917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36918. return c
  36919. }
  36920. // IfNoneMatch sets the optional parameter which makes the operation
  36921. // fail if the object's ETag matches the given value. This is useful for
  36922. // getting updates only after the object has changed since the last
  36923. // request. Use googleapi.IsNotModified to check whether the response
  36924. // error from Do is the result of In-None-Match.
  36925. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  36926. c.ifNoneMatch_ = entityTag
  36927. return c
  36928. }
  36929. // Context sets the context to be used in this call's Do method. Any
  36930. // pending HTTP request will be aborted if the provided context is
  36931. // canceled.
  36932. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  36933. c.ctx_ = ctx
  36934. return c
  36935. }
  36936. // Header returns an http.Header that can be modified by the caller to
  36937. // add HTTP headers to the request.
  36938. func (c *GlobalAddressesListCall) Header() http.Header {
  36939. if c.header_ == nil {
  36940. c.header_ = make(http.Header)
  36941. }
  36942. return c.header_
  36943. }
  36944. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  36945. reqHeaders := make(http.Header)
  36946. for k, v := range c.header_ {
  36947. reqHeaders[k] = v
  36948. }
  36949. reqHeaders.Set("User-Agent", c.s.userAgent())
  36950. if c.ifNoneMatch_ != "" {
  36951. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36952. }
  36953. var body io.Reader = nil
  36954. c.urlParams_.Set("alt", alt)
  36955. c.urlParams_.Set("prettyPrint", "false")
  36956. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  36957. urls += "?" + c.urlParams_.Encode()
  36958. req, err := http.NewRequest("GET", urls, body)
  36959. if err != nil {
  36960. return nil, err
  36961. }
  36962. req.Header = reqHeaders
  36963. googleapi.Expand(req.URL, map[string]string{
  36964. "project": c.project,
  36965. })
  36966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36967. }
  36968. // Do executes the "compute.globalAddresses.list" call.
  36969. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  36970. // status code is an error. Response headers are in either
  36971. // *AddressList.ServerResponse.Header or (if a response was returned at
  36972. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36973. // to check whether the returned error was because
  36974. // http.StatusNotModified was returned.
  36975. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  36976. gensupport.SetOptions(c.urlParams_, opts...)
  36977. res, err := c.doRequest("json")
  36978. if res != nil && res.StatusCode == http.StatusNotModified {
  36979. if res.Body != nil {
  36980. res.Body.Close()
  36981. }
  36982. return nil, &googleapi.Error{
  36983. Code: res.StatusCode,
  36984. Header: res.Header,
  36985. }
  36986. }
  36987. if err != nil {
  36988. return nil, err
  36989. }
  36990. defer googleapi.CloseBody(res)
  36991. if err := googleapi.CheckResponse(res); err != nil {
  36992. return nil, err
  36993. }
  36994. ret := &AddressList{
  36995. ServerResponse: googleapi.ServerResponse{
  36996. Header: res.Header,
  36997. HTTPStatusCode: res.StatusCode,
  36998. },
  36999. }
  37000. target := &ret
  37001. if err := gensupport.DecodeResponse(target, res); err != nil {
  37002. return nil, err
  37003. }
  37004. return ret, nil
  37005. // {
  37006. // "description": "Retrieves a list of global addresses.",
  37007. // "httpMethod": "GET",
  37008. // "id": "compute.globalAddresses.list",
  37009. // "parameterOrder": [
  37010. // "project"
  37011. // ],
  37012. // "parameters": {
  37013. // "filter": {
  37014. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  37015. // "location": "query",
  37016. // "type": "string"
  37017. // },
  37018. // "maxResults": {
  37019. // "default": "500",
  37020. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37021. // "format": "uint32",
  37022. // "location": "query",
  37023. // "minimum": "0",
  37024. // "type": "integer"
  37025. // },
  37026. // "orderBy": {
  37027. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37028. // "location": "query",
  37029. // "type": "string"
  37030. // },
  37031. // "pageToken": {
  37032. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37033. // "location": "query",
  37034. // "type": "string"
  37035. // },
  37036. // "project": {
  37037. // "description": "Project ID for this request.",
  37038. // "location": "path",
  37039. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37040. // "required": true,
  37041. // "type": "string"
  37042. // }
  37043. // },
  37044. // "path": "{project}/global/addresses",
  37045. // "response": {
  37046. // "$ref": "AddressList"
  37047. // },
  37048. // "scopes": [
  37049. // "https://www.googleapis.com/auth/cloud-platform",
  37050. // "https://www.googleapis.com/auth/compute",
  37051. // "https://www.googleapis.com/auth/compute.readonly"
  37052. // ]
  37053. // }
  37054. }
  37055. // Pages invokes f for each page of results.
  37056. // A non-nil error returned from f will halt the iteration.
  37057. // The provided context supersedes any context provided to the Context method.
  37058. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  37059. c.ctx_ = ctx
  37060. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37061. for {
  37062. x, err := c.Do()
  37063. if err != nil {
  37064. return err
  37065. }
  37066. if err := f(x); err != nil {
  37067. return err
  37068. }
  37069. if x.NextPageToken == "" {
  37070. return nil
  37071. }
  37072. c.PageToken(x.NextPageToken)
  37073. }
  37074. }
  37075. // method id "compute.globalForwardingRules.delete":
  37076. type GlobalForwardingRulesDeleteCall struct {
  37077. s *Service
  37078. project string
  37079. forwardingRule string
  37080. urlParams_ gensupport.URLParams
  37081. ctx_ context.Context
  37082. header_ http.Header
  37083. }
  37084. // Delete: Deletes the specified GlobalForwardingRule resource.
  37085. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  37086. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  37087. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37088. c.project = project
  37089. c.forwardingRule = forwardingRule
  37090. return c
  37091. }
  37092. // RequestId sets the optional parameter "requestId": An optional
  37093. // request ID to identify requests. Specify a unique request ID so that
  37094. // if you must retry your request, the server will know to ignore the
  37095. // request if it has already been completed.
  37096. //
  37097. // For example, consider a situation where you make an initial request
  37098. // and the request times out. If you make the request again with the
  37099. // same request ID, the server can check if original operation with the
  37100. // same request ID was received, and if so, will ignore the second
  37101. // request. This prevents clients from accidentally creating duplicate
  37102. // commitments.
  37103. //
  37104. // The request ID must be a valid UUID with the exception that zero UUID
  37105. // is not supported (00000000-0000-0000-0000-000000000000).
  37106. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  37107. c.urlParams_.Set("requestId", requestId)
  37108. return c
  37109. }
  37110. // Fields allows partial responses to be retrieved. See
  37111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37112. // for more information.
  37113. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  37114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37115. return c
  37116. }
  37117. // Context sets the context to be used in this call's Do method. Any
  37118. // pending HTTP request will be aborted if the provided context is
  37119. // canceled.
  37120. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  37121. c.ctx_ = ctx
  37122. return c
  37123. }
  37124. // Header returns an http.Header that can be modified by the caller to
  37125. // add HTTP headers to the request.
  37126. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  37127. if c.header_ == nil {
  37128. c.header_ = make(http.Header)
  37129. }
  37130. return c.header_
  37131. }
  37132. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  37133. reqHeaders := make(http.Header)
  37134. for k, v := range c.header_ {
  37135. reqHeaders[k] = v
  37136. }
  37137. reqHeaders.Set("User-Agent", c.s.userAgent())
  37138. var body io.Reader = nil
  37139. c.urlParams_.Set("alt", alt)
  37140. c.urlParams_.Set("prettyPrint", "false")
  37141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  37142. urls += "?" + c.urlParams_.Encode()
  37143. req, err := http.NewRequest("DELETE", urls, body)
  37144. if err != nil {
  37145. return nil, err
  37146. }
  37147. req.Header = reqHeaders
  37148. googleapi.Expand(req.URL, map[string]string{
  37149. "project": c.project,
  37150. "forwardingRule": c.forwardingRule,
  37151. })
  37152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37153. }
  37154. // Do executes the "compute.globalForwardingRules.delete" call.
  37155. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37156. // status code is an error. Response headers are in either
  37157. // *Operation.ServerResponse.Header or (if a response was returned at
  37158. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37159. // to check whether the returned error was because
  37160. // http.StatusNotModified was returned.
  37161. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37162. gensupport.SetOptions(c.urlParams_, opts...)
  37163. res, err := c.doRequest("json")
  37164. if res != nil && res.StatusCode == http.StatusNotModified {
  37165. if res.Body != nil {
  37166. res.Body.Close()
  37167. }
  37168. return nil, &googleapi.Error{
  37169. Code: res.StatusCode,
  37170. Header: res.Header,
  37171. }
  37172. }
  37173. if err != nil {
  37174. return nil, err
  37175. }
  37176. defer googleapi.CloseBody(res)
  37177. if err := googleapi.CheckResponse(res); err != nil {
  37178. return nil, err
  37179. }
  37180. ret := &Operation{
  37181. ServerResponse: googleapi.ServerResponse{
  37182. Header: res.Header,
  37183. HTTPStatusCode: res.StatusCode,
  37184. },
  37185. }
  37186. target := &ret
  37187. if err := gensupport.DecodeResponse(target, res); err != nil {
  37188. return nil, err
  37189. }
  37190. return ret, nil
  37191. // {
  37192. // "description": "Deletes the specified GlobalForwardingRule resource.",
  37193. // "httpMethod": "DELETE",
  37194. // "id": "compute.globalForwardingRules.delete",
  37195. // "parameterOrder": [
  37196. // "project",
  37197. // "forwardingRule"
  37198. // ],
  37199. // "parameters": {
  37200. // "forwardingRule": {
  37201. // "description": "Name of the ForwardingRule resource to delete.",
  37202. // "location": "path",
  37203. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37204. // "required": true,
  37205. // "type": "string"
  37206. // },
  37207. // "project": {
  37208. // "description": "Project ID for this request.",
  37209. // "location": "path",
  37210. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37211. // "required": true,
  37212. // "type": "string"
  37213. // },
  37214. // "requestId": {
  37215. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37216. // "location": "query",
  37217. // "type": "string"
  37218. // }
  37219. // },
  37220. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  37221. // "response": {
  37222. // "$ref": "Operation"
  37223. // },
  37224. // "scopes": [
  37225. // "https://www.googleapis.com/auth/cloud-platform",
  37226. // "https://www.googleapis.com/auth/compute"
  37227. // ]
  37228. // }
  37229. }
  37230. // method id "compute.globalForwardingRules.get":
  37231. type GlobalForwardingRulesGetCall struct {
  37232. s *Service
  37233. project string
  37234. forwardingRule string
  37235. urlParams_ gensupport.URLParams
  37236. ifNoneMatch_ string
  37237. ctx_ context.Context
  37238. header_ http.Header
  37239. }
  37240. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  37241. // of available forwarding rules by making a list() request.
  37242. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  37243. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  37244. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37245. c.project = project
  37246. c.forwardingRule = forwardingRule
  37247. return c
  37248. }
  37249. // Fields allows partial responses to be retrieved. See
  37250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37251. // for more information.
  37252. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  37253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37254. return c
  37255. }
  37256. // IfNoneMatch sets the optional parameter which makes the operation
  37257. // fail if the object's ETag matches the given value. This is useful for
  37258. // getting updates only after the object has changed since the last
  37259. // request. Use googleapi.IsNotModified to check whether the response
  37260. // error from Do is the result of In-None-Match.
  37261. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  37262. c.ifNoneMatch_ = entityTag
  37263. return c
  37264. }
  37265. // Context sets the context to be used in this call's Do method. Any
  37266. // pending HTTP request will be aborted if the provided context is
  37267. // canceled.
  37268. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  37269. c.ctx_ = ctx
  37270. return c
  37271. }
  37272. // Header returns an http.Header that can be modified by the caller to
  37273. // add HTTP headers to the request.
  37274. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  37275. if c.header_ == nil {
  37276. c.header_ = make(http.Header)
  37277. }
  37278. return c.header_
  37279. }
  37280. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  37281. reqHeaders := make(http.Header)
  37282. for k, v := range c.header_ {
  37283. reqHeaders[k] = v
  37284. }
  37285. reqHeaders.Set("User-Agent", c.s.userAgent())
  37286. if c.ifNoneMatch_ != "" {
  37287. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37288. }
  37289. var body io.Reader = nil
  37290. c.urlParams_.Set("alt", alt)
  37291. c.urlParams_.Set("prettyPrint", "false")
  37292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  37293. urls += "?" + c.urlParams_.Encode()
  37294. req, err := http.NewRequest("GET", urls, body)
  37295. if err != nil {
  37296. return nil, err
  37297. }
  37298. req.Header = reqHeaders
  37299. googleapi.Expand(req.URL, map[string]string{
  37300. "project": c.project,
  37301. "forwardingRule": c.forwardingRule,
  37302. })
  37303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37304. }
  37305. // Do executes the "compute.globalForwardingRules.get" call.
  37306. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  37307. // status code is an error. Response headers are in either
  37308. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  37309. // at all) in error.(*googleapi.Error).Header. Use
  37310. // googleapi.IsNotModified to check whether the returned error was
  37311. // because http.StatusNotModified was returned.
  37312. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  37313. gensupport.SetOptions(c.urlParams_, opts...)
  37314. res, err := c.doRequest("json")
  37315. if res != nil && res.StatusCode == http.StatusNotModified {
  37316. if res.Body != nil {
  37317. res.Body.Close()
  37318. }
  37319. return nil, &googleapi.Error{
  37320. Code: res.StatusCode,
  37321. Header: res.Header,
  37322. }
  37323. }
  37324. if err != nil {
  37325. return nil, err
  37326. }
  37327. defer googleapi.CloseBody(res)
  37328. if err := googleapi.CheckResponse(res); err != nil {
  37329. return nil, err
  37330. }
  37331. ret := &ForwardingRule{
  37332. ServerResponse: googleapi.ServerResponse{
  37333. Header: res.Header,
  37334. HTTPStatusCode: res.StatusCode,
  37335. },
  37336. }
  37337. target := &ret
  37338. if err := gensupport.DecodeResponse(target, res); err != nil {
  37339. return nil, err
  37340. }
  37341. return ret, nil
  37342. // {
  37343. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  37344. // "httpMethod": "GET",
  37345. // "id": "compute.globalForwardingRules.get",
  37346. // "parameterOrder": [
  37347. // "project",
  37348. // "forwardingRule"
  37349. // ],
  37350. // "parameters": {
  37351. // "forwardingRule": {
  37352. // "description": "Name of the ForwardingRule resource to return.",
  37353. // "location": "path",
  37354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37355. // "required": true,
  37356. // "type": "string"
  37357. // },
  37358. // "project": {
  37359. // "description": "Project ID for this request.",
  37360. // "location": "path",
  37361. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37362. // "required": true,
  37363. // "type": "string"
  37364. // }
  37365. // },
  37366. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  37367. // "response": {
  37368. // "$ref": "ForwardingRule"
  37369. // },
  37370. // "scopes": [
  37371. // "https://www.googleapis.com/auth/cloud-platform",
  37372. // "https://www.googleapis.com/auth/compute",
  37373. // "https://www.googleapis.com/auth/compute.readonly"
  37374. // ]
  37375. // }
  37376. }
  37377. // method id "compute.globalForwardingRules.insert":
  37378. type GlobalForwardingRulesInsertCall struct {
  37379. s *Service
  37380. project string
  37381. forwardingrule *ForwardingRule
  37382. urlParams_ gensupport.URLParams
  37383. ctx_ context.Context
  37384. header_ http.Header
  37385. }
  37386. // Insert: Creates a GlobalForwardingRule resource in the specified
  37387. // project using the data included in the request.
  37388. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  37389. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  37390. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37391. c.project = project
  37392. c.forwardingrule = forwardingrule
  37393. return c
  37394. }
  37395. // RequestId sets the optional parameter "requestId": An optional
  37396. // request ID to identify requests. Specify a unique request ID so that
  37397. // if you must retry your request, the server will know to ignore the
  37398. // request if it has already been completed.
  37399. //
  37400. // For example, consider a situation where you make an initial request
  37401. // and the request times out. If you make the request again with the
  37402. // same request ID, the server can check if original operation with the
  37403. // same request ID was received, and if so, will ignore the second
  37404. // request. This prevents clients from accidentally creating duplicate
  37405. // commitments.
  37406. //
  37407. // The request ID must be a valid UUID with the exception that zero UUID
  37408. // is not supported (00000000-0000-0000-0000-000000000000).
  37409. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  37410. c.urlParams_.Set("requestId", requestId)
  37411. return c
  37412. }
  37413. // Fields allows partial responses to be retrieved. See
  37414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37415. // for more information.
  37416. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  37417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37418. return c
  37419. }
  37420. // Context sets the context to be used in this call's Do method. Any
  37421. // pending HTTP request will be aborted if the provided context is
  37422. // canceled.
  37423. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  37424. c.ctx_ = ctx
  37425. return c
  37426. }
  37427. // Header returns an http.Header that can be modified by the caller to
  37428. // add HTTP headers to the request.
  37429. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  37430. if c.header_ == nil {
  37431. c.header_ = make(http.Header)
  37432. }
  37433. return c.header_
  37434. }
  37435. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  37436. reqHeaders := make(http.Header)
  37437. for k, v := range c.header_ {
  37438. reqHeaders[k] = v
  37439. }
  37440. reqHeaders.Set("User-Agent", c.s.userAgent())
  37441. var body io.Reader = nil
  37442. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  37443. if err != nil {
  37444. return nil, err
  37445. }
  37446. reqHeaders.Set("Content-Type", "application/json")
  37447. c.urlParams_.Set("alt", alt)
  37448. c.urlParams_.Set("prettyPrint", "false")
  37449. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  37450. urls += "?" + c.urlParams_.Encode()
  37451. req, err := http.NewRequest("POST", urls, body)
  37452. if err != nil {
  37453. return nil, err
  37454. }
  37455. req.Header = reqHeaders
  37456. googleapi.Expand(req.URL, map[string]string{
  37457. "project": c.project,
  37458. })
  37459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37460. }
  37461. // Do executes the "compute.globalForwardingRules.insert" call.
  37462. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37463. // status code is an error. Response headers are in either
  37464. // *Operation.ServerResponse.Header or (if a response was returned at
  37465. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37466. // to check whether the returned error was because
  37467. // http.StatusNotModified was returned.
  37468. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37469. gensupport.SetOptions(c.urlParams_, opts...)
  37470. res, err := c.doRequest("json")
  37471. if res != nil && res.StatusCode == http.StatusNotModified {
  37472. if res.Body != nil {
  37473. res.Body.Close()
  37474. }
  37475. return nil, &googleapi.Error{
  37476. Code: res.StatusCode,
  37477. Header: res.Header,
  37478. }
  37479. }
  37480. if err != nil {
  37481. return nil, err
  37482. }
  37483. defer googleapi.CloseBody(res)
  37484. if err := googleapi.CheckResponse(res); err != nil {
  37485. return nil, err
  37486. }
  37487. ret := &Operation{
  37488. ServerResponse: googleapi.ServerResponse{
  37489. Header: res.Header,
  37490. HTTPStatusCode: res.StatusCode,
  37491. },
  37492. }
  37493. target := &ret
  37494. if err := gensupport.DecodeResponse(target, res); err != nil {
  37495. return nil, err
  37496. }
  37497. return ret, nil
  37498. // {
  37499. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  37500. // "httpMethod": "POST",
  37501. // "id": "compute.globalForwardingRules.insert",
  37502. // "parameterOrder": [
  37503. // "project"
  37504. // ],
  37505. // "parameters": {
  37506. // "project": {
  37507. // "description": "Project ID for this request.",
  37508. // "location": "path",
  37509. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37510. // "required": true,
  37511. // "type": "string"
  37512. // },
  37513. // "requestId": {
  37514. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37515. // "location": "query",
  37516. // "type": "string"
  37517. // }
  37518. // },
  37519. // "path": "{project}/global/forwardingRules",
  37520. // "request": {
  37521. // "$ref": "ForwardingRule"
  37522. // },
  37523. // "response": {
  37524. // "$ref": "Operation"
  37525. // },
  37526. // "scopes": [
  37527. // "https://www.googleapis.com/auth/cloud-platform",
  37528. // "https://www.googleapis.com/auth/compute"
  37529. // ]
  37530. // }
  37531. }
  37532. // method id "compute.globalForwardingRules.list":
  37533. type GlobalForwardingRulesListCall struct {
  37534. s *Service
  37535. project string
  37536. urlParams_ gensupport.URLParams
  37537. ifNoneMatch_ string
  37538. ctx_ context.Context
  37539. header_ http.Header
  37540. }
  37541. // List: Retrieves a list of GlobalForwardingRule resources available to
  37542. // the specified project.
  37543. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  37544. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  37545. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37546. c.project = project
  37547. return c
  37548. }
  37549. // Filter sets the optional parameter "filter": A filter expression that
  37550. // filters resources listed in the response. The expression must specify
  37551. // the field name, a comparison operator, and the value that you want to
  37552. // use for filtering. The value must be a string, a number, or a
  37553. // boolean. The comparison operator must be either =, !=, >, or <.
  37554. //
  37555. // For example, if you are filtering Compute Engine instances, you can
  37556. // exclude instances named example-instance by specifying name !=
  37557. // example-instance.
  37558. //
  37559. // You can also filter nested fields. For example, you could specify
  37560. // scheduling.automaticRestart = false to include instances only if they
  37561. // are not scheduled for automatic restarts. You can use filtering on
  37562. // nested fields to filter based on resource labels.
  37563. //
  37564. // To filter on multiple expressions, provide each separate expression
  37565. // within parentheses. For example, (scheduling.automaticRestart = true)
  37566. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37567. // AND expression. However, you can include AND and OR expressions
  37568. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37569. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37570. // true).
  37571. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  37572. c.urlParams_.Set("filter", filter)
  37573. return c
  37574. }
  37575. // MaxResults sets the optional parameter "maxResults": The maximum
  37576. // number of results per page that should be returned. If the number of
  37577. // available results is larger than maxResults, Compute Engine returns a
  37578. // nextPageToken that can be used to get the next page of results in
  37579. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37580. // (Default: 500)
  37581. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  37582. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37583. return c
  37584. }
  37585. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37586. // a certain order. By default, results are returned in alphanumerical
  37587. // order based on the resource name.
  37588. //
  37589. // You can also sort results in descending order based on the creation
  37590. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37591. // based on the creationTimestamp field in reverse chronological order
  37592. // (newest result first). Use this to sort resources like operations so
  37593. // that the newest operation is returned first.
  37594. //
  37595. // Currently, only sorting by name or creationTimestamp desc is
  37596. // supported.
  37597. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  37598. c.urlParams_.Set("orderBy", orderBy)
  37599. return c
  37600. }
  37601. // PageToken sets the optional parameter "pageToken": Specifies a page
  37602. // token to use. Set pageToken to the nextPageToken returned by a
  37603. // previous list request to get the next page of results.
  37604. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  37605. c.urlParams_.Set("pageToken", pageToken)
  37606. return c
  37607. }
  37608. // Fields allows partial responses to be retrieved. See
  37609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37610. // for more information.
  37611. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  37612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37613. return c
  37614. }
  37615. // IfNoneMatch sets the optional parameter which makes the operation
  37616. // fail if the object's ETag matches the given value. This is useful for
  37617. // getting updates only after the object has changed since the last
  37618. // request. Use googleapi.IsNotModified to check whether the response
  37619. // error from Do is the result of In-None-Match.
  37620. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  37621. c.ifNoneMatch_ = entityTag
  37622. return c
  37623. }
  37624. // Context sets the context to be used in this call's Do method. Any
  37625. // pending HTTP request will be aborted if the provided context is
  37626. // canceled.
  37627. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  37628. c.ctx_ = ctx
  37629. return c
  37630. }
  37631. // Header returns an http.Header that can be modified by the caller to
  37632. // add HTTP headers to the request.
  37633. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  37634. if c.header_ == nil {
  37635. c.header_ = make(http.Header)
  37636. }
  37637. return c.header_
  37638. }
  37639. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  37640. reqHeaders := make(http.Header)
  37641. for k, v := range c.header_ {
  37642. reqHeaders[k] = v
  37643. }
  37644. reqHeaders.Set("User-Agent", c.s.userAgent())
  37645. if c.ifNoneMatch_ != "" {
  37646. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37647. }
  37648. var body io.Reader = nil
  37649. c.urlParams_.Set("alt", alt)
  37650. c.urlParams_.Set("prettyPrint", "false")
  37651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  37652. urls += "?" + c.urlParams_.Encode()
  37653. req, err := http.NewRequest("GET", urls, body)
  37654. if err != nil {
  37655. return nil, err
  37656. }
  37657. req.Header = reqHeaders
  37658. googleapi.Expand(req.URL, map[string]string{
  37659. "project": c.project,
  37660. })
  37661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37662. }
  37663. // Do executes the "compute.globalForwardingRules.list" call.
  37664. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  37665. // non-2xx status code is an error. Response headers are in either
  37666. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  37667. // returned at all) in error.(*googleapi.Error).Header. Use
  37668. // googleapi.IsNotModified to check whether the returned error was
  37669. // because http.StatusNotModified was returned.
  37670. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  37671. gensupport.SetOptions(c.urlParams_, opts...)
  37672. res, err := c.doRequest("json")
  37673. if res != nil && res.StatusCode == http.StatusNotModified {
  37674. if res.Body != nil {
  37675. res.Body.Close()
  37676. }
  37677. return nil, &googleapi.Error{
  37678. Code: res.StatusCode,
  37679. Header: res.Header,
  37680. }
  37681. }
  37682. if err != nil {
  37683. return nil, err
  37684. }
  37685. defer googleapi.CloseBody(res)
  37686. if err := googleapi.CheckResponse(res); err != nil {
  37687. return nil, err
  37688. }
  37689. ret := &ForwardingRuleList{
  37690. ServerResponse: googleapi.ServerResponse{
  37691. Header: res.Header,
  37692. HTTPStatusCode: res.StatusCode,
  37693. },
  37694. }
  37695. target := &ret
  37696. if err := gensupport.DecodeResponse(target, res); err != nil {
  37697. return nil, err
  37698. }
  37699. return ret, nil
  37700. // {
  37701. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  37702. // "httpMethod": "GET",
  37703. // "id": "compute.globalForwardingRules.list",
  37704. // "parameterOrder": [
  37705. // "project"
  37706. // ],
  37707. // "parameters": {
  37708. // "filter": {
  37709. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  37710. // "location": "query",
  37711. // "type": "string"
  37712. // },
  37713. // "maxResults": {
  37714. // "default": "500",
  37715. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37716. // "format": "uint32",
  37717. // "location": "query",
  37718. // "minimum": "0",
  37719. // "type": "integer"
  37720. // },
  37721. // "orderBy": {
  37722. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37723. // "location": "query",
  37724. // "type": "string"
  37725. // },
  37726. // "pageToken": {
  37727. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37728. // "location": "query",
  37729. // "type": "string"
  37730. // },
  37731. // "project": {
  37732. // "description": "Project ID for this request.",
  37733. // "location": "path",
  37734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37735. // "required": true,
  37736. // "type": "string"
  37737. // }
  37738. // },
  37739. // "path": "{project}/global/forwardingRules",
  37740. // "response": {
  37741. // "$ref": "ForwardingRuleList"
  37742. // },
  37743. // "scopes": [
  37744. // "https://www.googleapis.com/auth/cloud-platform",
  37745. // "https://www.googleapis.com/auth/compute",
  37746. // "https://www.googleapis.com/auth/compute.readonly"
  37747. // ]
  37748. // }
  37749. }
  37750. // Pages invokes f for each page of results.
  37751. // A non-nil error returned from f will halt the iteration.
  37752. // The provided context supersedes any context provided to the Context method.
  37753. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  37754. c.ctx_ = ctx
  37755. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37756. for {
  37757. x, err := c.Do()
  37758. if err != nil {
  37759. return err
  37760. }
  37761. if err := f(x); err != nil {
  37762. return err
  37763. }
  37764. if x.NextPageToken == "" {
  37765. return nil
  37766. }
  37767. c.PageToken(x.NextPageToken)
  37768. }
  37769. }
  37770. // method id "compute.globalForwardingRules.setTarget":
  37771. type GlobalForwardingRulesSetTargetCall struct {
  37772. s *Service
  37773. project string
  37774. forwardingRule string
  37775. targetreference *TargetReference
  37776. urlParams_ gensupport.URLParams
  37777. ctx_ context.Context
  37778. header_ http.Header
  37779. }
  37780. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  37781. // The new target should be of the same type as the old target.
  37782. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  37783. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  37784. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37785. c.project = project
  37786. c.forwardingRule = forwardingRule
  37787. c.targetreference = targetreference
  37788. return c
  37789. }
  37790. // RequestId sets the optional parameter "requestId": An optional
  37791. // request ID to identify requests. Specify a unique request ID so that
  37792. // if you must retry your request, the server will know to ignore the
  37793. // request if it has already been completed.
  37794. //
  37795. // For example, consider a situation where you make an initial request
  37796. // and the request times out. If you make the request again with the
  37797. // same request ID, the server can check if original operation with the
  37798. // same request ID was received, and if so, will ignore the second
  37799. // request. This prevents clients from accidentally creating duplicate
  37800. // commitments.
  37801. //
  37802. // The request ID must be a valid UUID with the exception that zero UUID
  37803. // is not supported (00000000-0000-0000-0000-000000000000).
  37804. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  37805. c.urlParams_.Set("requestId", requestId)
  37806. return c
  37807. }
  37808. // Fields allows partial responses to be retrieved. See
  37809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37810. // for more information.
  37811. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  37812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37813. return c
  37814. }
  37815. // Context sets the context to be used in this call's Do method. Any
  37816. // pending HTTP request will be aborted if the provided context is
  37817. // canceled.
  37818. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  37819. c.ctx_ = ctx
  37820. return c
  37821. }
  37822. // Header returns an http.Header that can be modified by the caller to
  37823. // add HTTP headers to the request.
  37824. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  37825. if c.header_ == nil {
  37826. c.header_ = make(http.Header)
  37827. }
  37828. return c.header_
  37829. }
  37830. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  37831. reqHeaders := make(http.Header)
  37832. for k, v := range c.header_ {
  37833. reqHeaders[k] = v
  37834. }
  37835. reqHeaders.Set("User-Agent", c.s.userAgent())
  37836. var body io.Reader = nil
  37837. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  37838. if err != nil {
  37839. return nil, err
  37840. }
  37841. reqHeaders.Set("Content-Type", "application/json")
  37842. c.urlParams_.Set("alt", alt)
  37843. c.urlParams_.Set("prettyPrint", "false")
  37844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  37845. urls += "?" + c.urlParams_.Encode()
  37846. req, err := http.NewRequest("POST", urls, body)
  37847. if err != nil {
  37848. return nil, err
  37849. }
  37850. req.Header = reqHeaders
  37851. googleapi.Expand(req.URL, map[string]string{
  37852. "project": c.project,
  37853. "forwardingRule": c.forwardingRule,
  37854. })
  37855. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37856. }
  37857. // Do executes the "compute.globalForwardingRules.setTarget" call.
  37858. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37859. // status code is an error. Response headers are in either
  37860. // *Operation.ServerResponse.Header or (if a response was returned at
  37861. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37862. // to check whether the returned error was because
  37863. // http.StatusNotModified was returned.
  37864. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37865. gensupport.SetOptions(c.urlParams_, opts...)
  37866. res, err := c.doRequest("json")
  37867. if res != nil && res.StatusCode == http.StatusNotModified {
  37868. if res.Body != nil {
  37869. res.Body.Close()
  37870. }
  37871. return nil, &googleapi.Error{
  37872. Code: res.StatusCode,
  37873. Header: res.Header,
  37874. }
  37875. }
  37876. if err != nil {
  37877. return nil, err
  37878. }
  37879. defer googleapi.CloseBody(res)
  37880. if err := googleapi.CheckResponse(res); err != nil {
  37881. return nil, err
  37882. }
  37883. ret := &Operation{
  37884. ServerResponse: googleapi.ServerResponse{
  37885. Header: res.Header,
  37886. HTTPStatusCode: res.StatusCode,
  37887. },
  37888. }
  37889. target := &ret
  37890. if err := gensupport.DecodeResponse(target, res); err != nil {
  37891. return nil, err
  37892. }
  37893. return ret, nil
  37894. // {
  37895. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  37896. // "httpMethod": "POST",
  37897. // "id": "compute.globalForwardingRules.setTarget",
  37898. // "parameterOrder": [
  37899. // "project",
  37900. // "forwardingRule"
  37901. // ],
  37902. // "parameters": {
  37903. // "forwardingRule": {
  37904. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  37905. // "location": "path",
  37906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37907. // "required": true,
  37908. // "type": "string"
  37909. // },
  37910. // "project": {
  37911. // "description": "Project ID for this request.",
  37912. // "location": "path",
  37913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37914. // "required": true,
  37915. // "type": "string"
  37916. // },
  37917. // "requestId": {
  37918. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37919. // "location": "query",
  37920. // "type": "string"
  37921. // }
  37922. // },
  37923. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  37924. // "request": {
  37925. // "$ref": "TargetReference"
  37926. // },
  37927. // "response": {
  37928. // "$ref": "Operation"
  37929. // },
  37930. // "scopes": [
  37931. // "https://www.googleapis.com/auth/cloud-platform",
  37932. // "https://www.googleapis.com/auth/compute"
  37933. // ]
  37934. // }
  37935. }
  37936. // method id "compute.globalOperations.aggregatedList":
  37937. type GlobalOperationsAggregatedListCall struct {
  37938. s *Service
  37939. project string
  37940. urlParams_ gensupport.URLParams
  37941. ifNoneMatch_ string
  37942. ctx_ context.Context
  37943. header_ http.Header
  37944. }
  37945. // AggregatedList: Retrieves an aggregated list of all operations.
  37946. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  37947. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  37948. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37949. c.project = project
  37950. return c
  37951. }
  37952. // Filter sets the optional parameter "filter": A filter expression that
  37953. // filters resources listed in the response. The expression must specify
  37954. // the field name, a comparison operator, and the value that you want to
  37955. // use for filtering. The value must be a string, a number, or a
  37956. // boolean. The comparison operator must be either =, !=, >, or <.
  37957. //
  37958. // For example, if you are filtering Compute Engine instances, you can
  37959. // exclude instances named example-instance by specifying name !=
  37960. // example-instance.
  37961. //
  37962. // You can also filter nested fields. For example, you could specify
  37963. // scheduling.automaticRestart = false to include instances only if they
  37964. // are not scheduled for automatic restarts. You can use filtering on
  37965. // nested fields to filter based on resource labels.
  37966. //
  37967. // To filter on multiple expressions, provide each separate expression
  37968. // within parentheses. For example, (scheduling.automaticRestart = true)
  37969. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37970. // AND expression. However, you can include AND and OR expressions
  37971. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37972. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37973. // true).
  37974. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  37975. c.urlParams_.Set("filter", filter)
  37976. return c
  37977. }
  37978. // MaxResults sets the optional parameter "maxResults": The maximum
  37979. // number of results per page that should be returned. If the number of
  37980. // available results is larger than maxResults, Compute Engine returns a
  37981. // nextPageToken that can be used to get the next page of results in
  37982. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37983. // (Default: 500)
  37984. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  37985. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37986. return c
  37987. }
  37988. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37989. // a certain order. By default, results are returned in alphanumerical
  37990. // order based on the resource name.
  37991. //
  37992. // You can also sort results in descending order based on the creation
  37993. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37994. // based on the creationTimestamp field in reverse chronological order
  37995. // (newest result first). Use this to sort resources like operations so
  37996. // that the newest operation is returned first.
  37997. //
  37998. // Currently, only sorting by name or creationTimestamp desc is
  37999. // supported.
  38000. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  38001. c.urlParams_.Set("orderBy", orderBy)
  38002. return c
  38003. }
  38004. // PageToken sets the optional parameter "pageToken": Specifies a page
  38005. // token to use. Set pageToken to the nextPageToken returned by a
  38006. // previous list request to get the next page of results.
  38007. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  38008. c.urlParams_.Set("pageToken", pageToken)
  38009. return c
  38010. }
  38011. // Fields allows partial responses to be retrieved. See
  38012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38013. // for more information.
  38014. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  38015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38016. return c
  38017. }
  38018. // IfNoneMatch sets the optional parameter which makes the operation
  38019. // fail if the object's ETag matches the given value. This is useful for
  38020. // getting updates only after the object has changed since the last
  38021. // request. Use googleapi.IsNotModified to check whether the response
  38022. // error from Do is the result of In-None-Match.
  38023. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  38024. c.ifNoneMatch_ = entityTag
  38025. return c
  38026. }
  38027. // Context sets the context to be used in this call's Do method. Any
  38028. // pending HTTP request will be aborted if the provided context is
  38029. // canceled.
  38030. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  38031. c.ctx_ = ctx
  38032. return c
  38033. }
  38034. // Header returns an http.Header that can be modified by the caller to
  38035. // add HTTP headers to the request.
  38036. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  38037. if c.header_ == nil {
  38038. c.header_ = make(http.Header)
  38039. }
  38040. return c.header_
  38041. }
  38042. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38043. reqHeaders := make(http.Header)
  38044. for k, v := range c.header_ {
  38045. reqHeaders[k] = v
  38046. }
  38047. reqHeaders.Set("User-Agent", c.s.userAgent())
  38048. if c.ifNoneMatch_ != "" {
  38049. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38050. }
  38051. var body io.Reader = nil
  38052. c.urlParams_.Set("alt", alt)
  38053. c.urlParams_.Set("prettyPrint", "false")
  38054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  38055. urls += "?" + c.urlParams_.Encode()
  38056. req, err := http.NewRequest("GET", urls, body)
  38057. if err != nil {
  38058. return nil, err
  38059. }
  38060. req.Header = reqHeaders
  38061. googleapi.Expand(req.URL, map[string]string{
  38062. "project": c.project,
  38063. })
  38064. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38065. }
  38066. // Do executes the "compute.globalOperations.aggregatedList" call.
  38067. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  38068. // non-2xx status code is an error. Response headers are in either
  38069. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  38070. // returned at all) in error.(*googleapi.Error).Header. Use
  38071. // googleapi.IsNotModified to check whether the returned error was
  38072. // because http.StatusNotModified was returned.
  38073. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  38074. gensupport.SetOptions(c.urlParams_, opts...)
  38075. res, err := c.doRequest("json")
  38076. if res != nil && res.StatusCode == http.StatusNotModified {
  38077. if res.Body != nil {
  38078. res.Body.Close()
  38079. }
  38080. return nil, &googleapi.Error{
  38081. Code: res.StatusCode,
  38082. Header: res.Header,
  38083. }
  38084. }
  38085. if err != nil {
  38086. return nil, err
  38087. }
  38088. defer googleapi.CloseBody(res)
  38089. if err := googleapi.CheckResponse(res); err != nil {
  38090. return nil, err
  38091. }
  38092. ret := &OperationAggregatedList{
  38093. ServerResponse: googleapi.ServerResponse{
  38094. Header: res.Header,
  38095. HTTPStatusCode: res.StatusCode,
  38096. },
  38097. }
  38098. target := &ret
  38099. if err := gensupport.DecodeResponse(target, res); err != nil {
  38100. return nil, err
  38101. }
  38102. return ret, nil
  38103. // {
  38104. // "description": "Retrieves an aggregated list of all operations.",
  38105. // "httpMethod": "GET",
  38106. // "id": "compute.globalOperations.aggregatedList",
  38107. // "parameterOrder": [
  38108. // "project"
  38109. // ],
  38110. // "parameters": {
  38111. // "filter": {
  38112. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38113. // "location": "query",
  38114. // "type": "string"
  38115. // },
  38116. // "maxResults": {
  38117. // "default": "500",
  38118. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38119. // "format": "uint32",
  38120. // "location": "query",
  38121. // "minimum": "0",
  38122. // "type": "integer"
  38123. // },
  38124. // "orderBy": {
  38125. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38126. // "location": "query",
  38127. // "type": "string"
  38128. // },
  38129. // "pageToken": {
  38130. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38131. // "location": "query",
  38132. // "type": "string"
  38133. // },
  38134. // "project": {
  38135. // "description": "Project ID for this request.",
  38136. // "location": "path",
  38137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38138. // "required": true,
  38139. // "type": "string"
  38140. // }
  38141. // },
  38142. // "path": "{project}/aggregated/operations",
  38143. // "response": {
  38144. // "$ref": "OperationAggregatedList"
  38145. // },
  38146. // "scopes": [
  38147. // "https://www.googleapis.com/auth/cloud-platform",
  38148. // "https://www.googleapis.com/auth/compute",
  38149. // "https://www.googleapis.com/auth/compute.readonly"
  38150. // ]
  38151. // }
  38152. }
  38153. // Pages invokes f for each page of results.
  38154. // A non-nil error returned from f will halt the iteration.
  38155. // The provided context supersedes any context provided to the Context method.
  38156. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  38157. c.ctx_ = ctx
  38158. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38159. for {
  38160. x, err := c.Do()
  38161. if err != nil {
  38162. return err
  38163. }
  38164. if err := f(x); err != nil {
  38165. return err
  38166. }
  38167. if x.NextPageToken == "" {
  38168. return nil
  38169. }
  38170. c.PageToken(x.NextPageToken)
  38171. }
  38172. }
  38173. // method id "compute.globalOperations.delete":
  38174. type GlobalOperationsDeleteCall struct {
  38175. s *Service
  38176. project string
  38177. operation string
  38178. urlParams_ gensupport.URLParams
  38179. ctx_ context.Context
  38180. header_ http.Header
  38181. }
  38182. // Delete: Deletes the specified Operations resource.
  38183. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  38184. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  38185. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38186. c.project = project
  38187. c.operation = operation
  38188. return c
  38189. }
  38190. // Fields allows partial responses to be retrieved. See
  38191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38192. // for more information.
  38193. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  38194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38195. return c
  38196. }
  38197. // Context sets the context to be used in this call's Do method. Any
  38198. // pending HTTP request will be aborted if the provided context is
  38199. // canceled.
  38200. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  38201. c.ctx_ = ctx
  38202. return c
  38203. }
  38204. // Header returns an http.Header that can be modified by the caller to
  38205. // add HTTP headers to the request.
  38206. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  38207. if c.header_ == nil {
  38208. c.header_ = make(http.Header)
  38209. }
  38210. return c.header_
  38211. }
  38212. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  38213. reqHeaders := make(http.Header)
  38214. for k, v := range c.header_ {
  38215. reqHeaders[k] = v
  38216. }
  38217. reqHeaders.Set("User-Agent", c.s.userAgent())
  38218. var body io.Reader = nil
  38219. c.urlParams_.Set("alt", alt)
  38220. c.urlParams_.Set("prettyPrint", "false")
  38221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  38222. urls += "?" + c.urlParams_.Encode()
  38223. req, err := http.NewRequest("DELETE", urls, body)
  38224. if err != nil {
  38225. return nil, err
  38226. }
  38227. req.Header = reqHeaders
  38228. googleapi.Expand(req.URL, map[string]string{
  38229. "project": c.project,
  38230. "operation": c.operation,
  38231. })
  38232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38233. }
  38234. // Do executes the "compute.globalOperations.delete" call.
  38235. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  38236. gensupport.SetOptions(c.urlParams_, opts...)
  38237. res, err := c.doRequest("json")
  38238. if err != nil {
  38239. return err
  38240. }
  38241. defer googleapi.CloseBody(res)
  38242. if err := googleapi.CheckResponse(res); err != nil {
  38243. return err
  38244. }
  38245. return nil
  38246. // {
  38247. // "description": "Deletes the specified Operations resource.",
  38248. // "httpMethod": "DELETE",
  38249. // "id": "compute.globalOperations.delete",
  38250. // "parameterOrder": [
  38251. // "project",
  38252. // "operation"
  38253. // ],
  38254. // "parameters": {
  38255. // "operation": {
  38256. // "description": "Name of the Operations resource to delete.",
  38257. // "location": "path",
  38258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38259. // "required": true,
  38260. // "type": "string"
  38261. // },
  38262. // "project": {
  38263. // "description": "Project ID for this request.",
  38264. // "location": "path",
  38265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38266. // "required": true,
  38267. // "type": "string"
  38268. // }
  38269. // },
  38270. // "path": "{project}/global/operations/{operation}",
  38271. // "scopes": [
  38272. // "https://www.googleapis.com/auth/cloud-platform",
  38273. // "https://www.googleapis.com/auth/compute"
  38274. // ]
  38275. // }
  38276. }
  38277. // method id "compute.globalOperations.get":
  38278. type GlobalOperationsGetCall struct {
  38279. s *Service
  38280. project string
  38281. operation string
  38282. urlParams_ gensupport.URLParams
  38283. ifNoneMatch_ string
  38284. ctx_ context.Context
  38285. header_ http.Header
  38286. }
  38287. // Get: Retrieves the specified Operations resource. Gets a list of
  38288. // operations by making a list() request.
  38289. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  38290. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  38291. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38292. c.project = project
  38293. c.operation = operation
  38294. return c
  38295. }
  38296. // Fields allows partial responses to be retrieved. See
  38297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38298. // for more information.
  38299. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  38300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38301. return c
  38302. }
  38303. // IfNoneMatch sets the optional parameter which makes the operation
  38304. // fail if the object's ETag matches the given value. This is useful for
  38305. // getting updates only after the object has changed since the last
  38306. // request. Use googleapi.IsNotModified to check whether the response
  38307. // error from Do is the result of In-None-Match.
  38308. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  38309. c.ifNoneMatch_ = entityTag
  38310. return c
  38311. }
  38312. // Context sets the context to be used in this call's Do method. Any
  38313. // pending HTTP request will be aborted if the provided context is
  38314. // canceled.
  38315. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  38316. c.ctx_ = ctx
  38317. return c
  38318. }
  38319. // Header returns an http.Header that can be modified by the caller to
  38320. // add HTTP headers to the request.
  38321. func (c *GlobalOperationsGetCall) Header() http.Header {
  38322. if c.header_ == nil {
  38323. c.header_ = make(http.Header)
  38324. }
  38325. return c.header_
  38326. }
  38327. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  38328. reqHeaders := make(http.Header)
  38329. for k, v := range c.header_ {
  38330. reqHeaders[k] = v
  38331. }
  38332. reqHeaders.Set("User-Agent", c.s.userAgent())
  38333. if c.ifNoneMatch_ != "" {
  38334. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38335. }
  38336. var body io.Reader = nil
  38337. c.urlParams_.Set("alt", alt)
  38338. c.urlParams_.Set("prettyPrint", "false")
  38339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  38340. urls += "?" + c.urlParams_.Encode()
  38341. req, err := http.NewRequest("GET", urls, body)
  38342. if err != nil {
  38343. return nil, err
  38344. }
  38345. req.Header = reqHeaders
  38346. googleapi.Expand(req.URL, map[string]string{
  38347. "project": c.project,
  38348. "operation": c.operation,
  38349. })
  38350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38351. }
  38352. // Do executes the "compute.globalOperations.get" call.
  38353. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38354. // status code is an error. Response headers are in either
  38355. // *Operation.ServerResponse.Header or (if a response was returned at
  38356. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38357. // to check whether the returned error was because
  38358. // http.StatusNotModified was returned.
  38359. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38360. gensupport.SetOptions(c.urlParams_, opts...)
  38361. res, err := c.doRequest("json")
  38362. if res != nil && res.StatusCode == http.StatusNotModified {
  38363. if res.Body != nil {
  38364. res.Body.Close()
  38365. }
  38366. return nil, &googleapi.Error{
  38367. Code: res.StatusCode,
  38368. Header: res.Header,
  38369. }
  38370. }
  38371. if err != nil {
  38372. return nil, err
  38373. }
  38374. defer googleapi.CloseBody(res)
  38375. if err := googleapi.CheckResponse(res); err != nil {
  38376. return nil, err
  38377. }
  38378. ret := &Operation{
  38379. ServerResponse: googleapi.ServerResponse{
  38380. Header: res.Header,
  38381. HTTPStatusCode: res.StatusCode,
  38382. },
  38383. }
  38384. target := &ret
  38385. if err := gensupport.DecodeResponse(target, res); err != nil {
  38386. return nil, err
  38387. }
  38388. return ret, nil
  38389. // {
  38390. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  38391. // "httpMethod": "GET",
  38392. // "id": "compute.globalOperations.get",
  38393. // "parameterOrder": [
  38394. // "project",
  38395. // "operation"
  38396. // ],
  38397. // "parameters": {
  38398. // "operation": {
  38399. // "description": "Name of the Operations resource to return.",
  38400. // "location": "path",
  38401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38402. // "required": true,
  38403. // "type": "string"
  38404. // },
  38405. // "project": {
  38406. // "description": "Project ID for this request.",
  38407. // "location": "path",
  38408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38409. // "required": true,
  38410. // "type": "string"
  38411. // }
  38412. // },
  38413. // "path": "{project}/global/operations/{operation}",
  38414. // "response": {
  38415. // "$ref": "Operation"
  38416. // },
  38417. // "scopes": [
  38418. // "https://www.googleapis.com/auth/cloud-platform",
  38419. // "https://www.googleapis.com/auth/compute",
  38420. // "https://www.googleapis.com/auth/compute.readonly"
  38421. // ]
  38422. // }
  38423. }
  38424. // method id "compute.globalOperations.list":
  38425. type GlobalOperationsListCall struct {
  38426. s *Service
  38427. project string
  38428. urlParams_ gensupport.URLParams
  38429. ifNoneMatch_ string
  38430. ctx_ context.Context
  38431. header_ http.Header
  38432. }
  38433. // List: Retrieves a list of Operation resources contained within the
  38434. // specified project.
  38435. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  38436. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  38437. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38438. c.project = project
  38439. return c
  38440. }
  38441. // Filter sets the optional parameter "filter": A filter expression that
  38442. // filters resources listed in the response. The expression must specify
  38443. // the field name, a comparison operator, and the value that you want to
  38444. // use for filtering. The value must be a string, a number, or a
  38445. // boolean. The comparison operator must be either =, !=, >, or <.
  38446. //
  38447. // For example, if you are filtering Compute Engine instances, you can
  38448. // exclude instances named example-instance by specifying name !=
  38449. // example-instance.
  38450. //
  38451. // You can also filter nested fields. For example, you could specify
  38452. // scheduling.automaticRestart = false to include instances only if they
  38453. // are not scheduled for automatic restarts. You can use filtering on
  38454. // nested fields to filter based on resource labels.
  38455. //
  38456. // To filter on multiple expressions, provide each separate expression
  38457. // within parentheses. For example, (scheduling.automaticRestart = true)
  38458. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38459. // AND expression. However, you can include AND and OR expressions
  38460. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38461. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38462. // true).
  38463. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  38464. c.urlParams_.Set("filter", filter)
  38465. return c
  38466. }
  38467. // MaxResults sets the optional parameter "maxResults": The maximum
  38468. // number of results per page that should be returned. If the number of
  38469. // available results is larger than maxResults, Compute Engine returns a
  38470. // nextPageToken that can be used to get the next page of results in
  38471. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38472. // (Default: 500)
  38473. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  38474. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38475. return c
  38476. }
  38477. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38478. // a certain order. By default, results are returned in alphanumerical
  38479. // order based on the resource name.
  38480. //
  38481. // You can also sort results in descending order based on the creation
  38482. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38483. // based on the creationTimestamp field in reverse chronological order
  38484. // (newest result first). Use this to sort resources like operations so
  38485. // that the newest operation is returned first.
  38486. //
  38487. // Currently, only sorting by name or creationTimestamp desc is
  38488. // supported.
  38489. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  38490. c.urlParams_.Set("orderBy", orderBy)
  38491. return c
  38492. }
  38493. // PageToken sets the optional parameter "pageToken": Specifies a page
  38494. // token to use. Set pageToken to the nextPageToken returned by a
  38495. // previous list request to get the next page of results.
  38496. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  38497. c.urlParams_.Set("pageToken", pageToken)
  38498. return c
  38499. }
  38500. // Fields allows partial responses to be retrieved. See
  38501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38502. // for more information.
  38503. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  38504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38505. return c
  38506. }
  38507. // IfNoneMatch sets the optional parameter which makes the operation
  38508. // fail if the object's ETag matches the given value. This is useful for
  38509. // getting updates only after the object has changed since the last
  38510. // request. Use googleapi.IsNotModified to check whether the response
  38511. // error from Do is the result of In-None-Match.
  38512. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  38513. c.ifNoneMatch_ = entityTag
  38514. return c
  38515. }
  38516. // Context sets the context to be used in this call's Do method. Any
  38517. // pending HTTP request will be aborted if the provided context is
  38518. // canceled.
  38519. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  38520. c.ctx_ = ctx
  38521. return c
  38522. }
  38523. // Header returns an http.Header that can be modified by the caller to
  38524. // add HTTP headers to the request.
  38525. func (c *GlobalOperationsListCall) Header() http.Header {
  38526. if c.header_ == nil {
  38527. c.header_ = make(http.Header)
  38528. }
  38529. return c.header_
  38530. }
  38531. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  38532. reqHeaders := make(http.Header)
  38533. for k, v := range c.header_ {
  38534. reqHeaders[k] = v
  38535. }
  38536. reqHeaders.Set("User-Agent", c.s.userAgent())
  38537. if c.ifNoneMatch_ != "" {
  38538. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38539. }
  38540. var body io.Reader = nil
  38541. c.urlParams_.Set("alt", alt)
  38542. c.urlParams_.Set("prettyPrint", "false")
  38543. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  38544. urls += "?" + c.urlParams_.Encode()
  38545. req, err := http.NewRequest("GET", urls, body)
  38546. if err != nil {
  38547. return nil, err
  38548. }
  38549. req.Header = reqHeaders
  38550. googleapi.Expand(req.URL, map[string]string{
  38551. "project": c.project,
  38552. })
  38553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38554. }
  38555. // Do executes the "compute.globalOperations.list" call.
  38556. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  38557. // status code is an error. Response headers are in either
  38558. // *OperationList.ServerResponse.Header or (if a response was returned
  38559. // at all) in error.(*googleapi.Error).Header. Use
  38560. // googleapi.IsNotModified to check whether the returned error was
  38561. // because http.StatusNotModified was returned.
  38562. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  38563. gensupport.SetOptions(c.urlParams_, opts...)
  38564. res, err := c.doRequest("json")
  38565. if res != nil && res.StatusCode == http.StatusNotModified {
  38566. if res.Body != nil {
  38567. res.Body.Close()
  38568. }
  38569. return nil, &googleapi.Error{
  38570. Code: res.StatusCode,
  38571. Header: res.Header,
  38572. }
  38573. }
  38574. if err != nil {
  38575. return nil, err
  38576. }
  38577. defer googleapi.CloseBody(res)
  38578. if err := googleapi.CheckResponse(res); err != nil {
  38579. return nil, err
  38580. }
  38581. ret := &OperationList{
  38582. ServerResponse: googleapi.ServerResponse{
  38583. Header: res.Header,
  38584. HTTPStatusCode: res.StatusCode,
  38585. },
  38586. }
  38587. target := &ret
  38588. if err := gensupport.DecodeResponse(target, res); err != nil {
  38589. return nil, err
  38590. }
  38591. return ret, nil
  38592. // {
  38593. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  38594. // "httpMethod": "GET",
  38595. // "id": "compute.globalOperations.list",
  38596. // "parameterOrder": [
  38597. // "project"
  38598. // ],
  38599. // "parameters": {
  38600. // "filter": {
  38601. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38602. // "location": "query",
  38603. // "type": "string"
  38604. // },
  38605. // "maxResults": {
  38606. // "default": "500",
  38607. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38608. // "format": "uint32",
  38609. // "location": "query",
  38610. // "minimum": "0",
  38611. // "type": "integer"
  38612. // },
  38613. // "orderBy": {
  38614. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38615. // "location": "query",
  38616. // "type": "string"
  38617. // },
  38618. // "pageToken": {
  38619. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38620. // "location": "query",
  38621. // "type": "string"
  38622. // },
  38623. // "project": {
  38624. // "description": "Project ID for this request.",
  38625. // "location": "path",
  38626. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38627. // "required": true,
  38628. // "type": "string"
  38629. // }
  38630. // },
  38631. // "path": "{project}/global/operations",
  38632. // "response": {
  38633. // "$ref": "OperationList"
  38634. // },
  38635. // "scopes": [
  38636. // "https://www.googleapis.com/auth/cloud-platform",
  38637. // "https://www.googleapis.com/auth/compute",
  38638. // "https://www.googleapis.com/auth/compute.readonly"
  38639. // ]
  38640. // }
  38641. }
  38642. // Pages invokes f for each page of results.
  38643. // A non-nil error returned from f will halt the iteration.
  38644. // The provided context supersedes any context provided to the Context method.
  38645. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  38646. c.ctx_ = ctx
  38647. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38648. for {
  38649. x, err := c.Do()
  38650. if err != nil {
  38651. return err
  38652. }
  38653. if err := f(x); err != nil {
  38654. return err
  38655. }
  38656. if x.NextPageToken == "" {
  38657. return nil
  38658. }
  38659. c.PageToken(x.NextPageToken)
  38660. }
  38661. }
  38662. // method id "compute.healthChecks.delete":
  38663. type HealthChecksDeleteCall struct {
  38664. s *Service
  38665. project string
  38666. healthCheck string
  38667. urlParams_ gensupport.URLParams
  38668. ctx_ context.Context
  38669. header_ http.Header
  38670. }
  38671. // Delete: Deletes the specified HealthCheck resource.
  38672. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  38673. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38674. c.project = project
  38675. c.healthCheck = healthCheck
  38676. return c
  38677. }
  38678. // RequestId sets the optional parameter "requestId": An optional
  38679. // request ID to identify requests. Specify a unique request ID so that
  38680. // if you must retry your request, the server will know to ignore the
  38681. // request if it has already been completed.
  38682. //
  38683. // For example, consider a situation where you make an initial request
  38684. // and the request times out. If you make the request again with the
  38685. // same request ID, the server can check if original operation with the
  38686. // same request ID was received, and if so, will ignore the second
  38687. // request. This prevents clients from accidentally creating duplicate
  38688. // commitments.
  38689. //
  38690. // The request ID must be a valid UUID with the exception that zero UUID
  38691. // is not supported (00000000-0000-0000-0000-000000000000).
  38692. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  38693. c.urlParams_.Set("requestId", requestId)
  38694. return c
  38695. }
  38696. // Fields allows partial responses to be retrieved. See
  38697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38698. // for more information.
  38699. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  38700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38701. return c
  38702. }
  38703. // Context sets the context to be used in this call's Do method. Any
  38704. // pending HTTP request will be aborted if the provided context is
  38705. // canceled.
  38706. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  38707. c.ctx_ = ctx
  38708. return c
  38709. }
  38710. // Header returns an http.Header that can be modified by the caller to
  38711. // add HTTP headers to the request.
  38712. func (c *HealthChecksDeleteCall) Header() http.Header {
  38713. if c.header_ == nil {
  38714. c.header_ = make(http.Header)
  38715. }
  38716. return c.header_
  38717. }
  38718. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  38719. reqHeaders := make(http.Header)
  38720. for k, v := range c.header_ {
  38721. reqHeaders[k] = v
  38722. }
  38723. reqHeaders.Set("User-Agent", c.s.userAgent())
  38724. var body io.Reader = nil
  38725. c.urlParams_.Set("alt", alt)
  38726. c.urlParams_.Set("prettyPrint", "false")
  38727. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  38728. urls += "?" + c.urlParams_.Encode()
  38729. req, err := http.NewRequest("DELETE", urls, body)
  38730. if err != nil {
  38731. return nil, err
  38732. }
  38733. req.Header = reqHeaders
  38734. googleapi.Expand(req.URL, map[string]string{
  38735. "project": c.project,
  38736. "healthCheck": c.healthCheck,
  38737. })
  38738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38739. }
  38740. // Do executes the "compute.healthChecks.delete" call.
  38741. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38742. // status code is an error. Response headers are in either
  38743. // *Operation.ServerResponse.Header or (if a response was returned at
  38744. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38745. // to check whether the returned error was because
  38746. // http.StatusNotModified was returned.
  38747. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38748. gensupport.SetOptions(c.urlParams_, opts...)
  38749. res, err := c.doRequest("json")
  38750. if res != nil && res.StatusCode == http.StatusNotModified {
  38751. if res.Body != nil {
  38752. res.Body.Close()
  38753. }
  38754. return nil, &googleapi.Error{
  38755. Code: res.StatusCode,
  38756. Header: res.Header,
  38757. }
  38758. }
  38759. if err != nil {
  38760. return nil, err
  38761. }
  38762. defer googleapi.CloseBody(res)
  38763. if err := googleapi.CheckResponse(res); err != nil {
  38764. return nil, err
  38765. }
  38766. ret := &Operation{
  38767. ServerResponse: googleapi.ServerResponse{
  38768. Header: res.Header,
  38769. HTTPStatusCode: res.StatusCode,
  38770. },
  38771. }
  38772. target := &ret
  38773. if err := gensupport.DecodeResponse(target, res); err != nil {
  38774. return nil, err
  38775. }
  38776. return ret, nil
  38777. // {
  38778. // "description": "Deletes the specified HealthCheck resource.",
  38779. // "httpMethod": "DELETE",
  38780. // "id": "compute.healthChecks.delete",
  38781. // "parameterOrder": [
  38782. // "project",
  38783. // "healthCheck"
  38784. // ],
  38785. // "parameters": {
  38786. // "healthCheck": {
  38787. // "description": "Name of the HealthCheck resource to delete.",
  38788. // "location": "path",
  38789. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38790. // "required": true,
  38791. // "type": "string"
  38792. // },
  38793. // "project": {
  38794. // "description": "Project ID for this request.",
  38795. // "location": "path",
  38796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38797. // "required": true,
  38798. // "type": "string"
  38799. // },
  38800. // "requestId": {
  38801. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38802. // "location": "query",
  38803. // "type": "string"
  38804. // }
  38805. // },
  38806. // "path": "{project}/global/healthChecks/{healthCheck}",
  38807. // "response": {
  38808. // "$ref": "Operation"
  38809. // },
  38810. // "scopes": [
  38811. // "https://www.googleapis.com/auth/cloud-platform",
  38812. // "https://www.googleapis.com/auth/compute"
  38813. // ]
  38814. // }
  38815. }
  38816. // method id "compute.healthChecks.get":
  38817. type HealthChecksGetCall struct {
  38818. s *Service
  38819. project string
  38820. healthCheck string
  38821. urlParams_ gensupport.URLParams
  38822. ifNoneMatch_ string
  38823. ctx_ context.Context
  38824. header_ http.Header
  38825. }
  38826. // Get: Returns the specified HealthCheck resource. Gets a list of
  38827. // available health checks by making a list() request.
  38828. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  38829. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38830. c.project = project
  38831. c.healthCheck = healthCheck
  38832. return c
  38833. }
  38834. // Fields allows partial responses to be retrieved. See
  38835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38836. // for more information.
  38837. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  38838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38839. return c
  38840. }
  38841. // IfNoneMatch sets the optional parameter which makes the operation
  38842. // fail if the object's ETag matches the given value. This is useful for
  38843. // getting updates only after the object has changed since the last
  38844. // request. Use googleapi.IsNotModified to check whether the response
  38845. // error from Do is the result of In-None-Match.
  38846. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  38847. c.ifNoneMatch_ = entityTag
  38848. return c
  38849. }
  38850. // Context sets the context to be used in this call's Do method. Any
  38851. // pending HTTP request will be aborted if the provided context is
  38852. // canceled.
  38853. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  38854. c.ctx_ = ctx
  38855. return c
  38856. }
  38857. // Header returns an http.Header that can be modified by the caller to
  38858. // add HTTP headers to the request.
  38859. func (c *HealthChecksGetCall) Header() http.Header {
  38860. if c.header_ == nil {
  38861. c.header_ = make(http.Header)
  38862. }
  38863. return c.header_
  38864. }
  38865. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  38866. reqHeaders := make(http.Header)
  38867. for k, v := range c.header_ {
  38868. reqHeaders[k] = v
  38869. }
  38870. reqHeaders.Set("User-Agent", c.s.userAgent())
  38871. if c.ifNoneMatch_ != "" {
  38872. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38873. }
  38874. var body io.Reader = nil
  38875. c.urlParams_.Set("alt", alt)
  38876. c.urlParams_.Set("prettyPrint", "false")
  38877. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  38878. urls += "?" + c.urlParams_.Encode()
  38879. req, err := http.NewRequest("GET", urls, body)
  38880. if err != nil {
  38881. return nil, err
  38882. }
  38883. req.Header = reqHeaders
  38884. googleapi.Expand(req.URL, map[string]string{
  38885. "project": c.project,
  38886. "healthCheck": c.healthCheck,
  38887. })
  38888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38889. }
  38890. // Do executes the "compute.healthChecks.get" call.
  38891. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  38892. // status code is an error. Response headers are in either
  38893. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  38894. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38895. // to check whether the returned error was because
  38896. // http.StatusNotModified was returned.
  38897. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  38898. gensupport.SetOptions(c.urlParams_, opts...)
  38899. res, err := c.doRequest("json")
  38900. if res != nil && res.StatusCode == http.StatusNotModified {
  38901. if res.Body != nil {
  38902. res.Body.Close()
  38903. }
  38904. return nil, &googleapi.Error{
  38905. Code: res.StatusCode,
  38906. Header: res.Header,
  38907. }
  38908. }
  38909. if err != nil {
  38910. return nil, err
  38911. }
  38912. defer googleapi.CloseBody(res)
  38913. if err := googleapi.CheckResponse(res); err != nil {
  38914. return nil, err
  38915. }
  38916. ret := &HealthCheck{
  38917. ServerResponse: googleapi.ServerResponse{
  38918. Header: res.Header,
  38919. HTTPStatusCode: res.StatusCode,
  38920. },
  38921. }
  38922. target := &ret
  38923. if err := gensupport.DecodeResponse(target, res); err != nil {
  38924. return nil, err
  38925. }
  38926. return ret, nil
  38927. // {
  38928. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  38929. // "httpMethod": "GET",
  38930. // "id": "compute.healthChecks.get",
  38931. // "parameterOrder": [
  38932. // "project",
  38933. // "healthCheck"
  38934. // ],
  38935. // "parameters": {
  38936. // "healthCheck": {
  38937. // "description": "Name of the HealthCheck resource to return.",
  38938. // "location": "path",
  38939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38940. // "required": true,
  38941. // "type": "string"
  38942. // },
  38943. // "project": {
  38944. // "description": "Project ID for this request.",
  38945. // "location": "path",
  38946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38947. // "required": true,
  38948. // "type": "string"
  38949. // }
  38950. // },
  38951. // "path": "{project}/global/healthChecks/{healthCheck}",
  38952. // "response": {
  38953. // "$ref": "HealthCheck"
  38954. // },
  38955. // "scopes": [
  38956. // "https://www.googleapis.com/auth/cloud-platform",
  38957. // "https://www.googleapis.com/auth/compute",
  38958. // "https://www.googleapis.com/auth/compute.readonly"
  38959. // ]
  38960. // }
  38961. }
  38962. // method id "compute.healthChecks.insert":
  38963. type HealthChecksInsertCall struct {
  38964. s *Service
  38965. project string
  38966. healthcheck *HealthCheck
  38967. urlParams_ gensupport.URLParams
  38968. ctx_ context.Context
  38969. header_ http.Header
  38970. }
  38971. // Insert: Creates a HealthCheck resource in the specified project using
  38972. // the data included in the request.
  38973. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  38974. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38975. c.project = project
  38976. c.healthcheck = healthcheck
  38977. return c
  38978. }
  38979. // RequestId sets the optional parameter "requestId": An optional
  38980. // request ID to identify requests. Specify a unique request ID so that
  38981. // if you must retry your request, the server will know to ignore the
  38982. // request if it has already been completed.
  38983. //
  38984. // For example, consider a situation where you make an initial request
  38985. // and the request times out. If you make the request again with the
  38986. // same request ID, the server can check if original operation with the
  38987. // same request ID was received, and if so, will ignore the second
  38988. // request. This prevents clients from accidentally creating duplicate
  38989. // commitments.
  38990. //
  38991. // The request ID must be a valid UUID with the exception that zero UUID
  38992. // is not supported (00000000-0000-0000-0000-000000000000).
  38993. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  38994. c.urlParams_.Set("requestId", requestId)
  38995. return c
  38996. }
  38997. // Fields allows partial responses to be retrieved. See
  38998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38999. // for more information.
  39000. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  39001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39002. return c
  39003. }
  39004. // Context sets the context to be used in this call's Do method. Any
  39005. // pending HTTP request will be aborted if the provided context is
  39006. // canceled.
  39007. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  39008. c.ctx_ = ctx
  39009. return c
  39010. }
  39011. // Header returns an http.Header that can be modified by the caller to
  39012. // add HTTP headers to the request.
  39013. func (c *HealthChecksInsertCall) Header() http.Header {
  39014. if c.header_ == nil {
  39015. c.header_ = make(http.Header)
  39016. }
  39017. return c.header_
  39018. }
  39019. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  39020. reqHeaders := make(http.Header)
  39021. for k, v := range c.header_ {
  39022. reqHeaders[k] = v
  39023. }
  39024. reqHeaders.Set("User-Agent", c.s.userAgent())
  39025. var body io.Reader = nil
  39026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  39027. if err != nil {
  39028. return nil, err
  39029. }
  39030. reqHeaders.Set("Content-Type", "application/json")
  39031. c.urlParams_.Set("alt", alt)
  39032. c.urlParams_.Set("prettyPrint", "false")
  39033. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  39034. urls += "?" + c.urlParams_.Encode()
  39035. req, err := http.NewRequest("POST", urls, body)
  39036. if err != nil {
  39037. return nil, err
  39038. }
  39039. req.Header = reqHeaders
  39040. googleapi.Expand(req.URL, map[string]string{
  39041. "project": c.project,
  39042. })
  39043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39044. }
  39045. // Do executes the "compute.healthChecks.insert" call.
  39046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39047. // status code is an error. Response headers are in either
  39048. // *Operation.ServerResponse.Header or (if a response was returned at
  39049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39050. // to check whether the returned error was because
  39051. // http.StatusNotModified was returned.
  39052. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39053. gensupport.SetOptions(c.urlParams_, opts...)
  39054. res, err := c.doRequest("json")
  39055. if res != nil && res.StatusCode == http.StatusNotModified {
  39056. if res.Body != nil {
  39057. res.Body.Close()
  39058. }
  39059. return nil, &googleapi.Error{
  39060. Code: res.StatusCode,
  39061. Header: res.Header,
  39062. }
  39063. }
  39064. if err != nil {
  39065. return nil, err
  39066. }
  39067. defer googleapi.CloseBody(res)
  39068. if err := googleapi.CheckResponse(res); err != nil {
  39069. return nil, err
  39070. }
  39071. ret := &Operation{
  39072. ServerResponse: googleapi.ServerResponse{
  39073. Header: res.Header,
  39074. HTTPStatusCode: res.StatusCode,
  39075. },
  39076. }
  39077. target := &ret
  39078. if err := gensupport.DecodeResponse(target, res); err != nil {
  39079. return nil, err
  39080. }
  39081. return ret, nil
  39082. // {
  39083. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  39084. // "httpMethod": "POST",
  39085. // "id": "compute.healthChecks.insert",
  39086. // "parameterOrder": [
  39087. // "project"
  39088. // ],
  39089. // "parameters": {
  39090. // "project": {
  39091. // "description": "Project ID for this request.",
  39092. // "location": "path",
  39093. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39094. // "required": true,
  39095. // "type": "string"
  39096. // },
  39097. // "requestId": {
  39098. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39099. // "location": "query",
  39100. // "type": "string"
  39101. // }
  39102. // },
  39103. // "path": "{project}/global/healthChecks",
  39104. // "request": {
  39105. // "$ref": "HealthCheck"
  39106. // },
  39107. // "response": {
  39108. // "$ref": "Operation"
  39109. // },
  39110. // "scopes": [
  39111. // "https://www.googleapis.com/auth/cloud-platform",
  39112. // "https://www.googleapis.com/auth/compute"
  39113. // ]
  39114. // }
  39115. }
  39116. // method id "compute.healthChecks.list":
  39117. type HealthChecksListCall struct {
  39118. s *Service
  39119. project string
  39120. urlParams_ gensupport.URLParams
  39121. ifNoneMatch_ string
  39122. ctx_ context.Context
  39123. header_ http.Header
  39124. }
  39125. // List: Retrieves the list of HealthCheck resources available to the
  39126. // specified project.
  39127. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  39128. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39129. c.project = project
  39130. return c
  39131. }
  39132. // Filter sets the optional parameter "filter": A filter expression that
  39133. // filters resources listed in the response. The expression must specify
  39134. // the field name, a comparison operator, and the value that you want to
  39135. // use for filtering. The value must be a string, a number, or a
  39136. // boolean. The comparison operator must be either =, !=, >, or <.
  39137. //
  39138. // For example, if you are filtering Compute Engine instances, you can
  39139. // exclude instances named example-instance by specifying name !=
  39140. // example-instance.
  39141. //
  39142. // You can also filter nested fields. For example, you could specify
  39143. // scheduling.automaticRestart = false to include instances only if they
  39144. // are not scheduled for automatic restarts. You can use filtering on
  39145. // nested fields to filter based on resource labels.
  39146. //
  39147. // To filter on multiple expressions, provide each separate expression
  39148. // within parentheses. For example, (scheduling.automaticRestart = true)
  39149. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39150. // AND expression. However, you can include AND and OR expressions
  39151. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39152. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39153. // true).
  39154. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  39155. c.urlParams_.Set("filter", filter)
  39156. return c
  39157. }
  39158. // MaxResults sets the optional parameter "maxResults": The maximum
  39159. // number of results per page that should be returned. If the number of
  39160. // available results is larger than maxResults, Compute Engine returns a
  39161. // nextPageToken that can be used to get the next page of results in
  39162. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39163. // (Default: 500)
  39164. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  39165. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39166. return c
  39167. }
  39168. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39169. // a certain order. By default, results are returned in alphanumerical
  39170. // order based on the resource name.
  39171. //
  39172. // You can also sort results in descending order based on the creation
  39173. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39174. // based on the creationTimestamp field in reverse chronological order
  39175. // (newest result first). Use this to sort resources like operations so
  39176. // that the newest operation is returned first.
  39177. //
  39178. // Currently, only sorting by name or creationTimestamp desc is
  39179. // supported.
  39180. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  39181. c.urlParams_.Set("orderBy", orderBy)
  39182. return c
  39183. }
  39184. // PageToken sets the optional parameter "pageToken": Specifies a page
  39185. // token to use. Set pageToken to the nextPageToken returned by a
  39186. // previous list request to get the next page of results.
  39187. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  39188. c.urlParams_.Set("pageToken", pageToken)
  39189. return c
  39190. }
  39191. // Fields allows partial responses to be retrieved. See
  39192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39193. // for more information.
  39194. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  39195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39196. return c
  39197. }
  39198. // IfNoneMatch sets the optional parameter which makes the operation
  39199. // fail if the object's ETag matches the given value. This is useful for
  39200. // getting updates only after the object has changed since the last
  39201. // request. Use googleapi.IsNotModified to check whether the response
  39202. // error from Do is the result of In-None-Match.
  39203. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  39204. c.ifNoneMatch_ = entityTag
  39205. return c
  39206. }
  39207. // Context sets the context to be used in this call's Do method. Any
  39208. // pending HTTP request will be aborted if the provided context is
  39209. // canceled.
  39210. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  39211. c.ctx_ = ctx
  39212. return c
  39213. }
  39214. // Header returns an http.Header that can be modified by the caller to
  39215. // add HTTP headers to the request.
  39216. func (c *HealthChecksListCall) Header() http.Header {
  39217. if c.header_ == nil {
  39218. c.header_ = make(http.Header)
  39219. }
  39220. return c.header_
  39221. }
  39222. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  39223. reqHeaders := make(http.Header)
  39224. for k, v := range c.header_ {
  39225. reqHeaders[k] = v
  39226. }
  39227. reqHeaders.Set("User-Agent", c.s.userAgent())
  39228. if c.ifNoneMatch_ != "" {
  39229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39230. }
  39231. var body io.Reader = nil
  39232. c.urlParams_.Set("alt", alt)
  39233. c.urlParams_.Set("prettyPrint", "false")
  39234. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  39235. urls += "?" + c.urlParams_.Encode()
  39236. req, err := http.NewRequest("GET", urls, body)
  39237. if err != nil {
  39238. return nil, err
  39239. }
  39240. req.Header = reqHeaders
  39241. googleapi.Expand(req.URL, map[string]string{
  39242. "project": c.project,
  39243. })
  39244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39245. }
  39246. // Do executes the "compute.healthChecks.list" call.
  39247. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  39248. // status code is an error. Response headers are in either
  39249. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  39250. // at all) in error.(*googleapi.Error).Header. Use
  39251. // googleapi.IsNotModified to check whether the returned error was
  39252. // because http.StatusNotModified was returned.
  39253. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  39254. gensupport.SetOptions(c.urlParams_, opts...)
  39255. res, err := c.doRequest("json")
  39256. if res != nil && res.StatusCode == http.StatusNotModified {
  39257. if res.Body != nil {
  39258. res.Body.Close()
  39259. }
  39260. return nil, &googleapi.Error{
  39261. Code: res.StatusCode,
  39262. Header: res.Header,
  39263. }
  39264. }
  39265. if err != nil {
  39266. return nil, err
  39267. }
  39268. defer googleapi.CloseBody(res)
  39269. if err := googleapi.CheckResponse(res); err != nil {
  39270. return nil, err
  39271. }
  39272. ret := &HealthCheckList{
  39273. ServerResponse: googleapi.ServerResponse{
  39274. Header: res.Header,
  39275. HTTPStatusCode: res.StatusCode,
  39276. },
  39277. }
  39278. target := &ret
  39279. if err := gensupport.DecodeResponse(target, res); err != nil {
  39280. return nil, err
  39281. }
  39282. return ret, nil
  39283. // {
  39284. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  39285. // "httpMethod": "GET",
  39286. // "id": "compute.healthChecks.list",
  39287. // "parameterOrder": [
  39288. // "project"
  39289. // ],
  39290. // "parameters": {
  39291. // "filter": {
  39292. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39293. // "location": "query",
  39294. // "type": "string"
  39295. // },
  39296. // "maxResults": {
  39297. // "default": "500",
  39298. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39299. // "format": "uint32",
  39300. // "location": "query",
  39301. // "minimum": "0",
  39302. // "type": "integer"
  39303. // },
  39304. // "orderBy": {
  39305. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39306. // "location": "query",
  39307. // "type": "string"
  39308. // },
  39309. // "pageToken": {
  39310. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39311. // "location": "query",
  39312. // "type": "string"
  39313. // },
  39314. // "project": {
  39315. // "description": "Project ID for this request.",
  39316. // "location": "path",
  39317. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39318. // "required": true,
  39319. // "type": "string"
  39320. // }
  39321. // },
  39322. // "path": "{project}/global/healthChecks",
  39323. // "response": {
  39324. // "$ref": "HealthCheckList"
  39325. // },
  39326. // "scopes": [
  39327. // "https://www.googleapis.com/auth/cloud-platform",
  39328. // "https://www.googleapis.com/auth/compute",
  39329. // "https://www.googleapis.com/auth/compute.readonly"
  39330. // ]
  39331. // }
  39332. }
  39333. // Pages invokes f for each page of results.
  39334. // A non-nil error returned from f will halt the iteration.
  39335. // The provided context supersedes any context provided to the Context method.
  39336. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  39337. c.ctx_ = ctx
  39338. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39339. for {
  39340. x, err := c.Do()
  39341. if err != nil {
  39342. return err
  39343. }
  39344. if err := f(x); err != nil {
  39345. return err
  39346. }
  39347. if x.NextPageToken == "" {
  39348. return nil
  39349. }
  39350. c.PageToken(x.NextPageToken)
  39351. }
  39352. }
  39353. // method id "compute.healthChecks.patch":
  39354. type HealthChecksPatchCall struct {
  39355. s *Service
  39356. project string
  39357. healthCheck string
  39358. healthcheck *HealthCheck
  39359. urlParams_ gensupport.URLParams
  39360. ctx_ context.Context
  39361. header_ http.Header
  39362. }
  39363. // Patch: Updates a HealthCheck resource in the specified project using
  39364. // the data included in the request. This method supports PATCH
  39365. // semantics and uses the JSON merge patch format and processing rules.
  39366. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  39367. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39368. c.project = project
  39369. c.healthCheck = healthCheck
  39370. c.healthcheck = healthcheck
  39371. return c
  39372. }
  39373. // RequestId sets the optional parameter "requestId": An optional
  39374. // request ID to identify requests. Specify a unique request ID so that
  39375. // if you must retry your request, the server will know to ignore the
  39376. // request if it has already been completed.
  39377. //
  39378. // For example, consider a situation where you make an initial request
  39379. // and the request times out. If you make the request again with the
  39380. // same request ID, the server can check if original operation with the
  39381. // same request ID was received, and if so, will ignore the second
  39382. // request. This prevents clients from accidentally creating duplicate
  39383. // commitments.
  39384. //
  39385. // The request ID must be a valid UUID with the exception that zero UUID
  39386. // is not supported (00000000-0000-0000-0000-000000000000).
  39387. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  39388. c.urlParams_.Set("requestId", requestId)
  39389. return c
  39390. }
  39391. // Fields allows partial responses to be retrieved. See
  39392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39393. // for more information.
  39394. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  39395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39396. return c
  39397. }
  39398. // Context sets the context to be used in this call's Do method. Any
  39399. // pending HTTP request will be aborted if the provided context is
  39400. // canceled.
  39401. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  39402. c.ctx_ = ctx
  39403. return c
  39404. }
  39405. // Header returns an http.Header that can be modified by the caller to
  39406. // add HTTP headers to the request.
  39407. func (c *HealthChecksPatchCall) Header() http.Header {
  39408. if c.header_ == nil {
  39409. c.header_ = make(http.Header)
  39410. }
  39411. return c.header_
  39412. }
  39413. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  39414. reqHeaders := make(http.Header)
  39415. for k, v := range c.header_ {
  39416. reqHeaders[k] = v
  39417. }
  39418. reqHeaders.Set("User-Agent", c.s.userAgent())
  39419. var body io.Reader = nil
  39420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  39421. if err != nil {
  39422. return nil, err
  39423. }
  39424. reqHeaders.Set("Content-Type", "application/json")
  39425. c.urlParams_.Set("alt", alt)
  39426. c.urlParams_.Set("prettyPrint", "false")
  39427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  39428. urls += "?" + c.urlParams_.Encode()
  39429. req, err := http.NewRequest("PATCH", urls, body)
  39430. if err != nil {
  39431. return nil, err
  39432. }
  39433. req.Header = reqHeaders
  39434. googleapi.Expand(req.URL, map[string]string{
  39435. "project": c.project,
  39436. "healthCheck": c.healthCheck,
  39437. })
  39438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39439. }
  39440. // Do executes the "compute.healthChecks.patch" call.
  39441. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39442. // status code is an error. Response headers are in either
  39443. // *Operation.ServerResponse.Header or (if a response was returned at
  39444. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39445. // to check whether the returned error was because
  39446. // http.StatusNotModified was returned.
  39447. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39448. gensupport.SetOptions(c.urlParams_, opts...)
  39449. res, err := c.doRequest("json")
  39450. if res != nil && res.StatusCode == http.StatusNotModified {
  39451. if res.Body != nil {
  39452. res.Body.Close()
  39453. }
  39454. return nil, &googleapi.Error{
  39455. Code: res.StatusCode,
  39456. Header: res.Header,
  39457. }
  39458. }
  39459. if err != nil {
  39460. return nil, err
  39461. }
  39462. defer googleapi.CloseBody(res)
  39463. if err := googleapi.CheckResponse(res); err != nil {
  39464. return nil, err
  39465. }
  39466. ret := &Operation{
  39467. ServerResponse: googleapi.ServerResponse{
  39468. Header: res.Header,
  39469. HTTPStatusCode: res.StatusCode,
  39470. },
  39471. }
  39472. target := &ret
  39473. if err := gensupport.DecodeResponse(target, res); err != nil {
  39474. return nil, err
  39475. }
  39476. return ret, nil
  39477. // {
  39478. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  39479. // "httpMethod": "PATCH",
  39480. // "id": "compute.healthChecks.patch",
  39481. // "parameterOrder": [
  39482. // "project",
  39483. // "healthCheck"
  39484. // ],
  39485. // "parameters": {
  39486. // "healthCheck": {
  39487. // "description": "Name of the HealthCheck resource to patch.",
  39488. // "location": "path",
  39489. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39490. // "required": true,
  39491. // "type": "string"
  39492. // },
  39493. // "project": {
  39494. // "description": "Project ID for this request.",
  39495. // "location": "path",
  39496. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39497. // "required": true,
  39498. // "type": "string"
  39499. // },
  39500. // "requestId": {
  39501. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39502. // "location": "query",
  39503. // "type": "string"
  39504. // }
  39505. // },
  39506. // "path": "{project}/global/healthChecks/{healthCheck}",
  39507. // "request": {
  39508. // "$ref": "HealthCheck"
  39509. // },
  39510. // "response": {
  39511. // "$ref": "Operation"
  39512. // },
  39513. // "scopes": [
  39514. // "https://www.googleapis.com/auth/cloud-platform",
  39515. // "https://www.googleapis.com/auth/compute"
  39516. // ]
  39517. // }
  39518. }
  39519. // method id "compute.healthChecks.update":
  39520. type HealthChecksUpdateCall struct {
  39521. s *Service
  39522. project string
  39523. healthCheck string
  39524. healthcheck *HealthCheck
  39525. urlParams_ gensupport.URLParams
  39526. ctx_ context.Context
  39527. header_ http.Header
  39528. }
  39529. // Update: Updates a HealthCheck resource in the specified project using
  39530. // the data included in the request.
  39531. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  39532. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39533. c.project = project
  39534. c.healthCheck = healthCheck
  39535. c.healthcheck = healthcheck
  39536. return c
  39537. }
  39538. // RequestId sets the optional parameter "requestId": An optional
  39539. // request ID to identify requests. Specify a unique request ID so that
  39540. // if you must retry your request, the server will know to ignore the
  39541. // request if it has already been completed.
  39542. //
  39543. // For example, consider a situation where you make an initial request
  39544. // and the request times out. If you make the request again with the
  39545. // same request ID, the server can check if original operation with the
  39546. // same request ID was received, and if so, will ignore the second
  39547. // request. This prevents clients from accidentally creating duplicate
  39548. // commitments.
  39549. //
  39550. // The request ID must be a valid UUID with the exception that zero UUID
  39551. // is not supported (00000000-0000-0000-0000-000000000000).
  39552. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  39553. c.urlParams_.Set("requestId", requestId)
  39554. return c
  39555. }
  39556. // Fields allows partial responses to be retrieved. See
  39557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39558. // for more information.
  39559. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  39560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39561. return c
  39562. }
  39563. // Context sets the context to be used in this call's Do method. Any
  39564. // pending HTTP request will be aborted if the provided context is
  39565. // canceled.
  39566. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  39567. c.ctx_ = ctx
  39568. return c
  39569. }
  39570. // Header returns an http.Header that can be modified by the caller to
  39571. // add HTTP headers to the request.
  39572. func (c *HealthChecksUpdateCall) Header() http.Header {
  39573. if c.header_ == nil {
  39574. c.header_ = make(http.Header)
  39575. }
  39576. return c.header_
  39577. }
  39578. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  39579. reqHeaders := make(http.Header)
  39580. for k, v := range c.header_ {
  39581. reqHeaders[k] = v
  39582. }
  39583. reqHeaders.Set("User-Agent", c.s.userAgent())
  39584. var body io.Reader = nil
  39585. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  39586. if err != nil {
  39587. return nil, err
  39588. }
  39589. reqHeaders.Set("Content-Type", "application/json")
  39590. c.urlParams_.Set("alt", alt)
  39591. c.urlParams_.Set("prettyPrint", "false")
  39592. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  39593. urls += "?" + c.urlParams_.Encode()
  39594. req, err := http.NewRequest("PUT", urls, body)
  39595. if err != nil {
  39596. return nil, err
  39597. }
  39598. req.Header = reqHeaders
  39599. googleapi.Expand(req.URL, map[string]string{
  39600. "project": c.project,
  39601. "healthCheck": c.healthCheck,
  39602. })
  39603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39604. }
  39605. // Do executes the "compute.healthChecks.update" call.
  39606. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39607. // status code is an error. Response headers are in either
  39608. // *Operation.ServerResponse.Header or (if a response was returned at
  39609. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39610. // to check whether the returned error was because
  39611. // http.StatusNotModified was returned.
  39612. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39613. gensupport.SetOptions(c.urlParams_, opts...)
  39614. res, err := c.doRequest("json")
  39615. if res != nil && res.StatusCode == http.StatusNotModified {
  39616. if res.Body != nil {
  39617. res.Body.Close()
  39618. }
  39619. return nil, &googleapi.Error{
  39620. Code: res.StatusCode,
  39621. Header: res.Header,
  39622. }
  39623. }
  39624. if err != nil {
  39625. return nil, err
  39626. }
  39627. defer googleapi.CloseBody(res)
  39628. if err := googleapi.CheckResponse(res); err != nil {
  39629. return nil, err
  39630. }
  39631. ret := &Operation{
  39632. ServerResponse: googleapi.ServerResponse{
  39633. Header: res.Header,
  39634. HTTPStatusCode: res.StatusCode,
  39635. },
  39636. }
  39637. target := &ret
  39638. if err := gensupport.DecodeResponse(target, res); err != nil {
  39639. return nil, err
  39640. }
  39641. return ret, nil
  39642. // {
  39643. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  39644. // "httpMethod": "PUT",
  39645. // "id": "compute.healthChecks.update",
  39646. // "parameterOrder": [
  39647. // "project",
  39648. // "healthCheck"
  39649. // ],
  39650. // "parameters": {
  39651. // "healthCheck": {
  39652. // "description": "Name of the HealthCheck resource to update.",
  39653. // "location": "path",
  39654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39655. // "required": true,
  39656. // "type": "string"
  39657. // },
  39658. // "project": {
  39659. // "description": "Project ID for this request.",
  39660. // "location": "path",
  39661. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39662. // "required": true,
  39663. // "type": "string"
  39664. // },
  39665. // "requestId": {
  39666. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39667. // "location": "query",
  39668. // "type": "string"
  39669. // }
  39670. // },
  39671. // "path": "{project}/global/healthChecks/{healthCheck}",
  39672. // "request": {
  39673. // "$ref": "HealthCheck"
  39674. // },
  39675. // "response": {
  39676. // "$ref": "Operation"
  39677. // },
  39678. // "scopes": [
  39679. // "https://www.googleapis.com/auth/cloud-platform",
  39680. // "https://www.googleapis.com/auth/compute"
  39681. // ]
  39682. // }
  39683. }
  39684. // method id "compute.httpHealthChecks.delete":
  39685. type HttpHealthChecksDeleteCall struct {
  39686. s *Service
  39687. project string
  39688. httpHealthCheck string
  39689. urlParams_ gensupport.URLParams
  39690. ctx_ context.Context
  39691. header_ http.Header
  39692. }
  39693. // Delete: Deletes the specified HttpHealthCheck resource.
  39694. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  39695. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  39696. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39697. c.project = project
  39698. c.httpHealthCheck = httpHealthCheck
  39699. return c
  39700. }
  39701. // RequestId sets the optional parameter "requestId": An optional
  39702. // request ID to identify requests. Specify a unique request ID so that
  39703. // if you must retry your request, the server will know to ignore the
  39704. // request if it has already been completed.
  39705. //
  39706. // For example, consider a situation where you make an initial request
  39707. // and the request times out. If you make the request again with the
  39708. // same request ID, the server can check if original operation with the
  39709. // same request ID was received, and if so, will ignore the second
  39710. // request. This prevents clients from accidentally creating duplicate
  39711. // commitments.
  39712. //
  39713. // The request ID must be a valid UUID with the exception that zero UUID
  39714. // is not supported (00000000-0000-0000-0000-000000000000).
  39715. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  39716. c.urlParams_.Set("requestId", requestId)
  39717. return c
  39718. }
  39719. // Fields allows partial responses to be retrieved. See
  39720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39721. // for more information.
  39722. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  39723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39724. return c
  39725. }
  39726. // Context sets the context to be used in this call's Do method. Any
  39727. // pending HTTP request will be aborted if the provided context is
  39728. // canceled.
  39729. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  39730. c.ctx_ = ctx
  39731. return c
  39732. }
  39733. // Header returns an http.Header that can be modified by the caller to
  39734. // add HTTP headers to the request.
  39735. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  39736. if c.header_ == nil {
  39737. c.header_ = make(http.Header)
  39738. }
  39739. return c.header_
  39740. }
  39741. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  39742. reqHeaders := make(http.Header)
  39743. for k, v := range c.header_ {
  39744. reqHeaders[k] = v
  39745. }
  39746. reqHeaders.Set("User-Agent", c.s.userAgent())
  39747. var body io.Reader = nil
  39748. c.urlParams_.Set("alt", alt)
  39749. c.urlParams_.Set("prettyPrint", "false")
  39750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  39751. urls += "?" + c.urlParams_.Encode()
  39752. req, err := http.NewRequest("DELETE", urls, body)
  39753. if err != nil {
  39754. return nil, err
  39755. }
  39756. req.Header = reqHeaders
  39757. googleapi.Expand(req.URL, map[string]string{
  39758. "project": c.project,
  39759. "httpHealthCheck": c.httpHealthCheck,
  39760. })
  39761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39762. }
  39763. // Do executes the "compute.httpHealthChecks.delete" call.
  39764. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39765. // status code is an error. Response headers are in either
  39766. // *Operation.ServerResponse.Header or (if a response was returned at
  39767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39768. // to check whether the returned error was because
  39769. // http.StatusNotModified was returned.
  39770. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39771. gensupport.SetOptions(c.urlParams_, opts...)
  39772. res, err := c.doRequest("json")
  39773. if res != nil && res.StatusCode == http.StatusNotModified {
  39774. if res.Body != nil {
  39775. res.Body.Close()
  39776. }
  39777. return nil, &googleapi.Error{
  39778. Code: res.StatusCode,
  39779. Header: res.Header,
  39780. }
  39781. }
  39782. if err != nil {
  39783. return nil, err
  39784. }
  39785. defer googleapi.CloseBody(res)
  39786. if err := googleapi.CheckResponse(res); err != nil {
  39787. return nil, err
  39788. }
  39789. ret := &Operation{
  39790. ServerResponse: googleapi.ServerResponse{
  39791. Header: res.Header,
  39792. HTTPStatusCode: res.StatusCode,
  39793. },
  39794. }
  39795. target := &ret
  39796. if err := gensupport.DecodeResponse(target, res); err != nil {
  39797. return nil, err
  39798. }
  39799. return ret, nil
  39800. // {
  39801. // "description": "Deletes the specified HttpHealthCheck resource.",
  39802. // "httpMethod": "DELETE",
  39803. // "id": "compute.httpHealthChecks.delete",
  39804. // "parameterOrder": [
  39805. // "project",
  39806. // "httpHealthCheck"
  39807. // ],
  39808. // "parameters": {
  39809. // "httpHealthCheck": {
  39810. // "description": "Name of the HttpHealthCheck resource to delete.",
  39811. // "location": "path",
  39812. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39813. // "required": true,
  39814. // "type": "string"
  39815. // },
  39816. // "project": {
  39817. // "description": "Project ID for this request.",
  39818. // "location": "path",
  39819. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39820. // "required": true,
  39821. // "type": "string"
  39822. // },
  39823. // "requestId": {
  39824. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39825. // "location": "query",
  39826. // "type": "string"
  39827. // }
  39828. // },
  39829. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  39830. // "response": {
  39831. // "$ref": "Operation"
  39832. // },
  39833. // "scopes": [
  39834. // "https://www.googleapis.com/auth/cloud-platform",
  39835. // "https://www.googleapis.com/auth/compute"
  39836. // ]
  39837. // }
  39838. }
  39839. // method id "compute.httpHealthChecks.get":
  39840. type HttpHealthChecksGetCall struct {
  39841. s *Service
  39842. project string
  39843. httpHealthCheck string
  39844. urlParams_ gensupport.URLParams
  39845. ifNoneMatch_ string
  39846. ctx_ context.Context
  39847. header_ http.Header
  39848. }
  39849. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  39850. // available HTTP health checks by making a list() request.
  39851. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  39852. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  39853. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39854. c.project = project
  39855. c.httpHealthCheck = httpHealthCheck
  39856. return c
  39857. }
  39858. // Fields allows partial responses to be retrieved. See
  39859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39860. // for more information.
  39861. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  39862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39863. return c
  39864. }
  39865. // IfNoneMatch sets the optional parameter which makes the operation
  39866. // fail if the object's ETag matches the given value. This is useful for
  39867. // getting updates only after the object has changed since the last
  39868. // request. Use googleapi.IsNotModified to check whether the response
  39869. // error from Do is the result of In-None-Match.
  39870. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  39871. c.ifNoneMatch_ = entityTag
  39872. return c
  39873. }
  39874. // Context sets the context to be used in this call's Do method. Any
  39875. // pending HTTP request will be aborted if the provided context is
  39876. // canceled.
  39877. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  39878. c.ctx_ = ctx
  39879. return c
  39880. }
  39881. // Header returns an http.Header that can be modified by the caller to
  39882. // add HTTP headers to the request.
  39883. func (c *HttpHealthChecksGetCall) Header() http.Header {
  39884. if c.header_ == nil {
  39885. c.header_ = make(http.Header)
  39886. }
  39887. return c.header_
  39888. }
  39889. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  39890. reqHeaders := make(http.Header)
  39891. for k, v := range c.header_ {
  39892. reqHeaders[k] = v
  39893. }
  39894. reqHeaders.Set("User-Agent", c.s.userAgent())
  39895. if c.ifNoneMatch_ != "" {
  39896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39897. }
  39898. var body io.Reader = nil
  39899. c.urlParams_.Set("alt", alt)
  39900. c.urlParams_.Set("prettyPrint", "false")
  39901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  39902. urls += "?" + c.urlParams_.Encode()
  39903. req, err := http.NewRequest("GET", urls, body)
  39904. if err != nil {
  39905. return nil, err
  39906. }
  39907. req.Header = reqHeaders
  39908. googleapi.Expand(req.URL, map[string]string{
  39909. "project": c.project,
  39910. "httpHealthCheck": c.httpHealthCheck,
  39911. })
  39912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39913. }
  39914. // Do executes the "compute.httpHealthChecks.get" call.
  39915. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  39916. // status code is an error. Response headers are in either
  39917. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  39918. // at all) in error.(*googleapi.Error).Header. Use
  39919. // googleapi.IsNotModified to check whether the returned error was
  39920. // because http.StatusNotModified was returned.
  39921. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  39922. gensupport.SetOptions(c.urlParams_, opts...)
  39923. res, err := c.doRequest("json")
  39924. if res != nil && res.StatusCode == http.StatusNotModified {
  39925. if res.Body != nil {
  39926. res.Body.Close()
  39927. }
  39928. return nil, &googleapi.Error{
  39929. Code: res.StatusCode,
  39930. Header: res.Header,
  39931. }
  39932. }
  39933. if err != nil {
  39934. return nil, err
  39935. }
  39936. defer googleapi.CloseBody(res)
  39937. if err := googleapi.CheckResponse(res); err != nil {
  39938. return nil, err
  39939. }
  39940. ret := &HttpHealthCheck{
  39941. ServerResponse: googleapi.ServerResponse{
  39942. Header: res.Header,
  39943. HTTPStatusCode: res.StatusCode,
  39944. },
  39945. }
  39946. target := &ret
  39947. if err := gensupport.DecodeResponse(target, res); err != nil {
  39948. return nil, err
  39949. }
  39950. return ret, nil
  39951. // {
  39952. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  39953. // "httpMethod": "GET",
  39954. // "id": "compute.httpHealthChecks.get",
  39955. // "parameterOrder": [
  39956. // "project",
  39957. // "httpHealthCheck"
  39958. // ],
  39959. // "parameters": {
  39960. // "httpHealthCheck": {
  39961. // "description": "Name of the HttpHealthCheck resource to return.",
  39962. // "location": "path",
  39963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39964. // "required": true,
  39965. // "type": "string"
  39966. // },
  39967. // "project": {
  39968. // "description": "Project ID for this request.",
  39969. // "location": "path",
  39970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39971. // "required": true,
  39972. // "type": "string"
  39973. // }
  39974. // },
  39975. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  39976. // "response": {
  39977. // "$ref": "HttpHealthCheck"
  39978. // },
  39979. // "scopes": [
  39980. // "https://www.googleapis.com/auth/cloud-platform",
  39981. // "https://www.googleapis.com/auth/compute",
  39982. // "https://www.googleapis.com/auth/compute.readonly"
  39983. // ]
  39984. // }
  39985. }
  39986. // method id "compute.httpHealthChecks.insert":
  39987. type HttpHealthChecksInsertCall struct {
  39988. s *Service
  39989. project string
  39990. httphealthcheck *HttpHealthCheck
  39991. urlParams_ gensupport.URLParams
  39992. ctx_ context.Context
  39993. header_ http.Header
  39994. }
  39995. // Insert: Creates a HttpHealthCheck resource in the specified project
  39996. // using the data included in the request.
  39997. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  39998. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  39999. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40000. c.project = project
  40001. c.httphealthcheck = httphealthcheck
  40002. return c
  40003. }
  40004. // RequestId sets the optional parameter "requestId": An optional
  40005. // request ID to identify requests. Specify a unique request ID so that
  40006. // if you must retry your request, the server will know to ignore the
  40007. // request if it has already been completed.
  40008. //
  40009. // For example, consider a situation where you make an initial request
  40010. // and the request times out. If you make the request again with the
  40011. // same request ID, the server can check if original operation with the
  40012. // same request ID was received, and if so, will ignore the second
  40013. // request. This prevents clients from accidentally creating duplicate
  40014. // commitments.
  40015. //
  40016. // The request ID must be a valid UUID with the exception that zero UUID
  40017. // is not supported (00000000-0000-0000-0000-000000000000).
  40018. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  40019. c.urlParams_.Set("requestId", requestId)
  40020. return c
  40021. }
  40022. // Fields allows partial responses to be retrieved. See
  40023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40024. // for more information.
  40025. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  40026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40027. return c
  40028. }
  40029. // Context sets the context to be used in this call's Do method. Any
  40030. // pending HTTP request will be aborted if the provided context is
  40031. // canceled.
  40032. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  40033. c.ctx_ = ctx
  40034. return c
  40035. }
  40036. // Header returns an http.Header that can be modified by the caller to
  40037. // add HTTP headers to the request.
  40038. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  40039. if c.header_ == nil {
  40040. c.header_ = make(http.Header)
  40041. }
  40042. return c.header_
  40043. }
  40044. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  40045. reqHeaders := make(http.Header)
  40046. for k, v := range c.header_ {
  40047. reqHeaders[k] = v
  40048. }
  40049. reqHeaders.Set("User-Agent", c.s.userAgent())
  40050. var body io.Reader = nil
  40051. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  40052. if err != nil {
  40053. return nil, err
  40054. }
  40055. reqHeaders.Set("Content-Type", "application/json")
  40056. c.urlParams_.Set("alt", alt)
  40057. c.urlParams_.Set("prettyPrint", "false")
  40058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  40059. urls += "?" + c.urlParams_.Encode()
  40060. req, err := http.NewRequest("POST", urls, body)
  40061. if err != nil {
  40062. return nil, err
  40063. }
  40064. req.Header = reqHeaders
  40065. googleapi.Expand(req.URL, map[string]string{
  40066. "project": c.project,
  40067. })
  40068. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40069. }
  40070. // Do executes the "compute.httpHealthChecks.insert" call.
  40071. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40072. // status code is an error. Response headers are in either
  40073. // *Operation.ServerResponse.Header or (if a response was returned at
  40074. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40075. // to check whether the returned error was because
  40076. // http.StatusNotModified was returned.
  40077. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40078. gensupport.SetOptions(c.urlParams_, opts...)
  40079. res, err := c.doRequest("json")
  40080. if res != nil && res.StatusCode == http.StatusNotModified {
  40081. if res.Body != nil {
  40082. res.Body.Close()
  40083. }
  40084. return nil, &googleapi.Error{
  40085. Code: res.StatusCode,
  40086. Header: res.Header,
  40087. }
  40088. }
  40089. if err != nil {
  40090. return nil, err
  40091. }
  40092. defer googleapi.CloseBody(res)
  40093. if err := googleapi.CheckResponse(res); err != nil {
  40094. return nil, err
  40095. }
  40096. ret := &Operation{
  40097. ServerResponse: googleapi.ServerResponse{
  40098. Header: res.Header,
  40099. HTTPStatusCode: res.StatusCode,
  40100. },
  40101. }
  40102. target := &ret
  40103. if err := gensupport.DecodeResponse(target, res); err != nil {
  40104. return nil, err
  40105. }
  40106. return ret, nil
  40107. // {
  40108. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  40109. // "httpMethod": "POST",
  40110. // "id": "compute.httpHealthChecks.insert",
  40111. // "parameterOrder": [
  40112. // "project"
  40113. // ],
  40114. // "parameters": {
  40115. // "project": {
  40116. // "description": "Project ID for this request.",
  40117. // "location": "path",
  40118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40119. // "required": true,
  40120. // "type": "string"
  40121. // },
  40122. // "requestId": {
  40123. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40124. // "location": "query",
  40125. // "type": "string"
  40126. // }
  40127. // },
  40128. // "path": "{project}/global/httpHealthChecks",
  40129. // "request": {
  40130. // "$ref": "HttpHealthCheck"
  40131. // },
  40132. // "response": {
  40133. // "$ref": "Operation"
  40134. // },
  40135. // "scopes": [
  40136. // "https://www.googleapis.com/auth/cloud-platform",
  40137. // "https://www.googleapis.com/auth/compute"
  40138. // ]
  40139. // }
  40140. }
  40141. // method id "compute.httpHealthChecks.list":
  40142. type HttpHealthChecksListCall struct {
  40143. s *Service
  40144. project string
  40145. urlParams_ gensupport.URLParams
  40146. ifNoneMatch_ string
  40147. ctx_ context.Context
  40148. header_ http.Header
  40149. }
  40150. // List: Retrieves the list of HttpHealthCheck resources available to
  40151. // the specified project.
  40152. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  40153. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  40154. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40155. c.project = project
  40156. return c
  40157. }
  40158. // Filter sets the optional parameter "filter": A filter expression that
  40159. // filters resources listed in the response. The expression must specify
  40160. // the field name, a comparison operator, and the value that you want to
  40161. // use for filtering. The value must be a string, a number, or a
  40162. // boolean. The comparison operator must be either =, !=, >, or <.
  40163. //
  40164. // For example, if you are filtering Compute Engine instances, you can
  40165. // exclude instances named example-instance by specifying name !=
  40166. // example-instance.
  40167. //
  40168. // You can also filter nested fields. For example, you could specify
  40169. // scheduling.automaticRestart = false to include instances only if they
  40170. // are not scheduled for automatic restarts. You can use filtering on
  40171. // nested fields to filter based on resource labels.
  40172. //
  40173. // To filter on multiple expressions, provide each separate expression
  40174. // within parentheses. For example, (scheduling.automaticRestart = true)
  40175. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40176. // AND expression. However, you can include AND and OR expressions
  40177. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40178. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40179. // true).
  40180. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  40181. c.urlParams_.Set("filter", filter)
  40182. return c
  40183. }
  40184. // MaxResults sets the optional parameter "maxResults": The maximum
  40185. // number of results per page that should be returned. If the number of
  40186. // available results is larger than maxResults, Compute Engine returns a
  40187. // nextPageToken that can be used to get the next page of results in
  40188. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40189. // (Default: 500)
  40190. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  40191. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40192. return c
  40193. }
  40194. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40195. // a certain order. By default, results are returned in alphanumerical
  40196. // order based on the resource name.
  40197. //
  40198. // You can also sort results in descending order based on the creation
  40199. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40200. // based on the creationTimestamp field in reverse chronological order
  40201. // (newest result first). Use this to sort resources like operations so
  40202. // that the newest operation is returned first.
  40203. //
  40204. // Currently, only sorting by name or creationTimestamp desc is
  40205. // supported.
  40206. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  40207. c.urlParams_.Set("orderBy", orderBy)
  40208. return c
  40209. }
  40210. // PageToken sets the optional parameter "pageToken": Specifies a page
  40211. // token to use. Set pageToken to the nextPageToken returned by a
  40212. // previous list request to get the next page of results.
  40213. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  40214. c.urlParams_.Set("pageToken", pageToken)
  40215. return c
  40216. }
  40217. // Fields allows partial responses to be retrieved. See
  40218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40219. // for more information.
  40220. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  40221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40222. return c
  40223. }
  40224. // IfNoneMatch sets the optional parameter which makes the operation
  40225. // fail if the object's ETag matches the given value. This is useful for
  40226. // getting updates only after the object has changed since the last
  40227. // request. Use googleapi.IsNotModified to check whether the response
  40228. // error from Do is the result of In-None-Match.
  40229. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  40230. c.ifNoneMatch_ = entityTag
  40231. return c
  40232. }
  40233. // Context sets the context to be used in this call's Do method. Any
  40234. // pending HTTP request will be aborted if the provided context is
  40235. // canceled.
  40236. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  40237. c.ctx_ = ctx
  40238. return c
  40239. }
  40240. // Header returns an http.Header that can be modified by the caller to
  40241. // add HTTP headers to the request.
  40242. func (c *HttpHealthChecksListCall) Header() http.Header {
  40243. if c.header_ == nil {
  40244. c.header_ = make(http.Header)
  40245. }
  40246. return c.header_
  40247. }
  40248. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  40249. reqHeaders := make(http.Header)
  40250. for k, v := range c.header_ {
  40251. reqHeaders[k] = v
  40252. }
  40253. reqHeaders.Set("User-Agent", c.s.userAgent())
  40254. if c.ifNoneMatch_ != "" {
  40255. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40256. }
  40257. var body io.Reader = nil
  40258. c.urlParams_.Set("alt", alt)
  40259. c.urlParams_.Set("prettyPrint", "false")
  40260. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  40261. urls += "?" + c.urlParams_.Encode()
  40262. req, err := http.NewRequest("GET", urls, body)
  40263. if err != nil {
  40264. return nil, err
  40265. }
  40266. req.Header = reqHeaders
  40267. googleapi.Expand(req.URL, map[string]string{
  40268. "project": c.project,
  40269. })
  40270. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40271. }
  40272. // Do executes the "compute.httpHealthChecks.list" call.
  40273. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  40274. // non-2xx status code is an error. Response headers are in either
  40275. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  40276. // returned at all) in error.(*googleapi.Error).Header. Use
  40277. // googleapi.IsNotModified to check whether the returned error was
  40278. // because http.StatusNotModified was returned.
  40279. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  40280. gensupport.SetOptions(c.urlParams_, opts...)
  40281. res, err := c.doRequest("json")
  40282. if res != nil && res.StatusCode == http.StatusNotModified {
  40283. if res.Body != nil {
  40284. res.Body.Close()
  40285. }
  40286. return nil, &googleapi.Error{
  40287. Code: res.StatusCode,
  40288. Header: res.Header,
  40289. }
  40290. }
  40291. if err != nil {
  40292. return nil, err
  40293. }
  40294. defer googleapi.CloseBody(res)
  40295. if err := googleapi.CheckResponse(res); err != nil {
  40296. return nil, err
  40297. }
  40298. ret := &HttpHealthCheckList{
  40299. ServerResponse: googleapi.ServerResponse{
  40300. Header: res.Header,
  40301. HTTPStatusCode: res.StatusCode,
  40302. },
  40303. }
  40304. target := &ret
  40305. if err := gensupport.DecodeResponse(target, res); err != nil {
  40306. return nil, err
  40307. }
  40308. return ret, nil
  40309. // {
  40310. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  40311. // "httpMethod": "GET",
  40312. // "id": "compute.httpHealthChecks.list",
  40313. // "parameterOrder": [
  40314. // "project"
  40315. // ],
  40316. // "parameters": {
  40317. // "filter": {
  40318. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40319. // "location": "query",
  40320. // "type": "string"
  40321. // },
  40322. // "maxResults": {
  40323. // "default": "500",
  40324. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40325. // "format": "uint32",
  40326. // "location": "query",
  40327. // "minimum": "0",
  40328. // "type": "integer"
  40329. // },
  40330. // "orderBy": {
  40331. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40332. // "location": "query",
  40333. // "type": "string"
  40334. // },
  40335. // "pageToken": {
  40336. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40337. // "location": "query",
  40338. // "type": "string"
  40339. // },
  40340. // "project": {
  40341. // "description": "Project ID for this request.",
  40342. // "location": "path",
  40343. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40344. // "required": true,
  40345. // "type": "string"
  40346. // }
  40347. // },
  40348. // "path": "{project}/global/httpHealthChecks",
  40349. // "response": {
  40350. // "$ref": "HttpHealthCheckList"
  40351. // },
  40352. // "scopes": [
  40353. // "https://www.googleapis.com/auth/cloud-platform",
  40354. // "https://www.googleapis.com/auth/compute",
  40355. // "https://www.googleapis.com/auth/compute.readonly"
  40356. // ]
  40357. // }
  40358. }
  40359. // Pages invokes f for each page of results.
  40360. // A non-nil error returned from f will halt the iteration.
  40361. // The provided context supersedes any context provided to the Context method.
  40362. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  40363. c.ctx_ = ctx
  40364. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40365. for {
  40366. x, err := c.Do()
  40367. if err != nil {
  40368. return err
  40369. }
  40370. if err := f(x); err != nil {
  40371. return err
  40372. }
  40373. if x.NextPageToken == "" {
  40374. return nil
  40375. }
  40376. c.PageToken(x.NextPageToken)
  40377. }
  40378. }
  40379. // method id "compute.httpHealthChecks.patch":
  40380. type HttpHealthChecksPatchCall struct {
  40381. s *Service
  40382. project string
  40383. httpHealthCheck string
  40384. httphealthcheck *HttpHealthCheck
  40385. urlParams_ gensupport.URLParams
  40386. ctx_ context.Context
  40387. header_ http.Header
  40388. }
  40389. // Patch: Updates a HttpHealthCheck resource in the specified project
  40390. // using the data included in the request. This method supports PATCH
  40391. // semantics and uses the JSON merge patch format and processing rules.
  40392. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  40393. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  40394. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40395. c.project = project
  40396. c.httpHealthCheck = httpHealthCheck
  40397. c.httphealthcheck = httphealthcheck
  40398. return c
  40399. }
  40400. // RequestId sets the optional parameter "requestId": An optional
  40401. // request ID to identify requests. Specify a unique request ID so that
  40402. // if you must retry your request, the server will know to ignore the
  40403. // request if it has already been completed.
  40404. //
  40405. // For example, consider a situation where you make an initial request
  40406. // and the request times out. If you make the request again with the
  40407. // same request ID, the server can check if original operation with the
  40408. // same request ID was received, and if so, will ignore the second
  40409. // request. This prevents clients from accidentally creating duplicate
  40410. // commitments.
  40411. //
  40412. // The request ID must be a valid UUID with the exception that zero UUID
  40413. // is not supported (00000000-0000-0000-0000-000000000000).
  40414. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  40415. c.urlParams_.Set("requestId", requestId)
  40416. return c
  40417. }
  40418. // Fields allows partial responses to be retrieved. See
  40419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40420. // for more information.
  40421. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  40422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40423. return c
  40424. }
  40425. // Context sets the context to be used in this call's Do method. Any
  40426. // pending HTTP request will be aborted if the provided context is
  40427. // canceled.
  40428. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  40429. c.ctx_ = ctx
  40430. return c
  40431. }
  40432. // Header returns an http.Header that can be modified by the caller to
  40433. // add HTTP headers to the request.
  40434. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  40435. if c.header_ == nil {
  40436. c.header_ = make(http.Header)
  40437. }
  40438. return c.header_
  40439. }
  40440. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  40441. reqHeaders := make(http.Header)
  40442. for k, v := range c.header_ {
  40443. reqHeaders[k] = v
  40444. }
  40445. reqHeaders.Set("User-Agent", c.s.userAgent())
  40446. var body io.Reader = nil
  40447. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  40448. if err != nil {
  40449. return nil, err
  40450. }
  40451. reqHeaders.Set("Content-Type", "application/json")
  40452. c.urlParams_.Set("alt", alt)
  40453. c.urlParams_.Set("prettyPrint", "false")
  40454. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  40455. urls += "?" + c.urlParams_.Encode()
  40456. req, err := http.NewRequest("PATCH", urls, body)
  40457. if err != nil {
  40458. return nil, err
  40459. }
  40460. req.Header = reqHeaders
  40461. googleapi.Expand(req.URL, map[string]string{
  40462. "project": c.project,
  40463. "httpHealthCheck": c.httpHealthCheck,
  40464. })
  40465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40466. }
  40467. // Do executes the "compute.httpHealthChecks.patch" call.
  40468. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40469. // status code is an error. Response headers are in either
  40470. // *Operation.ServerResponse.Header or (if a response was returned at
  40471. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40472. // to check whether the returned error was because
  40473. // http.StatusNotModified was returned.
  40474. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40475. gensupport.SetOptions(c.urlParams_, opts...)
  40476. res, err := c.doRequest("json")
  40477. if res != nil && res.StatusCode == http.StatusNotModified {
  40478. if res.Body != nil {
  40479. res.Body.Close()
  40480. }
  40481. return nil, &googleapi.Error{
  40482. Code: res.StatusCode,
  40483. Header: res.Header,
  40484. }
  40485. }
  40486. if err != nil {
  40487. return nil, err
  40488. }
  40489. defer googleapi.CloseBody(res)
  40490. if err := googleapi.CheckResponse(res); err != nil {
  40491. return nil, err
  40492. }
  40493. ret := &Operation{
  40494. ServerResponse: googleapi.ServerResponse{
  40495. Header: res.Header,
  40496. HTTPStatusCode: res.StatusCode,
  40497. },
  40498. }
  40499. target := &ret
  40500. if err := gensupport.DecodeResponse(target, res); err != nil {
  40501. return nil, err
  40502. }
  40503. return ret, nil
  40504. // {
  40505. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  40506. // "httpMethod": "PATCH",
  40507. // "id": "compute.httpHealthChecks.patch",
  40508. // "parameterOrder": [
  40509. // "project",
  40510. // "httpHealthCheck"
  40511. // ],
  40512. // "parameters": {
  40513. // "httpHealthCheck": {
  40514. // "description": "Name of the HttpHealthCheck resource to patch.",
  40515. // "location": "path",
  40516. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40517. // "required": true,
  40518. // "type": "string"
  40519. // },
  40520. // "project": {
  40521. // "description": "Project ID for this request.",
  40522. // "location": "path",
  40523. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40524. // "required": true,
  40525. // "type": "string"
  40526. // },
  40527. // "requestId": {
  40528. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40529. // "location": "query",
  40530. // "type": "string"
  40531. // }
  40532. // },
  40533. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  40534. // "request": {
  40535. // "$ref": "HttpHealthCheck"
  40536. // },
  40537. // "response": {
  40538. // "$ref": "Operation"
  40539. // },
  40540. // "scopes": [
  40541. // "https://www.googleapis.com/auth/cloud-platform",
  40542. // "https://www.googleapis.com/auth/compute"
  40543. // ]
  40544. // }
  40545. }
  40546. // method id "compute.httpHealthChecks.update":
  40547. type HttpHealthChecksUpdateCall struct {
  40548. s *Service
  40549. project string
  40550. httpHealthCheck string
  40551. httphealthcheck *HttpHealthCheck
  40552. urlParams_ gensupport.URLParams
  40553. ctx_ context.Context
  40554. header_ http.Header
  40555. }
  40556. // Update: Updates a HttpHealthCheck resource in the specified project
  40557. // using the data included in the request.
  40558. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  40559. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  40560. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40561. c.project = project
  40562. c.httpHealthCheck = httpHealthCheck
  40563. c.httphealthcheck = httphealthcheck
  40564. return c
  40565. }
  40566. // RequestId sets the optional parameter "requestId": An optional
  40567. // request ID to identify requests. Specify a unique request ID so that
  40568. // if you must retry your request, the server will know to ignore the
  40569. // request if it has already been completed.
  40570. //
  40571. // For example, consider a situation where you make an initial request
  40572. // and the request times out. If you make the request again with the
  40573. // same request ID, the server can check if original operation with the
  40574. // same request ID was received, and if so, will ignore the second
  40575. // request. This prevents clients from accidentally creating duplicate
  40576. // commitments.
  40577. //
  40578. // The request ID must be a valid UUID with the exception that zero UUID
  40579. // is not supported (00000000-0000-0000-0000-000000000000).
  40580. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  40581. c.urlParams_.Set("requestId", requestId)
  40582. return c
  40583. }
  40584. // Fields allows partial responses to be retrieved. See
  40585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40586. // for more information.
  40587. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  40588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40589. return c
  40590. }
  40591. // Context sets the context to be used in this call's Do method. Any
  40592. // pending HTTP request will be aborted if the provided context is
  40593. // canceled.
  40594. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  40595. c.ctx_ = ctx
  40596. return c
  40597. }
  40598. // Header returns an http.Header that can be modified by the caller to
  40599. // add HTTP headers to the request.
  40600. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  40601. if c.header_ == nil {
  40602. c.header_ = make(http.Header)
  40603. }
  40604. return c.header_
  40605. }
  40606. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  40607. reqHeaders := make(http.Header)
  40608. for k, v := range c.header_ {
  40609. reqHeaders[k] = v
  40610. }
  40611. reqHeaders.Set("User-Agent", c.s.userAgent())
  40612. var body io.Reader = nil
  40613. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  40614. if err != nil {
  40615. return nil, err
  40616. }
  40617. reqHeaders.Set("Content-Type", "application/json")
  40618. c.urlParams_.Set("alt", alt)
  40619. c.urlParams_.Set("prettyPrint", "false")
  40620. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  40621. urls += "?" + c.urlParams_.Encode()
  40622. req, err := http.NewRequest("PUT", urls, body)
  40623. if err != nil {
  40624. return nil, err
  40625. }
  40626. req.Header = reqHeaders
  40627. googleapi.Expand(req.URL, map[string]string{
  40628. "project": c.project,
  40629. "httpHealthCheck": c.httpHealthCheck,
  40630. })
  40631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40632. }
  40633. // Do executes the "compute.httpHealthChecks.update" call.
  40634. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40635. // status code is an error. Response headers are in either
  40636. // *Operation.ServerResponse.Header or (if a response was returned at
  40637. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40638. // to check whether the returned error was because
  40639. // http.StatusNotModified was returned.
  40640. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40641. gensupport.SetOptions(c.urlParams_, opts...)
  40642. res, err := c.doRequest("json")
  40643. if res != nil && res.StatusCode == http.StatusNotModified {
  40644. if res.Body != nil {
  40645. res.Body.Close()
  40646. }
  40647. return nil, &googleapi.Error{
  40648. Code: res.StatusCode,
  40649. Header: res.Header,
  40650. }
  40651. }
  40652. if err != nil {
  40653. return nil, err
  40654. }
  40655. defer googleapi.CloseBody(res)
  40656. if err := googleapi.CheckResponse(res); err != nil {
  40657. return nil, err
  40658. }
  40659. ret := &Operation{
  40660. ServerResponse: googleapi.ServerResponse{
  40661. Header: res.Header,
  40662. HTTPStatusCode: res.StatusCode,
  40663. },
  40664. }
  40665. target := &ret
  40666. if err := gensupport.DecodeResponse(target, res); err != nil {
  40667. return nil, err
  40668. }
  40669. return ret, nil
  40670. // {
  40671. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  40672. // "httpMethod": "PUT",
  40673. // "id": "compute.httpHealthChecks.update",
  40674. // "parameterOrder": [
  40675. // "project",
  40676. // "httpHealthCheck"
  40677. // ],
  40678. // "parameters": {
  40679. // "httpHealthCheck": {
  40680. // "description": "Name of the HttpHealthCheck resource to update.",
  40681. // "location": "path",
  40682. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40683. // "required": true,
  40684. // "type": "string"
  40685. // },
  40686. // "project": {
  40687. // "description": "Project ID for this request.",
  40688. // "location": "path",
  40689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40690. // "required": true,
  40691. // "type": "string"
  40692. // },
  40693. // "requestId": {
  40694. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40695. // "location": "query",
  40696. // "type": "string"
  40697. // }
  40698. // },
  40699. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  40700. // "request": {
  40701. // "$ref": "HttpHealthCheck"
  40702. // },
  40703. // "response": {
  40704. // "$ref": "Operation"
  40705. // },
  40706. // "scopes": [
  40707. // "https://www.googleapis.com/auth/cloud-platform",
  40708. // "https://www.googleapis.com/auth/compute"
  40709. // ]
  40710. // }
  40711. }
  40712. // method id "compute.httpsHealthChecks.delete":
  40713. type HttpsHealthChecksDeleteCall struct {
  40714. s *Service
  40715. project string
  40716. httpsHealthCheck string
  40717. urlParams_ gensupport.URLParams
  40718. ctx_ context.Context
  40719. header_ http.Header
  40720. }
  40721. // Delete: Deletes the specified HttpsHealthCheck resource.
  40722. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  40723. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40724. c.project = project
  40725. c.httpsHealthCheck = httpsHealthCheck
  40726. return c
  40727. }
  40728. // RequestId sets the optional parameter "requestId": An optional
  40729. // request ID to identify requests. Specify a unique request ID so that
  40730. // if you must retry your request, the server will know to ignore the
  40731. // request if it has already been completed.
  40732. //
  40733. // For example, consider a situation where you make an initial request
  40734. // and the request times out. If you make the request again with the
  40735. // same request ID, the server can check if original operation with the
  40736. // same request ID was received, and if so, will ignore the second
  40737. // request. This prevents clients from accidentally creating duplicate
  40738. // commitments.
  40739. //
  40740. // The request ID must be a valid UUID with the exception that zero UUID
  40741. // is not supported (00000000-0000-0000-0000-000000000000).
  40742. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  40743. c.urlParams_.Set("requestId", requestId)
  40744. return c
  40745. }
  40746. // Fields allows partial responses to be retrieved. See
  40747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40748. // for more information.
  40749. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  40750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40751. return c
  40752. }
  40753. // Context sets the context to be used in this call's Do method. Any
  40754. // pending HTTP request will be aborted if the provided context is
  40755. // canceled.
  40756. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  40757. c.ctx_ = ctx
  40758. return c
  40759. }
  40760. // Header returns an http.Header that can be modified by the caller to
  40761. // add HTTP headers to the request.
  40762. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  40763. if c.header_ == nil {
  40764. c.header_ = make(http.Header)
  40765. }
  40766. return c.header_
  40767. }
  40768. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  40769. reqHeaders := make(http.Header)
  40770. for k, v := range c.header_ {
  40771. reqHeaders[k] = v
  40772. }
  40773. reqHeaders.Set("User-Agent", c.s.userAgent())
  40774. var body io.Reader = nil
  40775. c.urlParams_.Set("alt", alt)
  40776. c.urlParams_.Set("prettyPrint", "false")
  40777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  40778. urls += "?" + c.urlParams_.Encode()
  40779. req, err := http.NewRequest("DELETE", urls, body)
  40780. if err != nil {
  40781. return nil, err
  40782. }
  40783. req.Header = reqHeaders
  40784. googleapi.Expand(req.URL, map[string]string{
  40785. "project": c.project,
  40786. "httpsHealthCheck": c.httpsHealthCheck,
  40787. })
  40788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40789. }
  40790. // Do executes the "compute.httpsHealthChecks.delete" call.
  40791. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40792. // status code is an error. Response headers are in either
  40793. // *Operation.ServerResponse.Header or (if a response was returned at
  40794. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40795. // to check whether the returned error was because
  40796. // http.StatusNotModified was returned.
  40797. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40798. gensupport.SetOptions(c.urlParams_, opts...)
  40799. res, err := c.doRequest("json")
  40800. if res != nil && res.StatusCode == http.StatusNotModified {
  40801. if res.Body != nil {
  40802. res.Body.Close()
  40803. }
  40804. return nil, &googleapi.Error{
  40805. Code: res.StatusCode,
  40806. Header: res.Header,
  40807. }
  40808. }
  40809. if err != nil {
  40810. return nil, err
  40811. }
  40812. defer googleapi.CloseBody(res)
  40813. if err := googleapi.CheckResponse(res); err != nil {
  40814. return nil, err
  40815. }
  40816. ret := &Operation{
  40817. ServerResponse: googleapi.ServerResponse{
  40818. Header: res.Header,
  40819. HTTPStatusCode: res.StatusCode,
  40820. },
  40821. }
  40822. target := &ret
  40823. if err := gensupport.DecodeResponse(target, res); err != nil {
  40824. return nil, err
  40825. }
  40826. return ret, nil
  40827. // {
  40828. // "description": "Deletes the specified HttpsHealthCheck resource.",
  40829. // "httpMethod": "DELETE",
  40830. // "id": "compute.httpsHealthChecks.delete",
  40831. // "parameterOrder": [
  40832. // "project",
  40833. // "httpsHealthCheck"
  40834. // ],
  40835. // "parameters": {
  40836. // "httpsHealthCheck": {
  40837. // "description": "Name of the HttpsHealthCheck resource to delete.",
  40838. // "location": "path",
  40839. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40840. // "required": true,
  40841. // "type": "string"
  40842. // },
  40843. // "project": {
  40844. // "description": "Project ID for this request.",
  40845. // "location": "path",
  40846. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40847. // "required": true,
  40848. // "type": "string"
  40849. // },
  40850. // "requestId": {
  40851. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40852. // "location": "query",
  40853. // "type": "string"
  40854. // }
  40855. // },
  40856. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  40857. // "response": {
  40858. // "$ref": "Operation"
  40859. // },
  40860. // "scopes": [
  40861. // "https://www.googleapis.com/auth/cloud-platform",
  40862. // "https://www.googleapis.com/auth/compute"
  40863. // ]
  40864. // }
  40865. }
  40866. // method id "compute.httpsHealthChecks.get":
  40867. type HttpsHealthChecksGetCall struct {
  40868. s *Service
  40869. project string
  40870. httpsHealthCheck string
  40871. urlParams_ gensupport.URLParams
  40872. ifNoneMatch_ string
  40873. ctx_ context.Context
  40874. header_ http.Header
  40875. }
  40876. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  40877. // available HTTPS health checks by making a list() request.
  40878. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  40879. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40880. c.project = project
  40881. c.httpsHealthCheck = httpsHealthCheck
  40882. return c
  40883. }
  40884. // Fields allows partial responses to be retrieved. See
  40885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40886. // for more information.
  40887. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  40888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40889. return c
  40890. }
  40891. // IfNoneMatch sets the optional parameter which makes the operation
  40892. // fail if the object's ETag matches the given value. This is useful for
  40893. // getting updates only after the object has changed since the last
  40894. // request. Use googleapi.IsNotModified to check whether the response
  40895. // error from Do is the result of In-None-Match.
  40896. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  40897. c.ifNoneMatch_ = entityTag
  40898. return c
  40899. }
  40900. // Context sets the context to be used in this call's Do method. Any
  40901. // pending HTTP request will be aborted if the provided context is
  40902. // canceled.
  40903. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  40904. c.ctx_ = ctx
  40905. return c
  40906. }
  40907. // Header returns an http.Header that can be modified by the caller to
  40908. // add HTTP headers to the request.
  40909. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  40910. if c.header_ == nil {
  40911. c.header_ = make(http.Header)
  40912. }
  40913. return c.header_
  40914. }
  40915. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  40916. reqHeaders := make(http.Header)
  40917. for k, v := range c.header_ {
  40918. reqHeaders[k] = v
  40919. }
  40920. reqHeaders.Set("User-Agent", c.s.userAgent())
  40921. if c.ifNoneMatch_ != "" {
  40922. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40923. }
  40924. var body io.Reader = nil
  40925. c.urlParams_.Set("alt", alt)
  40926. c.urlParams_.Set("prettyPrint", "false")
  40927. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  40928. urls += "?" + c.urlParams_.Encode()
  40929. req, err := http.NewRequest("GET", urls, body)
  40930. if err != nil {
  40931. return nil, err
  40932. }
  40933. req.Header = reqHeaders
  40934. googleapi.Expand(req.URL, map[string]string{
  40935. "project": c.project,
  40936. "httpsHealthCheck": c.httpsHealthCheck,
  40937. })
  40938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40939. }
  40940. // Do executes the "compute.httpsHealthChecks.get" call.
  40941. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  40942. // non-2xx status code is an error. Response headers are in either
  40943. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  40944. // returned at all) in error.(*googleapi.Error).Header. Use
  40945. // googleapi.IsNotModified to check whether the returned error was
  40946. // because http.StatusNotModified was returned.
  40947. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  40948. gensupport.SetOptions(c.urlParams_, opts...)
  40949. res, err := c.doRequest("json")
  40950. if res != nil && res.StatusCode == http.StatusNotModified {
  40951. if res.Body != nil {
  40952. res.Body.Close()
  40953. }
  40954. return nil, &googleapi.Error{
  40955. Code: res.StatusCode,
  40956. Header: res.Header,
  40957. }
  40958. }
  40959. if err != nil {
  40960. return nil, err
  40961. }
  40962. defer googleapi.CloseBody(res)
  40963. if err := googleapi.CheckResponse(res); err != nil {
  40964. return nil, err
  40965. }
  40966. ret := &HttpsHealthCheck{
  40967. ServerResponse: googleapi.ServerResponse{
  40968. Header: res.Header,
  40969. HTTPStatusCode: res.StatusCode,
  40970. },
  40971. }
  40972. target := &ret
  40973. if err := gensupport.DecodeResponse(target, res); err != nil {
  40974. return nil, err
  40975. }
  40976. return ret, nil
  40977. // {
  40978. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  40979. // "httpMethod": "GET",
  40980. // "id": "compute.httpsHealthChecks.get",
  40981. // "parameterOrder": [
  40982. // "project",
  40983. // "httpsHealthCheck"
  40984. // ],
  40985. // "parameters": {
  40986. // "httpsHealthCheck": {
  40987. // "description": "Name of the HttpsHealthCheck resource to return.",
  40988. // "location": "path",
  40989. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40990. // "required": true,
  40991. // "type": "string"
  40992. // },
  40993. // "project": {
  40994. // "description": "Project ID for this request.",
  40995. // "location": "path",
  40996. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40997. // "required": true,
  40998. // "type": "string"
  40999. // }
  41000. // },
  41001. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  41002. // "response": {
  41003. // "$ref": "HttpsHealthCheck"
  41004. // },
  41005. // "scopes": [
  41006. // "https://www.googleapis.com/auth/cloud-platform",
  41007. // "https://www.googleapis.com/auth/compute",
  41008. // "https://www.googleapis.com/auth/compute.readonly"
  41009. // ]
  41010. // }
  41011. }
  41012. // method id "compute.httpsHealthChecks.insert":
  41013. type HttpsHealthChecksInsertCall struct {
  41014. s *Service
  41015. project string
  41016. httpshealthcheck *HttpsHealthCheck
  41017. urlParams_ gensupport.URLParams
  41018. ctx_ context.Context
  41019. header_ http.Header
  41020. }
  41021. // Insert: Creates a HttpsHealthCheck resource in the specified project
  41022. // using the data included in the request.
  41023. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  41024. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41025. c.project = project
  41026. c.httpshealthcheck = httpshealthcheck
  41027. return c
  41028. }
  41029. // RequestId sets the optional parameter "requestId": An optional
  41030. // request ID to identify requests. Specify a unique request ID so that
  41031. // if you must retry your request, the server will know to ignore the
  41032. // request if it has already been completed.
  41033. //
  41034. // For example, consider a situation where you make an initial request
  41035. // and the request times out. If you make the request again with the
  41036. // same request ID, the server can check if original operation with the
  41037. // same request ID was received, and if so, will ignore the second
  41038. // request. This prevents clients from accidentally creating duplicate
  41039. // commitments.
  41040. //
  41041. // The request ID must be a valid UUID with the exception that zero UUID
  41042. // is not supported (00000000-0000-0000-0000-000000000000).
  41043. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  41044. c.urlParams_.Set("requestId", requestId)
  41045. return c
  41046. }
  41047. // Fields allows partial responses to be retrieved. See
  41048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41049. // for more information.
  41050. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  41051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41052. return c
  41053. }
  41054. // Context sets the context to be used in this call's Do method. Any
  41055. // pending HTTP request will be aborted if the provided context is
  41056. // canceled.
  41057. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  41058. c.ctx_ = ctx
  41059. return c
  41060. }
  41061. // Header returns an http.Header that can be modified by the caller to
  41062. // add HTTP headers to the request.
  41063. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  41064. if c.header_ == nil {
  41065. c.header_ = make(http.Header)
  41066. }
  41067. return c.header_
  41068. }
  41069. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  41070. reqHeaders := make(http.Header)
  41071. for k, v := range c.header_ {
  41072. reqHeaders[k] = v
  41073. }
  41074. reqHeaders.Set("User-Agent", c.s.userAgent())
  41075. var body io.Reader = nil
  41076. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  41077. if err != nil {
  41078. return nil, err
  41079. }
  41080. reqHeaders.Set("Content-Type", "application/json")
  41081. c.urlParams_.Set("alt", alt)
  41082. c.urlParams_.Set("prettyPrint", "false")
  41083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  41084. urls += "?" + c.urlParams_.Encode()
  41085. req, err := http.NewRequest("POST", urls, body)
  41086. if err != nil {
  41087. return nil, err
  41088. }
  41089. req.Header = reqHeaders
  41090. googleapi.Expand(req.URL, map[string]string{
  41091. "project": c.project,
  41092. })
  41093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41094. }
  41095. // Do executes the "compute.httpsHealthChecks.insert" call.
  41096. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41097. // status code is an error. Response headers are in either
  41098. // *Operation.ServerResponse.Header or (if a response was returned at
  41099. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41100. // to check whether the returned error was because
  41101. // http.StatusNotModified was returned.
  41102. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41103. gensupport.SetOptions(c.urlParams_, opts...)
  41104. res, err := c.doRequest("json")
  41105. if res != nil && res.StatusCode == http.StatusNotModified {
  41106. if res.Body != nil {
  41107. res.Body.Close()
  41108. }
  41109. return nil, &googleapi.Error{
  41110. Code: res.StatusCode,
  41111. Header: res.Header,
  41112. }
  41113. }
  41114. if err != nil {
  41115. return nil, err
  41116. }
  41117. defer googleapi.CloseBody(res)
  41118. if err := googleapi.CheckResponse(res); err != nil {
  41119. return nil, err
  41120. }
  41121. ret := &Operation{
  41122. ServerResponse: googleapi.ServerResponse{
  41123. Header: res.Header,
  41124. HTTPStatusCode: res.StatusCode,
  41125. },
  41126. }
  41127. target := &ret
  41128. if err := gensupport.DecodeResponse(target, res); err != nil {
  41129. return nil, err
  41130. }
  41131. return ret, nil
  41132. // {
  41133. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  41134. // "httpMethod": "POST",
  41135. // "id": "compute.httpsHealthChecks.insert",
  41136. // "parameterOrder": [
  41137. // "project"
  41138. // ],
  41139. // "parameters": {
  41140. // "project": {
  41141. // "description": "Project ID for this request.",
  41142. // "location": "path",
  41143. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41144. // "required": true,
  41145. // "type": "string"
  41146. // },
  41147. // "requestId": {
  41148. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41149. // "location": "query",
  41150. // "type": "string"
  41151. // }
  41152. // },
  41153. // "path": "{project}/global/httpsHealthChecks",
  41154. // "request": {
  41155. // "$ref": "HttpsHealthCheck"
  41156. // },
  41157. // "response": {
  41158. // "$ref": "Operation"
  41159. // },
  41160. // "scopes": [
  41161. // "https://www.googleapis.com/auth/cloud-platform",
  41162. // "https://www.googleapis.com/auth/compute"
  41163. // ]
  41164. // }
  41165. }
  41166. // method id "compute.httpsHealthChecks.list":
  41167. type HttpsHealthChecksListCall struct {
  41168. s *Service
  41169. project string
  41170. urlParams_ gensupport.URLParams
  41171. ifNoneMatch_ string
  41172. ctx_ context.Context
  41173. header_ http.Header
  41174. }
  41175. // List: Retrieves the list of HttpsHealthCheck resources available to
  41176. // the specified project.
  41177. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  41178. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41179. c.project = project
  41180. return c
  41181. }
  41182. // Filter sets the optional parameter "filter": A filter expression that
  41183. // filters resources listed in the response. The expression must specify
  41184. // the field name, a comparison operator, and the value that you want to
  41185. // use for filtering. The value must be a string, a number, or a
  41186. // boolean. The comparison operator must be either =, !=, >, or <.
  41187. //
  41188. // For example, if you are filtering Compute Engine instances, you can
  41189. // exclude instances named example-instance by specifying name !=
  41190. // example-instance.
  41191. //
  41192. // You can also filter nested fields. For example, you could specify
  41193. // scheduling.automaticRestart = false to include instances only if they
  41194. // are not scheduled for automatic restarts. You can use filtering on
  41195. // nested fields to filter based on resource labels.
  41196. //
  41197. // To filter on multiple expressions, provide each separate expression
  41198. // within parentheses. For example, (scheduling.automaticRestart = true)
  41199. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41200. // AND expression. However, you can include AND and OR expressions
  41201. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41202. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41203. // true).
  41204. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  41205. c.urlParams_.Set("filter", filter)
  41206. return c
  41207. }
  41208. // MaxResults sets the optional parameter "maxResults": The maximum
  41209. // number of results per page that should be returned. If the number of
  41210. // available results is larger than maxResults, Compute Engine returns a
  41211. // nextPageToken that can be used to get the next page of results in
  41212. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41213. // (Default: 500)
  41214. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  41215. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41216. return c
  41217. }
  41218. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41219. // a certain order. By default, results are returned in alphanumerical
  41220. // order based on the resource name.
  41221. //
  41222. // You can also sort results in descending order based on the creation
  41223. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41224. // based on the creationTimestamp field in reverse chronological order
  41225. // (newest result first). Use this to sort resources like operations so
  41226. // that the newest operation is returned first.
  41227. //
  41228. // Currently, only sorting by name or creationTimestamp desc is
  41229. // supported.
  41230. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  41231. c.urlParams_.Set("orderBy", orderBy)
  41232. return c
  41233. }
  41234. // PageToken sets the optional parameter "pageToken": Specifies a page
  41235. // token to use. Set pageToken to the nextPageToken returned by a
  41236. // previous list request to get the next page of results.
  41237. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  41238. c.urlParams_.Set("pageToken", pageToken)
  41239. return c
  41240. }
  41241. // Fields allows partial responses to be retrieved. See
  41242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41243. // for more information.
  41244. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  41245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41246. return c
  41247. }
  41248. // IfNoneMatch sets the optional parameter which makes the operation
  41249. // fail if the object's ETag matches the given value. This is useful for
  41250. // getting updates only after the object has changed since the last
  41251. // request. Use googleapi.IsNotModified to check whether the response
  41252. // error from Do is the result of In-None-Match.
  41253. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  41254. c.ifNoneMatch_ = entityTag
  41255. return c
  41256. }
  41257. // Context sets the context to be used in this call's Do method. Any
  41258. // pending HTTP request will be aborted if the provided context is
  41259. // canceled.
  41260. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  41261. c.ctx_ = ctx
  41262. return c
  41263. }
  41264. // Header returns an http.Header that can be modified by the caller to
  41265. // add HTTP headers to the request.
  41266. func (c *HttpsHealthChecksListCall) Header() http.Header {
  41267. if c.header_ == nil {
  41268. c.header_ = make(http.Header)
  41269. }
  41270. return c.header_
  41271. }
  41272. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  41273. reqHeaders := make(http.Header)
  41274. for k, v := range c.header_ {
  41275. reqHeaders[k] = v
  41276. }
  41277. reqHeaders.Set("User-Agent", c.s.userAgent())
  41278. if c.ifNoneMatch_ != "" {
  41279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41280. }
  41281. var body io.Reader = nil
  41282. c.urlParams_.Set("alt", alt)
  41283. c.urlParams_.Set("prettyPrint", "false")
  41284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  41285. urls += "?" + c.urlParams_.Encode()
  41286. req, err := http.NewRequest("GET", urls, body)
  41287. if err != nil {
  41288. return nil, err
  41289. }
  41290. req.Header = reqHeaders
  41291. googleapi.Expand(req.URL, map[string]string{
  41292. "project": c.project,
  41293. })
  41294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41295. }
  41296. // Do executes the "compute.httpsHealthChecks.list" call.
  41297. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  41298. // non-2xx status code is an error. Response headers are in either
  41299. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  41300. // returned at all) in error.(*googleapi.Error).Header. Use
  41301. // googleapi.IsNotModified to check whether the returned error was
  41302. // because http.StatusNotModified was returned.
  41303. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  41304. gensupport.SetOptions(c.urlParams_, opts...)
  41305. res, err := c.doRequest("json")
  41306. if res != nil && res.StatusCode == http.StatusNotModified {
  41307. if res.Body != nil {
  41308. res.Body.Close()
  41309. }
  41310. return nil, &googleapi.Error{
  41311. Code: res.StatusCode,
  41312. Header: res.Header,
  41313. }
  41314. }
  41315. if err != nil {
  41316. return nil, err
  41317. }
  41318. defer googleapi.CloseBody(res)
  41319. if err := googleapi.CheckResponse(res); err != nil {
  41320. return nil, err
  41321. }
  41322. ret := &HttpsHealthCheckList{
  41323. ServerResponse: googleapi.ServerResponse{
  41324. Header: res.Header,
  41325. HTTPStatusCode: res.StatusCode,
  41326. },
  41327. }
  41328. target := &ret
  41329. if err := gensupport.DecodeResponse(target, res); err != nil {
  41330. return nil, err
  41331. }
  41332. return ret, nil
  41333. // {
  41334. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  41335. // "httpMethod": "GET",
  41336. // "id": "compute.httpsHealthChecks.list",
  41337. // "parameterOrder": [
  41338. // "project"
  41339. // ],
  41340. // "parameters": {
  41341. // "filter": {
  41342. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41343. // "location": "query",
  41344. // "type": "string"
  41345. // },
  41346. // "maxResults": {
  41347. // "default": "500",
  41348. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41349. // "format": "uint32",
  41350. // "location": "query",
  41351. // "minimum": "0",
  41352. // "type": "integer"
  41353. // },
  41354. // "orderBy": {
  41355. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41356. // "location": "query",
  41357. // "type": "string"
  41358. // },
  41359. // "pageToken": {
  41360. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41361. // "location": "query",
  41362. // "type": "string"
  41363. // },
  41364. // "project": {
  41365. // "description": "Project ID for this request.",
  41366. // "location": "path",
  41367. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41368. // "required": true,
  41369. // "type": "string"
  41370. // }
  41371. // },
  41372. // "path": "{project}/global/httpsHealthChecks",
  41373. // "response": {
  41374. // "$ref": "HttpsHealthCheckList"
  41375. // },
  41376. // "scopes": [
  41377. // "https://www.googleapis.com/auth/cloud-platform",
  41378. // "https://www.googleapis.com/auth/compute",
  41379. // "https://www.googleapis.com/auth/compute.readonly"
  41380. // ]
  41381. // }
  41382. }
  41383. // Pages invokes f for each page of results.
  41384. // A non-nil error returned from f will halt the iteration.
  41385. // The provided context supersedes any context provided to the Context method.
  41386. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  41387. c.ctx_ = ctx
  41388. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41389. for {
  41390. x, err := c.Do()
  41391. if err != nil {
  41392. return err
  41393. }
  41394. if err := f(x); err != nil {
  41395. return err
  41396. }
  41397. if x.NextPageToken == "" {
  41398. return nil
  41399. }
  41400. c.PageToken(x.NextPageToken)
  41401. }
  41402. }
  41403. // method id "compute.httpsHealthChecks.patch":
  41404. type HttpsHealthChecksPatchCall struct {
  41405. s *Service
  41406. project string
  41407. httpsHealthCheck string
  41408. httpshealthcheck *HttpsHealthCheck
  41409. urlParams_ gensupport.URLParams
  41410. ctx_ context.Context
  41411. header_ http.Header
  41412. }
  41413. // Patch: Updates a HttpsHealthCheck resource in the specified project
  41414. // using the data included in the request. This method supports PATCH
  41415. // semantics and uses the JSON merge patch format and processing rules.
  41416. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  41417. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41418. c.project = project
  41419. c.httpsHealthCheck = httpsHealthCheck
  41420. c.httpshealthcheck = httpshealthcheck
  41421. return c
  41422. }
  41423. // RequestId sets the optional parameter "requestId": An optional
  41424. // request ID to identify requests. Specify a unique request ID so that
  41425. // if you must retry your request, the server will know to ignore the
  41426. // request if it has already been completed.
  41427. //
  41428. // For example, consider a situation where you make an initial request
  41429. // and the request times out. If you make the request again with the
  41430. // same request ID, the server can check if original operation with the
  41431. // same request ID was received, and if so, will ignore the second
  41432. // request. This prevents clients from accidentally creating duplicate
  41433. // commitments.
  41434. //
  41435. // The request ID must be a valid UUID with the exception that zero UUID
  41436. // is not supported (00000000-0000-0000-0000-000000000000).
  41437. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  41438. c.urlParams_.Set("requestId", requestId)
  41439. return c
  41440. }
  41441. // Fields allows partial responses to be retrieved. See
  41442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41443. // for more information.
  41444. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  41445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41446. return c
  41447. }
  41448. // Context sets the context to be used in this call's Do method. Any
  41449. // pending HTTP request will be aborted if the provided context is
  41450. // canceled.
  41451. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  41452. c.ctx_ = ctx
  41453. return c
  41454. }
  41455. // Header returns an http.Header that can be modified by the caller to
  41456. // add HTTP headers to the request.
  41457. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  41458. if c.header_ == nil {
  41459. c.header_ = make(http.Header)
  41460. }
  41461. return c.header_
  41462. }
  41463. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  41464. reqHeaders := make(http.Header)
  41465. for k, v := range c.header_ {
  41466. reqHeaders[k] = v
  41467. }
  41468. reqHeaders.Set("User-Agent", c.s.userAgent())
  41469. var body io.Reader = nil
  41470. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  41471. if err != nil {
  41472. return nil, err
  41473. }
  41474. reqHeaders.Set("Content-Type", "application/json")
  41475. c.urlParams_.Set("alt", alt)
  41476. c.urlParams_.Set("prettyPrint", "false")
  41477. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  41478. urls += "?" + c.urlParams_.Encode()
  41479. req, err := http.NewRequest("PATCH", urls, body)
  41480. if err != nil {
  41481. return nil, err
  41482. }
  41483. req.Header = reqHeaders
  41484. googleapi.Expand(req.URL, map[string]string{
  41485. "project": c.project,
  41486. "httpsHealthCheck": c.httpsHealthCheck,
  41487. })
  41488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41489. }
  41490. // Do executes the "compute.httpsHealthChecks.patch" call.
  41491. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41492. // status code is an error. Response headers are in either
  41493. // *Operation.ServerResponse.Header or (if a response was returned at
  41494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41495. // to check whether the returned error was because
  41496. // http.StatusNotModified was returned.
  41497. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41498. gensupport.SetOptions(c.urlParams_, opts...)
  41499. res, err := c.doRequest("json")
  41500. if res != nil && res.StatusCode == http.StatusNotModified {
  41501. if res.Body != nil {
  41502. res.Body.Close()
  41503. }
  41504. return nil, &googleapi.Error{
  41505. Code: res.StatusCode,
  41506. Header: res.Header,
  41507. }
  41508. }
  41509. if err != nil {
  41510. return nil, err
  41511. }
  41512. defer googleapi.CloseBody(res)
  41513. if err := googleapi.CheckResponse(res); err != nil {
  41514. return nil, err
  41515. }
  41516. ret := &Operation{
  41517. ServerResponse: googleapi.ServerResponse{
  41518. Header: res.Header,
  41519. HTTPStatusCode: res.StatusCode,
  41520. },
  41521. }
  41522. target := &ret
  41523. if err := gensupport.DecodeResponse(target, res); err != nil {
  41524. return nil, err
  41525. }
  41526. return ret, nil
  41527. // {
  41528. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  41529. // "httpMethod": "PATCH",
  41530. // "id": "compute.httpsHealthChecks.patch",
  41531. // "parameterOrder": [
  41532. // "project",
  41533. // "httpsHealthCheck"
  41534. // ],
  41535. // "parameters": {
  41536. // "httpsHealthCheck": {
  41537. // "description": "Name of the HttpsHealthCheck resource to patch.",
  41538. // "location": "path",
  41539. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41540. // "required": true,
  41541. // "type": "string"
  41542. // },
  41543. // "project": {
  41544. // "description": "Project ID for this request.",
  41545. // "location": "path",
  41546. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41547. // "required": true,
  41548. // "type": "string"
  41549. // },
  41550. // "requestId": {
  41551. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41552. // "location": "query",
  41553. // "type": "string"
  41554. // }
  41555. // },
  41556. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  41557. // "request": {
  41558. // "$ref": "HttpsHealthCheck"
  41559. // },
  41560. // "response": {
  41561. // "$ref": "Operation"
  41562. // },
  41563. // "scopes": [
  41564. // "https://www.googleapis.com/auth/cloud-platform",
  41565. // "https://www.googleapis.com/auth/compute"
  41566. // ]
  41567. // }
  41568. }
  41569. // method id "compute.httpsHealthChecks.update":
  41570. type HttpsHealthChecksUpdateCall struct {
  41571. s *Service
  41572. project string
  41573. httpsHealthCheck string
  41574. httpshealthcheck *HttpsHealthCheck
  41575. urlParams_ gensupport.URLParams
  41576. ctx_ context.Context
  41577. header_ http.Header
  41578. }
  41579. // Update: Updates a HttpsHealthCheck resource in the specified project
  41580. // using the data included in the request.
  41581. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  41582. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41583. c.project = project
  41584. c.httpsHealthCheck = httpsHealthCheck
  41585. c.httpshealthcheck = httpshealthcheck
  41586. return c
  41587. }
  41588. // RequestId sets the optional parameter "requestId": An optional
  41589. // request ID to identify requests. Specify a unique request ID so that
  41590. // if you must retry your request, the server will know to ignore the
  41591. // request if it has already been completed.
  41592. //
  41593. // For example, consider a situation where you make an initial request
  41594. // and the request times out. If you make the request again with the
  41595. // same request ID, the server can check if original operation with the
  41596. // same request ID was received, and if so, will ignore the second
  41597. // request. This prevents clients from accidentally creating duplicate
  41598. // commitments.
  41599. //
  41600. // The request ID must be a valid UUID with the exception that zero UUID
  41601. // is not supported (00000000-0000-0000-0000-000000000000).
  41602. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  41603. c.urlParams_.Set("requestId", requestId)
  41604. return c
  41605. }
  41606. // Fields allows partial responses to be retrieved. See
  41607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41608. // for more information.
  41609. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  41610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41611. return c
  41612. }
  41613. // Context sets the context to be used in this call's Do method. Any
  41614. // pending HTTP request will be aborted if the provided context is
  41615. // canceled.
  41616. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  41617. c.ctx_ = ctx
  41618. return c
  41619. }
  41620. // Header returns an http.Header that can be modified by the caller to
  41621. // add HTTP headers to the request.
  41622. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  41623. if c.header_ == nil {
  41624. c.header_ = make(http.Header)
  41625. }
  41626. return c.header_
  41627. }
  41628. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  41629. reqHeaders := make(http.Header)
  41630. for k, v := range c.header_ {
  41631. reqHeaders[k] = v
  41632. }
  41633. reqHeaders.Set("User-Agent", c.s.userAgent())
  41634. var body io.Reader = nil
  41635. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  41636. if err != nil {
  41637. return nil, err
  41638. }
  41639. reqHeaders.Set("Content-Type", "application/json")
  41640. c.urlParams_.Set("alt", alt)
  41641. c.urlParams_.Set("prettyPrint", "false")
  41642. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  41643. urls += "?" + c.urlParams_.Encode()
  41644. req, err := http.NewRequest("PUT", urls, body)
  41645. if err != nil {
  41646. return nil, err
  41647. }
  41648. req.Header = reqHeaders
  41649. googleapi.Expand(req.URL, map[string]string{
  41650. "project": c.project,
  41651. "httpsHealthCheck": c.httpsHealthCheck,
  41652. })
  41653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41654. }
  41655. // Do executes the "compute.httpsHealthChecks.update" call.
  41656. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41657. // status code is an error. Response headers are in either
  41658. // *Operation.ServerResponse.Header or (if a response was returned at
  41659. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41660. // to check whether the returned error was because
  41661. // http.StatusNotModified was returned.
  41662. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41663. gensupport.SetOptions(c.urlParams_, opts...)
  41664. res, err := c.doRequest("json")
  41665. if res != nil && res.StatusCode == http.StatusNotModified {
  41666. if res.Body != nil {
  41667. res.Body.Close()
  41668. }
  41669. return nil, &googleapi.Error{
  41670. Code: res.StatusCode,
  41671. Header: res.Header,
  41672. }
  41673. }
  41674. if err != nil {
  41675. return nil, err
  41676. }
  41677. defer googleapi.CloseBody(res)
  41678. if err := googleapi.CheckResponse(res); err != nil {
  41679. return nil, err
  41680. }
  41681. ret := &Operation{
  41682. ServerResponse: googleapi.ServerResponse{
  41683. Header: res.Header,
  41684. HTTPStatusCode: res.StatusCode,
  41685. },
  41686. }
  41687. target := &ret
  41688. if err := gensupport.DecodeResponse(target, res); err != nil {
  41689. return nil, err
  41690. }
  41691. return ret, nil
  41692. // {
  41693. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  41694. // "httpMethod": "PUT",
  41695. // "id": "compute.httpsHealthChecks.update",
  41696. // "parameterOrder": [
  41697. // "project",
  41698. // "httpsHealthCheck"
  41699. // ],
  41700. // "parameters": {
  41701. // "httpsHealthCheck": {
  41702. // "description": "Name of the HttpsHealthCheck resource to update.",
  41703. // "location": "path",
  41704. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41705. // "required": true,
  41706. // "type": "string"
  41707. // },
  41708. // "project": {
  41709. // "description": "Project ID for this request.",
  41710. // "location": "path",
  41711. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41712. // "required": true,
  41713. // "type": "string"
  41714. // },
  41715. // "requestId": {
  41716. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41717. // "location": "query",
  41718. // "type": "string"
  41719. // }
  41720. // },
  41721. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  41722. // "request": {
  41723. // "$ref": "HttpsHealthCheck"
  41724. // },
  41725. // "response": {
  41726. // "$ref": "Operation"
  41727. // },
  41728. // "scopes": [
  41729. // "https://www.googleapis.com/auth/cloud-platform",
  41730. // "https://www.googleapis.com/auth/compute"
  41731. // ]
  41732. // }
  41733. }
  41734. // method id "compute.images.delete":
  41735. type ImagesDeleteCall struct {
  41736. s *Service
  41737. project string
  41738. image string
  41739. urlParams_ gensupport.URLParams
  41740. ctx_ context.Context
  41741. header_ http.Header
  41742. }
  41743. // Delete: Deletes the specified image.
  41744. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  41745. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  41746. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41747. c.project = project
  41748. c.image = image
  41749. return c
  41750. }
  41751. // RequestId sets the optional parameter "requestId": An optional
  41752. // request ID to identify requests. Specify a unique request ID so that
  41753. // if you must retry your request, the server will know to ignore the
  41754. // request if it has already been completed.
  41755. //
  41756. // For example, consider a situation where you make an initial request
  41757. // and the request times out. If you make the request again with the
  41758. // same request ID, the server can check if original operation with the
  41759. // same request ID was received, and if so, will ignore the second
  41760. // request. This prevents clients from accidentally creating duplicate
  41761. // commitments.
  41762. //
  41763. // The request ID must be a valid UUID with the exception that zero UUID
  41764. // is not supported (00000000-0000-0000-0000-000000000000).
  41765. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  41766. c.urlParams_.Set("requestId", requestId)
  41767. return c
  41768. }
  41769. // Fields allows partial responses to be retrieved. See
  41770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41771. // for more information.
  41772. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  41773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41774. return c
  41775. }
  41776. // Context sets the context to be used in this call's Do method. Any
  41777. // pending HTTP request will be aborted if the provided context is
  41778. // canceled.
  41779. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  41780. c.ctx_ = ctx
  41781. return c
  41782. }
  41783. // Header returns an http.Header that can be modified by the caller to
  41784. // add HTTP headers to the request.
  41785. func (c *ImagesDeleteCall) Header() http.Header {
  41786. if c.header_ == nil {
  41787. c.header_ = make(http.Header)
  41788. }
  41789. return c.header_
  41790. }
  41791. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  41792. reqHeaders := make(http.Header)
  41793. for k, v := range c.header_ {
  41794. reqHeaders[k] = v
  41795. }
  41796. reqHeaders.Set("User-Agent", c.s.userAgent())
  41797. var body io.Reader = nil
  41798. c.urlParams_.Set("alt", alt)
  41799. c.urlParams_.Set("prettyPrint", "false")
  41800. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  41801. urls += "?" + c.urlParams_.Encode()
  41802. req, err := http.NewRequest("DELETE", urls, body)
  41803. if err != nil {
  41804. return nil, err
  41805. }
  41806. req.Header = reqHeaders
  41807. googleapi.Expand(req.URL, map[string]string{
  41808. "project": c.project,
  41809. "image": c.image,
  41810. })
  41811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41812. }
  41813. // Do executes the "compute.images.delete" call.
  41814. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41815. // status code is an error. Response headers are in either
  41816. // *Operation.ServerResponse.Header or (if a response was returned at
  41817. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41818. // to check whether the returned error was because
  41819. // http.StatusNotModified was returned.
  41820. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41821. gensupport.SetOptions(c.urlParams_, opts...)
  41822. res, err := c.doRequest("json")
  41823. if res != nil && res.StatusCode == http.StatusNotModified {
  41824. if res.Body != nil {
  41825. res.Body.Close()
  41826. }
  41827. return nil, &googleapi.Error{
  41828. Code: res.StatusCode,
  41829. Header: res.Header,
  41830. }
  41831. }
  41832. if err != nil {
  41833. return nil, err
  41834. }
  41835. defer googleapi.CloseBody(res)
  41836. if err := googleapi.CheckResponse(res); err != nil {
  41837. return nil, err
  41838. }
  41839. ret := &Operation{
  41840. ServerResponse: googleapi.ServerResponse{
  41841. Header: res.Header,
  41842. HTTPStatusCode: res.StatusCode,
  41843. },
  41844. }
  41845. target := &ret
  41846. if err := gensupport.DecodeResponse(target, res); err != nil {
  41847. return nil, err
  41848. }
  41849. return ret, nil
  41850. // {
  41851. // "description": "Deletes the specified image.",
  41852. // "httpMethod": "DELETE",
  41853. // "id": "compute.images.delete",
  41854. // "parameterOrder": [
  41855. // "project",
  41856. // "image"
  41857. // ],
  41858. // "parameters": {
  41859. // "image": {
  41860. // "description": "Name of the image resource to delete.",
  41861. // "location": "path",
  41862. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41863. // "required": true,
  41864. // "type": "string"
  41865. // },
  41866. // "project": {
  41867. // "description": "Project ID for this request.",
  41868. // "location": "path",
  41869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41870. // "required": true,
  41871. // "type": "string"
  41872. // },
  41873. // "requestId": {
  41874. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41875. // "location": "query",
  41876. // "type": "string"
  41877. // }
  41878. // },
  41879. // "path": "{project}/global/images/{image}",
  41880. // "response": {
  41881. // "$ref": "Operation"
  41882. // },
  41883. // "scopes": [
  41884. // "https://www.googleapis.com/auth/cloud-platform",
  41885. // "https://www.googleapis.com/auth/compute"
  41886. // ]
  41887. // }
  41888. }
  41889. // method id "compute.images.deprecate":
  41890. type ImagesDeprecateCall struct {
  41891. s *Service
  41892. project string
  41893. image string
  41894. deprecationstatus *DeprecationStatus
  41895. urlParams_ gensupport.URLParams
  41896. ctx_ context.Context
  41897. header_ http.Header
  41898. }
  41899. // Deprecate: Sets the deprecation status of an image.
  41900. //
  41901. // If an empty request body is given, clears the deprecation status
  41902. // instead.
  41903. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  41904. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  41905. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41906. c.project = project
  41907. c.image = image
  41908. c.deprecationstatus = deprecationstatus
  41909. return c
  41910. }
  41911. // RequestId sets the optional parameter "requestId": An optional
  41912. // request ID to identify requests. Specify a unique request ID so that
  41913. // if you must retry your request, the server will know to ignore the
  41914. // request if it has already been completed.
  41915. //
  41916. // For example, consider a situation where you make an initial request
  41917. // and the request times out. If you make the request again with the
  41918. // same request ID, the server can check if original operation with the
  41919. // same request ID was received, and if so, will ignore the second
  41920. // request. This prevents clients from accidentally creating duplicate
  41921. // commitments.
  41922. //
  41923. // The request ID must be a valid UUID with the exception that zero UUID
  41924. // is not supported (00000000-0000-0000-0000-000000000000).
  41925. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  41926. c.urlParams_.Set("requestId", requestId)
  41927. return c
  41928. }
  41929. // Fields allows partial responses to be retrieved. See
  41930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41931. // for more information.
  41932. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  41933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41934. return c
  41935. }
  41936. // Context sets the context to be used in this call's Do method. Any
  41937. // pending HTTP request will be aborted if the provided context is
  41938. // canceled.
  41939. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  41940. c.ctx_ = ctx
  41941. return c
  41942. }
  41943. // Header returns an http.Header that can be modified by the caller to
  41944. // add HTTP headers to the request.
  41945. func (c *ImagesDeprecateCall) Header() http.Header {
  41946. if c.header_ == nil {
  41947. c.header_ = make(http.Header)
  41948. }
  41949. return c.header_
  41950. }
  41951. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  41952. reqHeaders := make(http.Header)
  41953. for k, v := range c.header_ {
  41954. reqHeaders[k] = v
  41955. }
  41956. reqHeaders.Set("User-Agent", c.s.userAgent())
  41957. var body io.Reader = nil
  41958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  41959. if err != nil {
  41960. return nil, err
  41961. }
  41962. reqHeaders.Set("Content-Type", "application/json")
  41963. c.urlParams_.Set("alt", alt)
  41964. c.urlParams_.Set("prettyPrint", "false")
  41965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  41966. urls += "?" + c.urlParams_.Encode()
  41967. req, err := http.NewRequest("POST", urls, body)
  41968. if err != nil {
  41969. return nil, err
  41970. }
  41971. req.Header = reqHeaders
  41972. googleapi.Expand(req.URL, map[string]string{
  41973. "project": c.project,
  41974. "image": c.image,
  41975. })
  41976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41977. }
  41978. // Do executes the "compute.images.deprecate" call.
  41979. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41980. // status code is an error. Response headers are in either
  41981. // *Operation.ServerResponse.Header or (if a response was returned at
  41982. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41983. // to check whether the returned error was because
  41984. // http.StatusNotModified was returned.
  41985. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41986. gensupport.SetOptions(c.urlParams_, opts...)
  41987. res, err := c.doRequest("json")
  41988. if res != nil && res.StatusCode == http.StatusNotModified {
  41989. if res.Body != nil {
  41990. res.Body.Close()
  41991. }
  41992. return nil, &googleapi.Error{
  41993. Code: res.StatusCode,
  41994. Header: res.Header,
  41995. }
  41996. }
  41997. if err != nil {
  41998. return nil, err
  41999. }
  42000. defer googleapi.CloseBody(res)
  42001. if err := googleapi.CheckResponse(res); err != nil {
  42002. return nil, err
  42003. }
  42004. ret := &Operation{
  42005. ServerResponse: googleapi.ServerResponse{
  42006. Header: res.Header,
  42007. HTTPStatusCode: res.StatusCode,
  42008. },
  42009. }
  42010. target := &ret
  42011. if err := gensupport.DecodeResponse(target, res); err != nil {
  42012. return nil, err
  42013. }
  42014. return ret, nil
  42015. // {
  42016. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  42017. // "httpMethod": "POST",
  42018. // "id": "compute.images.deprecate",
  42019. // "parameterOrder": [
  42020. // "project",
  42021. // "image"
  42022. // ],
  42023. // "parameters": {
  42024. // "image": {
  42025. // "description": "Image name.",
  42026. // "location": "path",
  42027. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42028. // "required": true,
  42029. // "type": "string"
  42030. // },
  42031. // "project": {
  42032. // "description": "Project ID for this request.",
  42033. // "location": "path",
  42034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42035. // "required": true,
  42036. // "type": "string"
  42037. // },
  42038. // "requestId": {
  42039. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42040. // "location": "query",
  42041. // "type": "string"
  42042. // }
  42043. // },
  42044. // "path": "{project}/global/images/{image}/deprecate",
  42045. // "request": {
  42046. // "$ref": "DeprecationStatus"
  42047. // },
  42048. // "response": {
  42049. // "$ref": "Operation"
  42050. // },
  42051. // "scopes": [
  42052. // "https://www.googleapis.com/auth/cloud-platform",
  42053. // "https://www.googleapis.com/auth/compute"
  42054. // ]
  42055. // }
  42056. }
  42057. // method id "compute.images.get":
  42058. type ImagesGetCall struct {
  42059. s *Service
  42060. project string
  42061. image string
  42062. urlParams_ gensupport.URLParams
  42063. ifNoneMatch_ string
  42064. ctx_ context.Context
  42065. header_ http.Header
  42066. }
  42067. // Get: Returns the specified image. Gets a list of available images by
  42068. // making a list() request.
  42069. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  42070. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  42071. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42072. c.project = project
  42073. c.image = image
  42074. return c
  42075. }
  42076. // Fields allows partial responses to be retrieved. See
  42077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42078. // for more information.
  42079. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  42080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42081. return c
  42082. }
  42083. // IfNoneMatch sets the optional parameter which makes the operation
  42084. // fail if the object's ETag matches the given value. This is useful for
  42085. // getting updates only after the object has changed since the last
  42086. // request. Use googleapi.IsNotModified to check whether the response
  42087. // error from Do is the result of In-None-Match.
  42088. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  42089. c.ifNoneMatch_ = entityTag
  42090. return c
  42091. }
  42092. // Context sets the context to be used in this call's Do method. Any
  42093. // pending HTTP request will be aborted if the provided context is
  42094. // canceled.
  42095. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  42096. c.ctx_ = ctx
  42097. return c
  42098. }
  42099. // Header returns an http.Header that can be modified by the caller to
  42100. // add HTTP headers to the request.
  42101. func (c *ImagesGetCall) Header() http.Header {
  42102. if c.header_ == nil {
  42103. c.header_ = make(http.Header)
  42104. }
  42105. return c.header_
  42106. }
  42107. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  42108. reqHeaders := make(http.Header)
  42109. for k, v := range c.header_ {
  42110. reqHeaders[k] = v
  42111. }
  42112. reqHeaders.Set("User-Agent", c.s.userAgent())
  42113. if c.ifNoneMatch_ != "" {
  42114. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42115. }
  42116. var body io.Reader = nil
  42117. c.urlParams_.Set("alt", alt)
  42118. c.urlParams_.Set("prettyPrint", "false")
  42119. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  42120. urls += "?" + c.urlParams_.Encode()
  42121. req, err := http.NewRequest("GET", urls, body)
  42122. if err != nil {
  42123. return nil, err
  42124. }
  42125. req.Header = reqHeaders
  42126. googleapi.Expand(req.URL, map[string]string{
  42127. "project": c.project,
  42128. "image": c.image,
  42129. })
  42130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42131. }
  42132. // Do executes the "compute.images.get" call.
  42133. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  42134. // code is an error. Response headers are in either
  42135. // *Image.ServerResponse.Header or (if a response was returned at all)
  42136. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42137. // check whether the returned error was because http.StatusNotModified
  42138. // was returned.
  42139. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  42140. gensupport.SetOptions(c.urlParams_, opts...)
  42141. res, err := c.doRequest("json")
  42142. if res != nil && res.StatusCode == http.StatusNotModified {
  42143. if res.Body != nil {
  42144. res.Body.Close()
  42145. }
  42146. return nil, &googleapi.Error{
  42147. Code: res.StatusCode,
  42148. Header: res.Header,
  42149. }
  42150. }
  42151. if err != nil {
  42152. return nil, err
  42153. }
  42154. defer googleapi.CloseBody(res)
  42155. if err := googleapi.CheckResponse(res); err != nil {
  42156. return nil, err
  42157. }
  42158. ret := &Image{
  42159. ServerResponse: googleapi.ServerResponse{
  42160. Header: res.Header,
  42161. HTTPStatusCode: res.StatusCode,
  42162. },
  42163. }
  42164. target := &ret
  42165. if err := gensupport.DecodeResponse(target, res); err != nil {
  42166. return nil, err
  42167. }
  42168. return ret, nil
  42169. // {
  42170. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  42171. // "httpMethod": "GET",
  42172. // "id": "compute.images.get",
  42173. // "parameterOrder": [
  42174. // "project",
  42175. // "image"
  42176. // ],
  42177. // "parameters": {
  42178. // "image": {
  42179. // "description": "Name of the image resource to return.",
  42180. // "location": "path",
  42181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42182. // "required": true,
  42183. // "type": "string"
  42184. // },
  42185. // "project": {
  42186. // "description": "Project ID for this request.",
  42187. // "location": "path",
  42188. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42189. // "required": true,
  42190. // "type": "string"
  42191. // }
  42192. // },
  42193. // "path": "{project}/global/images/{image}",
  42194. // "response": {
  42195. // "$ref": "Image"
  42196. // },
  42197. // "scopes": [
  42198. // "https://www.googleapis.com/auth/cloud-platform",
  42199. // "https://www.googleapis.com/auth/compute",
  42200. // "https://www.googleapis.com/auth/compute.readonly"
  42201. // ]
  42202. // }
  42203. }
  42204. // method id "compute.images.getFromFamily":
  42205. type ImagesGetFromFamilyCall struct {
  42206. s *Service
  42207. project string
  42208. family string
  42209. urlParams_ gensupport.URLParams
  42210. ifNoneMatch_ string
  42211. ctx_ context.Context
  42212. header_ http.Header
  42213. }
  42214. // GetFromFamily: Returns the latest image that is part of an image
  42215. // family and is not deprecated.
  42216. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  42217. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42218. c.project = project
  42219. c.family = family
  42220. return c
  42221. }
  42222. // Fields allows partial responses to be retrieved. See
  42223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42224. // for more information.
  42225. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  42226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42227. return c
  42228. }
  42229. // IfNoneMatch sets the optional parameter which makes the operation
  42230. // fail if the object's ETag matches the given value. This is useful for
  42231. // getting updates only after the object has changed since the last
  42232. // request. Use googleapi.IsNotModified to check whether the response
  42233. // error from Do is the result of In-None-Match.
  42234. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  42235. c.ifNoneMatch_ = entityTag
  42236. return c
  42237. }
  42238. // Context sets the context to be used in this call's Do method. Any
  42239. // pending HTTP request will be aborted if the provided context is
  42240. // canceled.
  42241. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  42242. c.ctx_ = ctx
  42243. return c
  42244. }
  42245. // Header returns an http.Header that can be modified by the caller to
  42246. // add HTTP headers to the request.
  42247. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  42248. if c.header_ == nil {
  42249. c.header_ = make(http.Header)
  42250. }
  42251. return c.header_
  42252. }
  42253. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  42254. reqHeaders := make(http.Header)
  42255. for k, v := range c.header_ {
  42256. reqHeaders[k] = v
  42257. }
  42258. reqHeaders.Set("User-Agent", c.s.userAgent())
  42259. if c.ifNoneMatch_ != "" {
  42260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42261. }
  42262. var body io.Reader = nil
  42263. c.urlParams_.Set("alt", alt)
  42264. c.urlParams_.Set("prettyPrint", "false")
  42265. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  42266. urls += "?" + c.urlParams_.Encode()
  42267. req, err := http.NewRequest("GET", urls, body)
  42268. if err != nil {
  42269. return nil, err
  42270. }
  42271. req.Header = reqHeaders
  42272. googleapi.Expand(req.URL, map[string]string{
  42273. "project": c.project,
  42274. "family": c.family,
  42275. })
  42276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42277. }
  42278. // Do executes the "compute.images.getFromFamily" call.
  42279. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  42280. // code is an error. Response headers are in either
  42281. // *Image.ServerResponse.Header or (if a response was returned at all)
  42282. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42283. // check whether the returned error was because http.StatusNotModified
  42284. // was returned.
  42285. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  42286. gensupport.SetOptions(c.urlParams_, opts...)
  42287. res, err := c.doRequest("json")
  42288. if res != nil && res.StatusCode == http.StatusNotModified {
  42289. if res.Body != nil {
  42290. res.Body.Close()
  42291. }
  42292. return nil, &googleapi.Error{
  42293. Code: res.StatusCode,
  42294. Header: res.Header,
  42295. }
  42296. }
  42297. if err != nil {
  42298. return nil, err
  42299. }
  42300. defer googleapi.CloseBody(res)
  42301. if err := googleapi.CheckResponse(res); err != nil {
  42302. return nil, err
  42303. }
  42304. ret := &Image{
  42305. ServerResponse: googleapi.ServerResponse{
  42306. Header: res.Header,
  42307. HTTPStatusCode: res.StatusCode,
  42308. },
  42309. }
  42310. target := &ret
  42311. if err := gensupport.DecodeResponse(target, res); err != nil {
  42312. return nil, err
  42313. }
  42314. return ret, nil
  42315. // {
  42316. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  42317. // "httpMethod": "GET",
  42318. // "id": "compute.images.getFromFamily",
  42319. // "parameterOrder": [
  42320. // "project",
  42321. // "family"
  42322. // ],
  42323. // "parameters": {
  42324. // "family": {
  42325. // "description": "Name of the image family to search for.",
  42326. // "location": "path",
  42327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42328. // "required": true,
  42329. // "type": "string"
  42330. // },
  42331. // "project": {
  42332. // "description": "Project ID for this request.",
  42333. // "location": "path",
  42334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42335. // "required": true,
  42336. // "type": "string"
  42337. // }
  42338. // },
  42339. // "path": "{project}/global/images/family/{family}",
  42340. // "response": {
  42341. // "$ref": "Image"
  42342. // },
  42343. // "scopes": [
  42344. // "https://www.googleapis.com/auth/cloud-platform",
  42345. // "https://www.googleapis.com/auth/compute",
  42346. // "https://www.googleapis.com/auth/compute.readonly"
  42347. // ]
  42348. // }
  42349. }
  42350. // method id "compute.images.getIamPolicy":
  42351. type ImagesGetIamPolicyCall struct {
  42352. s *Service
  42353. project string
  42354. resource string
  42355. urlParams_ gensupport.URLParams
  42356. ifNoneMatch_ string
  42357. ctx_ context.Context
  42358. header_ http.Header
  42359. }
  42360. // GetIamPolicy: Gets the access control policy for a resource. May be
  42361. // empty if no such policy or resource exists.
  42362. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  42363. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42364. c.project = project
  42365. c.resource = resource
  42366. return c
  42367. }
  42368. // Fields allows partial responses to be retrieved. See
  42369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42370. // for more information.
  42371. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  42372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42373. return c
  42374. }
  42375. // IfNoneMatch sets the optional parameter which makes the operation
  42376. // fail if the object's ETag matches the given value. This is useful for
  42377. // getting updates only after the object has changed since the last
  42378. // request. Use googleapi.IsNotModified to check whether the response
  42379. // error from Do is the result of In-None-Match.
  42380. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  42381. c.ifNoneMatch_ = entityTag
  42382. return c
  42383. }
  42384. // Context sets the context to be used in this call's Do method. Any
  42385. // pending HTTP request will be aborted if the provided context is
  42386. // canceled.
  42387. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  42388. c.ctx_ = ctx
  42389. return c
  42390. }
  42391. // Header returns an http.Header that can be modified by the caller to
  42392. // add HTTP headers to the request.
  42393. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  42394. if c.header_ == nil {
  42395. c.header_ = make(http.Header)
  42396. }
  42397. return c.header_
  42398. }
  42399. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  42400. reqHeaders := make(http.Header)
  42401. for k, v := range c.header_ {
  42402. reqHeaders[k] = v
  42403. }
  42404. reqHeaders.Set("User-Agent", c.s.userAgent())
  42405. if c.ifNoneMatch_ != "" {
  42406. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42407. }
  42408. var body io.Reader = nil
  42409. c.urlParams_.Set("alt", alt)
  42410. c.urlParams_.Set("prettyPrint", "false")
  42411. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  42412. urls += "?" + c.urlParams_.Encode()
  42413. req, err := http.NewRequest("GET", urls, body)
  42414. if err != nil {
  42415. return nil, err
  42416. }
  42417. req.Header = reqHeaders
  42418. googleapi.Expand(req.URL, map[string]string{
  42419. "project": c.project,
  42420. "resource": c.resource,
  42421. })
  42422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42423. }
  42424. // Do executes the "compute.images.getIamPolicy" call.
  42425. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  42426. // code is an error. Response headers are in either
  42427. // *Policy.ServerResponse.Header or (if a response was returned at all)
  42428. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42429. // check whether the returned error was because http.StatusNotModified
  42430. // was returned.
  42431. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  42432. gensupport.SetOptions(c.urlParams_, opts...)
  42433. res, err := c.doRequest("json")
  42434. if res != nil && res.StatusCode == http.StatusNotModified {
  42435. if res.Body != nil {
  42436. res.Body.Close()
  42437. }
  42438. return nil, &googleapi.Error{
  42439. Code: res.StatusCode,
  42440. Header: res.Header,
  42441. }
  42442. }
  42443. if err != nil {
  42444. return nil, err
  42445. }
  42446. defer googleapi.CloseBody(res)
  42447. if err := googleapi.CheckResponse(res); err != nil {
  42448. return nil, err
  42449. }
  42450. ret := &Policy{
  42451. ServerResponse: googleapi.ServerResponse{
  42452. Header: res.Header,
  42453. HTTPStatusCode: res.StatusCode,
  42454. },
  42455. }
  42456. target := &ret
  42457. if err := gensupport.DecodeResponse(target, res); err != nil {
  42458. return nil, err
  42459. }
  42460. return ret, nil
  42461. // {
  42462. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  42463. // "httpMethod": "GET",
  42464. // "id": "compute.images.getIamPolicy",
  42465. // "parameterOrder": [
  42466. // "project",
  42467. // "resource"
  42468. // ],
  42469. // "parameters": {
  42470. // "project": {
  42471. // "description": "Project ID for this request.",
  42472. // "location": "path",
  42473. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42474. // "required": true,
  42475. // "type": "string"
  42476. // },
  42477. // "resource": {
  42478. // "description": "Name or id of the resource for this request.",
  42479. // "location": "path",
  42480. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42481. // "required": true,
  42482. // "type": "string"
  42483. // }
  42484. // },
  42485. // "path": "{project}/global/images/{resource}/getIamPolicy",
  42486. // "response": {
  42487. // "$ref": "Policy"
  42488. // },
  42489. // "scopes": [
  42490. // "https://www.googleapis.com/auth/cloud-platform",
  42491. // "https://www.googleapis.com/auth/compute",
  42492. // "https://www.googleapis.com/auth/compute.readonly"
  42493. // ]
  42494. // }
  42495. }
  42496. // method id "compute.images.insert":
  42497. type ImagesInsertCall struct {
  42498. s *Service
  42499. project string
  42500. image *Image
  42501. urlParams_ gensupport.URLParams
  42502. ctx_ context.Context
  42503. header_ http.Header
  42504. }
  42505. // Insert: Creates an image in the specified project using the data
  42506. // included in the request.
  42507. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  42508. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  42509. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42510. c.project = project
  42511. c.image = image
  42512. return c
  42513. }
  42514. // ForceCreate sets the optional parameter "forceCreate": Force image
  42515. // creation if true.
  42516. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  42517. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  42518. return c
  42519. }
  42520. // RequestId sets the optional parameter "requestId": An optional
  42521. // request ID to identify requests. Specify a unique request ID so that
  42522. // if you must retry your request, the server will know to ignore the
  42523. // request if it has already been completed.
  42524. //
  42525. // For example, consider a situation where you make an initial request
  42526. // and the request times out. If you make the request again with the
  42527. // same request ID, the server can check if original operation with the
  42528. // same request ID was received, and if so, will ignore the second
  42529. // request. This prevents clients from accidentally creating duplicate
  42530. // commitments.
  42531. //
  42532. // The request ID must be a valid UUID with the exception that zero UUID
  42533. // is not supported (00000000-0000-0000-0000-000000000000).
  42534. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  42535. c.urlParams_.Set("requestId", requestId)
  42536. return c
  42537. }
  42538. // Fields allows partial responses to be retrieved. See
  42539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42540. // for more information.
  42541. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  42542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42543. return c
  42544. }
  42545. // Context sets the context to be used in this call's Do method. Any
  42546. // pending HTTP request will be aborted if the provided context is
  42547. // canceled.
  42548. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  42549. c.ctx_ = ctx
  42550. return c
  42551. }
  42552. // Header returns an http.Header that can be modified by the caller to
  42553. // add HTTP headers to the request.
  42554. func (c *ImagesInsertCall) Header() http.Header {
  42555. if c.header_ == nil {
  42556. c.header_ = make(http.Header)
  42557. }
  42558. return c.header_
  42559. }
  42560. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  42561. reqHeaders := make(http.Header)
  42562. for k, v := range c.header_ {
  42563. reqHeaders[k] = v
  42564. }
  42565. reqHeaders.Set("User-Agent", c.s.userAgent())
  42566. var body io.Reader = nil
  42567. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  42568. if err != nil {
  42569. return nil, err
  42570. }
  42571. reqHeaders.Set("Content-Type", "application/json")
  42572. c.urlParams_.Set("alt", alt)
  42573. c.urlParams_.Set("prettyPrint", "false")
  42574. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  42575. urls += "?" + c.urlParams_.Encode()
  42576. req, err := http.NewRequest("POST", urls, body)
  42577. if err != nil {
  42578. return nil, err
  42579. }
  42580. req.Header = reqHeaders
  42581. googleapi.Expand(req.URL, map[string]string{
  42582. "project": c.project,
  42583. })
  42584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42585. }
  42586. // Do executes the "compute.images.insert" call.
  42587. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42588. // status code is an error. Response headers are in either
  42589. // *Operation.ServerResponse.Header or (if a response was returned at
  42590. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42591. // to check whether the returned error was because
  42592. // http.StatusNotModified was returned.
  42593. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42594. gensupport.SetOptions(c.urlParams_, opts...)
  42595. res, err := c.doRequest("json")
  42596. if res != nil && res.StatusCode == http.StatusNotModified {
  42597. if res.Body != nil {
  42598. res.Body.Close()
  42599. }
  42600. return nil, &googleapi.Error{
  42601. Code: res.StatusCode,
  42602. Header: res.Header,
  42603. }
  42604. }
  42605. if err != nil {
  42606. return nil, err
  42607. }
  42608. defer googleapi.CloseBody(res)
  42609. if err := googleapi.CheckResponse(res); err != nil {
  42610. return nil, err
  42611. }
  42612. ret := &Operation{
  42613. ServerResponse: googleapi.ServerResponse{
  42614. Header: res.Header,
  42615. HTTPStatusCode: res.StatusCode,
  42616. },
  42617. }
  42618. target := &ret
  42619. if err := gensupport.DecodeResponse(target, res); err != nil {
  42620. return nil, err
  42621. }
  42622. return ret, nil
  42623. // {
  42624. // "description": "Creates an image in the specified project using the data included in the request.",
  42625. // "httpMethod": "POST",
  42626. // "id": "compute.images.insert",
  42627. // "parameterOrder": [
  42628. // "project"
  42629. // ],
  42630. // "parameters": {
  42631. // "forceCreate": {
  42632. // "description": "Force image creation if true.",
  42633. // "location": "query",
  42634. // "type": "boolean"
  42635. // },
  42636. // "project": {
  42637. // "description": "Project ID for this request.",
  42638. // "location": "path",
  42639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42640. // "required": true,
  42641. // "type": "string"
  42642. // },
  42643. // "requestId": {
  42644. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42645. // "location": "query",
  42646. // "type": "string"
  42647. // }
  42648. // },
  42649. // "path": "{project}/global/images",
  42650. // "request": {
  42651. // "$ref": "Image"
  42652. // },
  42653. // "response": {
  42654. // "$ref": "Operation"
  42655. // },
  42656. // "scopes": [
  42657. // "https://www.googleapis.com/auth/cloud-platform",
  42658. // "https://www.googleapis.com/auth/compute",
  42659. // "https://www.googleapis.com/auth/devstorage.full_control",
  42660. // "https://www.googleapis.com/auth/devstorage.read_only",
  42661. // "https://www.googleapis.com/auth/devstorage.read_write"
  42662. // ]
  42663. // }
  42664. }
  42665. // method id "compute.images.list":
  42666. type ImagesListCall struct {
  42667. s *Service
  42668. project string
  42669. urlParams_ gensupport.URLParams
  42670. ifNoneMatch_ string
  42671. ctx_ context.Context
  42672. header_ http.Header
  42673. }
  42674. // List: Retrieves the list of custom images available to the specified
  42675. // project. Custom images are images you create that belong to your
  42676. // project. This method does not get any images that belong to other
  42677. // projects, including publicly-available images, like Debian 8. If you
  42678. // want to get a list of publicly-available images, use this method to
  42679. // make a request to the respective image project, such as debian-cloud
  42680. // or windows-cloud.
  42681. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  42682. func (r *ImagesService) List(project string) *ImagesListCall {
  42683. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42684. c.project = project
  42685. return c
  42686. }
  42687. // Filter sets the optional parameter "filter": A filter expression that
  42688. // filters resources listed in the response. The expression must specify
  42689. // the field name, a comparison operator, and the value that you want to
  42690. // use for filtering. The value must be a string, a number, or a
  42691. // boolean. The comparison operator must be either =, !=, >, or <.
  42692. //
  42693. // For example, if you are filtering Compute Engine instances, you can
  42694. // exclude instances named example-instance by specifying name !=
  42695. // example-instance.
  42696. //
  42697. // You can also filter nested fields. For example, you could specify
  42698. // scheduling.automaticRestart = false to include instances only if they
  42699. // are not scheduled for automatic restarts. You can use filtering on
  42700. // nested fields to filter based on resource labels.
  42701. //
  42702. // To filter on multiple expressions, provide each separate expression
  42703. // within parentheses. For example, (scheduling.automaticRestart = true)
  42704. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42705. // AND expression. However, you can include AND and OR expressions
  42706. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42707. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42708. // true).
  42709. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  42710. c.urlParams_.Set("filter", filter)
  42711. return c
  42712. }
  42713. // MaxResults sets the optional parameter "maxResults": The maximum
  42714. // number of results per page that should be returned. If the number of
  42715. // available results is larger than maxResults, Compute Engine returns a
  42716. // nextPageToken that can be used to get the next page of results in
  42717. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42718. // (Default: 500)
  42719. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  42720. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42721. return c
  42722. }
  42723. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42724. // a certain order. By default, results are returned in alphanumerical
  42725. // order based on the resource name.
  42726. //
  42727. // You can also sort results in descending order based on the creation
  42728. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42729. // based on the creationTimestamp field in reverse chronological order
  42730. // (newest result first). Use this to sort resources like operations so
  42731. // that the newest operation is returned first.
  42732. //
  42733. // Currently, only sorting by name or creationTimestamp desc is
  42734. // supported.
  42735. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  42736. c.urlParams_.Set("orderBy", orderBy)
  42737. return c
  42738. }
  42739. // PageToken sets the optional parameter "pageToken": Specifies a page
  42740. // token to use. Set pageToken to the nextPageToken returned by a
  42741. // previous list request to get the next page of results.
  42742. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  42743. c.urlParams_.Set("pageToken", pageToken)
  42744. return c
  42745. }
  42746. // Fields allows partial responses to be retrieved. See
  42747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42748. // for more information.
  42749. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  42750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42751. return c
  42752. }
  42753. // IfNoneMatch sets the optional parameter which makes the operation
  42754. // fail if the object's ETag matches the given value. This is useful for
  42755. // getting updates only after the object has changed since the last
  42756. // request. Use googleapi.IsNotModified to check whether the response
  42757. // error from Do is the result of In-None-Match.
  42758. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  42759. c.ifNoneMatch_ = entityTag
  42760. return c
  42761. }
  42762. // Context sets the context to be used in this call's Do method. Any
  42763. // pending HTTP request will be aborted if the provided context is
  42764. // canceled.
  42765. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  42766. c.ctx_ = ctx
  42767. return c
  42768. }
  42769. // Header returns an http.Header that can be modified by the caller to
  42770. // add HTTP headers to the request.
  42771. func (c *ImagesListCall) Header() http.Header {
  42772. if c.header_ == nil {
  42773. c.header_ = make(http.Header)
  42774. }
  42775. return c.header_
  42776. }
  42777. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  42778. reqHeaders := make(http.Header)
  42779. for k, v := range c.header_ {
  42780. reqHeaders[k] = v
  42781. }
  42782. reqHeaders.Set("User-Agent", c.s.userAgent())
  42783. if c.ifNoneMatch_ != "" {
  42784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42785. }
  42786. var body io.Reader = nil
  42787. c.urlParams_.Set("alt", alt)
  42788. c.urlParams_.Set("prettyPrint", "false")
  42789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  42790. urls += "?" + c.urlParams_.Encode()
  42791. req, err := http.NewRequest("GET", urls, body)
  42792. if err != nil {
  42793. return nil, err
  42794. }
  42795. req.Header = reqHeaders
  42796. googleapi.Expand(req.URL, map[string]string{
  42797. "project": c.project,
  42798. })
  42799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42800. }
  42801. // Do executes the "compute.images.list" call.
  42802. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  42803. // status code is an error. Response headers are in either
  42804. // *ImageList.ServerResponse.Header or (if a response was returned at
  42805. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42806. // to check whether the returned error was because
  42807. // http.StatusNotModified was returned.
  42808. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  42809. gensupport.SetOptions(c.urlParams_, opts...)
  42810. res, err := c.doRequest("json")
  42811. if res != nil && res.StatusCode == http.StatusNotModified {
  42812. if res.Body != nil {
  42813. res.Body.Close()
  42814. }
  42815. return nil, &googleapi.Error{
  42816. Code: res.StatusCode,
  42817. Header: res.Header,
  42818. }
  42819. }
  42820. if err != nil {
  42821. return nil, err
  42822. }
  42823. defer googleapi.CloseBody(res)
  42824. if err := googleapi.CheckResponse(res); err != nil {
  42825. return nil, err
  42826. }
  42827. ret := &ImageList{
  42828. ServerResponse: googleapi.ServerResponse{
  42829. Header: res.Header,
  42830. HTTPStatusCode: res.StatusCode,
  42831. },
  42832. }
  42833. target := &ret
  42834. if err := gensupport.DecodeResponse(target, res); err != nil {
  42835. return nil, err
  42836. }
  42837. return ret, nil
  42838. // {
  42839. // "description": "Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
  42840. // "httpMethod": "GET",
  42841. // "id": "compute.images.list",
  42842. // "parameterOrder": [
  42843. // "project"
  42844. // ],
  42845. // "parameters": {
  42846. // "filter": {
  42847. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  42848. // "location": "query",
  42849. // "type": "string"
  42850. // },
  42851. // "maxResults": {
  42852. // "default": "500",
  42853. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  42854. // "format": "uint32",
  42855. // "location": "query",
  42856. // "minimum": "0",
  42857. // "type": "integer"
  42858. // },
  42859. // "orderBy": {
  42860. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  42861. // "location": "query",
  42862. // "type": "string"
  42863. // },
  42864. // "pageToken": {
  42865. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  42866. // "location": "query",
  42867. // "type": "string"
  42868. // },
  42869. // "project": {
  42870. // "description": "Project ID for this request.",
  42871. // "location": "path",
  42872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42873. // "required": true,
  42874. // "type": "string"
  42875. // }
  42876. // },
  42877. // "path": "{project}/global/images",
  42878. // "response": {
  42879. // "$ref": "ImageList"
  42880. // },
  42881. // "scopes": [
  42882. // "https://www.googleapis.com/auth/cloud-platform",
  42883. // "https://www.googleapis.com/auth/compute",
  42884. // "https://www.googleapis.com/auth/compute.readonly"
  42885. // ]
  42886. // }
  42887. }
  42888. // Pages invokes f for each page of results.
  42889. // A non-nil error returned from f will halt the iteration.
  42890. // The provided context supersedes any context provided to the Context method.
  42891. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  42892. c.ctx_ = ctx
  42893. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42894. for {
  42895. x, err := c.Do()
  42896. if err != nil {
  42897. return err
  42898. }
  42899. if err := f(x); err != nil {
  42900. return err
  42901. }
  42902. if x.NextPageToken == "" {
  42903. return nil
  42904. }
  42905. c.PageToken(x.NextPageToken)
  42906. }
  42907. }
  42908. // method id "compute.images.setIamPolicy":
  42909. type ImagesSetIamPolicyCall struct {
  42910. s *Service
  42911. project string
  42912. resource string
  42913. globalsetpolicyrequest *GlobalSetPolicyRequest
  42914. urlParams_ gensupport.URLParams
  42915. ctx_ context.Context
  42916. header_ http.Header
  42917. }
  42918. // SetIamPolicy: Sets the access control policy on the specified
  42919. // resource. Replaces any existing policy.
  42920. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  42921. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42922. c.project = project
  42923. c.resource = resource
  42924. c.globalsetpolicyrequest = globalsetpolicyrequest
  42925. return c
  42926. }
  42927. // Fields allows partial responses to be retrieved. See
  42928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42929. // for more information.
  42930. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  42931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42932. return c
  42933. }
  42934. // Context sets the context to be used in this call's Do method. Any
  42935. // pending HTTP request will be aborted if the provided context is
  42936. // canceled.
  42937. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  42938. c.ctx_ = ctx
  42939. return c
  42940. }
  42941. // Header returns an http.Header that can be modified by the caller to
  42942. // add HTTP headers to the request.
  42943. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  42944. if c.header_ == nil {
  42945. c.header_ = make(http.Header)
  42946. }
  42947. return c.header_
  42948. }
  42949. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  42950. reqHeaders := make(http.Header)
  42951. for k, v := range c.header_ {
  42952. reqHeaders[k] = v
  42953. }
  42954. reqHeaders.Set("User-Agent", c.s.userAgent())
  42955. var body io.Reader = nil
  42956. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  42957. if err != nil {
  42958. return nil, err
  42959. }
  42960. reqHeaders.Set("Content-Type", "application/json")
  42961. c.urlParams_.Set("alt", alt)
  42962. c.urlParams_.Set("prettyPrint", "false")
  42963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  42964. urls += "?" + c.urlParams_.Encode()
  42965. req, err := http.NewRequest("POST", urls, body)
  42966. if err != nil {
  42967. return nil, err
  42968. }
  42969. req.Header = reqHeaders
  42970. googleapi.Expand(req.URL, map[string]string{
  42971. "project": c.project,
  42972. "resource": c.resource,
  42973. })
  42974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42975. }
  42976. // Do executes the "compute.images.setIamPolicy" call.
  42977. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  42978. // code is an error. Response headers are in either
  42979. // *Policy.ServerResponse.Header or (if a response was returned at all)
  42980. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  42981. // check whether the returned error was because http.StatusNotModified
  42982. // was returned.
  42983. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  42984. gensupport.SetOptions(c.urlParams_, opts...)
  42985. res, err := c.doRequest("json")
  42986. if res != nil && res.StatusCode == http.StatusNotModified {
  42987. if res.Body != nil {
  42988. res.Body.Close()
  42989. }
  42990. return nil, &googleapi.Error{
  42991. Code: res.StatusCode,
  42992. Header: res.Header,
  42993. }
  42994. }
  42995. if err != nil {
  42996. return nil, err
  42997. }
  42998. defer googleapi.CloseBody(res)
  42999. if err := googleapi.CheckResponse(res); err != nil {
  43000. return nil, err
  43001. }
  43002. ret := &Policy{
  43003. ServerResponse: googleapi.ServerResponse{
  43004. Header: res.Header,
  43005. HTTPStatusCode: res.StatusCode,
  43006. },
  43007. }
  43008. target := &ret
  43009. if err := gensupport.DecodeResponse(target, res); err != nil {
  43010. return nil, err
  43011. }
  43012. return ret, nil
  43013. // {
  43014. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  43015. // "httpMethod": "POST",
  43016. // "id": "compute.images.setIamPolicy",
  43017. // "parameterOrder": [
  43018. // "project",
  43019. // "resource"
  43020. // ],
  43021. // "parameters": {
  43022. // "project": {
  43023. // "description": "Project ID for this request.",
  43024. // "location": "path",
  43025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43026. // "required": true,
  43027. // "type": "string"
  43028. // },
  43029. // "resource": {
  43030. // "description": "Name or id of the resource for this request.",
  43031. // "location": "path",
  43032. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43033. // "required": true,
  43034. // "type": "string"
  43035. // }
  43036. // },
  43037. // "path": "{project}/global/images/{resource}/setIamPolicy",
  43038. // "request": {
  43039. // "$ref": "GlobalSetPolicyRequest"
  43040. // },
  43041. // "response": {
  43042. // "$ref": "Policy"
  43043. // },
  43044. // "scopes": [
  43045. // "https://www.googleapis.com/auth/cloud-platform",
  43046. // "https://www.googleapis.com/auth/compute"
  43047. // ]
  43048. // }
  43049. }
  43050. // method id "compute.images.setLabels":
  43051. type ImagesSetLabelsCall struct {
  43052. s *Service
  43053. project string
  43054. resource string
  43055. globalsetlabelsrequest *GlobalSetLabelsRequest
  43056. urlParams_ gensupport.URLParams
  43057. ctx_ context.Context
  43058. header_ http.Header
  43059. }
  43060. // SetLabels: Sets the labels on an image. To learn more about labels,
  43061. // read the Labeling Resources documentation.
  43062. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  43063. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43064. c.project = project
  43065. c.resource = resource
  43066. c.globalsetlabelsrequest = globalsetlabelsrequest
  43067. return c
  43068. }
  43069. // Fields allows partial responses to be retrieved. See
  43070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43071. // for more information.
  43072. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  43073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43074. return c
  43075. }
  43076. // Context sets the context to be used in this call's Do method. Any
  43077. // pending HTTP request will be aborted if the provided context is
  43078. // canceled.
  43079. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  43080. c.ctx_ = ctx
  43081. return c
  43082. }
  43083. // Header returns an http.Header that can be modified by the caller to
  43084. // add HTTP headers to the request.
  43085. func (c *ImagesSetLabelsCall) Header() http.Header {
  43086. if c.header_ == nil {
  43087. c.header_ = make(http.Header)
  43088. }
  43089. return c.header_
  43090. }
  43091. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  43092. reqHeaders := make(http.Header)
  43093. for k, v := range c.header_ {
  43094. reqHeaders[k] = v
  43095. }
  43096. reqHeaders.Set("User-Agent", c.s.userAgent())
  43097. var body io.Reader = nil
  43098. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  43099. if err != nil {
  43100. return nil, err
  43101. }
  43102. reqHeaders.Set("Content-Type", "application/json")
  43103. c.urlParams_.Set("alt", alt)
  43104. c.urlParams_.Set("prettyPrint", "false")
  43105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  43106. urls += "?" + c.urlParams_.Encode()
  43107. req, err := http.NewRequest("POST", urls, body)
  43108. if err != nil {
  43109. return nil, err
  43110. }
  43111. req.Header = reqHeaders
  43112. googleapi.Expand(req.URL, map[string]string{
  43113. "project": c.project,
  43114. "resource": c.resource,
  43115. })
  43116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43117. }
  43118. // Do executes the "compute.images.setLabels" call.
  43119. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43120. // status code is an error. Response headers are in either
  43121. // *Operation.ServerResponse.Header or (if a response was returned at
  43122. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43123. // to check whether the returned error was because
  43124. // http.StatusNotModified was returned.
  43125. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43126. gensupport.SetOptions(c.urlParams_, opts...)
  43127. res, err := c.doRequest("json")
  43128. if res != nil && res.StatusCode == http.StatusNotModified {
  43129. if res.Body != nil {
  43130. res.Body.Close()
  43131. }
  43132. return nil, &googleapi.Error{
  43133. Code: res.StatusCode,
  43134. Header: res.Header,
  43135. }
  43136. }
  43137. if err != nil {
  43138. return nil, err
  43139. }
  43140. defer googleapi.CloseBody(res)
  43141. if err := googleapi.CheckResponse(res); err != nil {
  43142. return nil, err
  43143. }
  43144. ret := &Operation{
  43145. ServerResponse: googleapi.ServerResponse{
  43146. Header: res.Header,
  43147. HTTPStatusCode: res.StatusCode,
  43148. },
  43149. }
  43150. target := &ret
  43151. if err := gensupport.DecodeResponse(target, res); err != nil {
  43152. return nil, err
  43153. }
  43154. return ret, nil
  43155. // {
  43156. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  43157. // "httpMethod": "POST",
  43158. // "id": "compute.images.setLabels",
  43159. // "parameterOrder": [
  43160. // "project",
  43161. // "resource"
  43162. // ],
  43163. // "parameters": {
  43164. // "project": {
  43165. // "description": "Project ID for this request.",
  43166. // "location": "path",
  43167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43168. // "required": true,
  43169. // "type": "string"
  43170. // },
  43171. // "resource": {
  43172. // "description": "Name or id of the resource for this request.",
  43173. // "location": "path",
  43174. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43175. // "required": true,
  43176. // "type": "string"
  43177. // }
  43178. // },
  43179. // "path": "{project}/global/images/{resource}/setLabels",
  43180. // "request": {
  43181. // "$ref": "GlobalSetLabelsRequest"
  43182. // },
  43183. // "response": {
  43184. // "$ref": "Operation"
  43185. // },
  43186. // "scopes": [
  43187. // "https://www.googleapis.com/auth/cloud-platform",
  43188. // "https://www.googleapis.com/auth/compute"
  43189. // ]
  43190. // }
  43191. }
  43192. // method id "compute.images.testIamPermissions":
  43193. type ImagesTestIamPermissionsCall struct {
  43194. s *Service
  43195. project string
  43196. resource string
  43197. testpermissionsrequest *TestPermissionsRequest
  43198. urlParams_ gensupport.URLParams
  43199. ctx_ context.Context
  43200. header_ http.Header
  43201. }
  43202. // TestIamPermissions: Returns permissions that a caller has on the
  43203. // specified resource.
  43204. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  43205. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43206. c.project = project
  43207. c.resource = resource
  43208. c.testpermissionsrequest = testpermissionsrequest
  43209. return c
  43210. }
  43211. // Fields allows partial responses to be retrieved. See
  43212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43213. // for more information.
  43214. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  43215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43216. return c
  43217. }
  43218. // Context sets the context to be used in this call's Do method. Any
  43219. // pending HTTP request will be aborted if the provided context is
  43220. // canceled.
  43221. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  43222. c.ctx_ = ctx
  43223. return c
  43224. }
  43225. // Header returns an http.Header that can be modified by the caller to
  43226. // add HTTP headers to the request.
  43227. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  43228. if c.header_ == nil {
  43229. c.header_ = make(http.Header)
  43230. }
  43231. return c.header_
  43232. }
  43233. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43234. reqHeaders := make(http.Header)
  43235. for k, v := range c.header_ {
  43236. reqHeaders[k] = v
  43237. }
  43238. reqHeaders.Set("User-Agent", c.s.userAgent())
  43239. var body io.Reader = nil
  43240. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43241. if err != nil {
  43242. return nil, err
  43243. }
  43244. reqHeaders.Set("Content-Type", "application/json")
  43245. c.urlParams_.Set("alt", alt)
  43246. c.urlParams_.Set("prettyPrint", "false")
  43247. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  43248. urls += "?" + c.urlParams_.Encode()
  43249. req, err := http.NewRequest("POST", urls, body)
  43250. if err != nil {
  43251. return nil, err
  43252. }
  43253. req.Header = reqHeaders
  43254. googleapi.Expand(req.URL, map[string]string{
  43255. "project": c.project,
  43256. "resource": c.resource,
  43257. })
  43258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43259. }
  43260. // Do executes the "compute.images.testIamPermissions" call.
  43261. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43262. // non-2xx status code is an error. Response headers are in either
  43263. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43264. // returned at all) in error.(*googleapi.Error).Header. Use
  43265. // googleapi.IsNotModified to check whether the returned error was
  43266. // because http.StatusNotModified was returned.
  43267. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43268. gensupport.SetOptions(c.urlParams_, opts...)
  43269. res, err := c.doRequest("json")
  43270. if res != nil && res.StatusCode == http.StatusNotModified {
  43271. if res.Body != nil {
  43272. res.Body.Close()
  43273. }
  43274. return nil, &googleapi.Error{
  43275. Code: res.StatusCode,
  43276. Header: res.Header,
  43277. }
  43278. }
  43279. if err != nil {
  43280. return nil, err
  43281. }
  43282. defer googleapi.CloseBody(res)
  43283. if err := googleapi.CheckResponse(res); err != nil {
  43284. return nil, err
  43285. }
  43286. ret := &TestPermissionsResponse{
  43287. ServerResponse: googleapi.ServerResponse{
  43288. Header: res.Header,
  43289. HTTPStatusCode: res.StatusCode,
  43290. },
  43291. }
  43292. target := &ret
  43293. if err := gensupport.DecodeResponse(target, res); err != nil {
  43294. return nil, err
  43295. }
  43296. return ret, nil
  43297. // {
  43298. // "description": "Returns permissions that a caller has on the specified resource.",
  43299. // "httpMethod": "POST",
  43300. // "id": "compute.images.testIamPermissions",
  43301. // "parameterOrder": [
  43302. // "project",
  43303. // "resource"
  43304. // ],
  43305. // "parameters": {
  43306. // "project": {
  43307. // "description": "Project ID for this request.",
  43308. // "location": "path",
  43309. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43310. // "required": true,
  43311. // "type": "string"
  43312. // },
  43313. // "resource": {
  43314. // "description": "Name or id of the resource for this request.",
  43315. // "location": "path",
  43316. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43317. // "required": true,
  43318. // "type": "string"
  43319. // }
  43320. // },
  43321. // "path": "{project}/global/images/{resource}/testIamPermissions",
  43322. // "request": {
  43323. // "$ref": "TestPermissionsRequest"
  43324. // },
  43325. // "response": {
  43326. // "$ref": "TestPermissionsResponse"
  43327. // },
  43328. // "scopes": [
  43329. // "https://www.googleapis.com/auth/cloud-platform",
  43330. // "https://www.googleapis.com/auth/compute",
  43331. // "https://www.googleapis.com/auth/compute.readonly"
  43332. // ]
  43333. // }
  43334. }
  43335. // method id "compute.instanceGroupManagers.abandonInstances":
  43336. type InstanceGroupManagersAbandonInstancesCall struct {
  43337. s *Service
  43338. project string
  43339. zone string
  43340. instanceGroupManager string
  43341. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  43342. urlParams_ gensupport.URLParams
  43343. ctx_ context.Context
  43344. header_ http.Header
  43345. }
  43346. // AbandonInstances: Flags the specified instances to be removed from
  43347. // the managed instance group. Abandoning an instance does not delete
  43348. // the instance, but it does remove the instance from any target pools
  43349. // that are applied by the managed instance group. This method reduces
  43350. // the targetSize of the managed instance group by the number of
  43351. // instances that you abandon. This operation is marked as DONE when the
  43352. // action is scheduled even if the instances have not yet been removed
  43353. // from the group. You must separately verify the status of the
  43354. // abandoning action with the listmanagedinstances method.
  43355. //
  43356. // If the group is part of a backend service that has enabled connection
  43357. // draining, it can take up to 60 seconds after the connection draining
  43358. // duration has elapsed before the VM instance is removed or
  43359. // deleted.
  43360. //
  43361. // You can specify a maximum of 1000 instances with this method per
  43362. // request.
  43363. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  43364. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43365. c.project = project
  43366. c.zone = zone
  43367. c.instanceGroupManager = instanceGroupManager
  43368. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  43369. return c
  43370. }
  43371. // RequestId sets the optional parameter "requestId": An optional
  43372. // request ID to identify requests. Specify a unique request ID so that
  43373. // if you must retry your request, the server will know to ignore the
  43374. // request if it has already been completed.
  43375. //
  43376. // For example, consider a situation where you make an initial request
  43377. // and the request times out. If you make the request again with the
  43378. // same request ID, the server can check if original operation with the
  43379. // same request ID was received, and if so, will ignore the second
  43380. // request. This prevents clients from accidentally creating duplicate
  43381. // commitments.
  43382. //
  43383. // The request ID must be a valid UUID with the exception that zero UUID
  43384. // is not supported (00000000-0000-0000-0000-000000000000).
  43385. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  43386. c.urlParams_.Set("requestId", requestId)
  43387. return c
  43388. }
  43389. // Fields allows partial responses to be retrieved. See
  43390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43391. // for more information.
  43392. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  43393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43394. return c
  43395. }
  43396. // Context sets the context to be used in this call's Do method. Any
  43397. // pending HTTP request will be aborted if the provided context is
  43398. // canceled.
  43399. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  43400. c.ctx_ = ctx
  43401. return c
  43402. }
  43403. // Header returns an http.Header that can be modified by the caller to
  43404. // add HTTP headers to the request.
  43405. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  43406. if c.header_ == nil {
  43407. c.header_ = make(http.Header)
  43408. }
  43409. return c.header_
  43410. }
  43411. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  43412. reqHeaders := make(http.Header)
  43413. for k, v := range c.header_ {
  43414. reqHeaders[k] = v
  43415. }
  43416. reqHeaders.Set("User-Agent", c.s.userAgent())
  43417. var body io.Reader = nil
  43418. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  43419. if err != nil {
  43420. return nil, err
  43421. }
  43422. reqHeaders.Set("Content-Type", "application/json")
  43423. c.urlParams_.Set("alt", alt)
  43424. c.urlParams_.Set("prettyPrint", "false")
  43425. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  43426. urls += "?" + c.urlParams_.Encode()
  43427. req, err := http.NewRequest("POST", urls, body)
  43428. if err != nil {
  43429. return nil, err
  43430. }
  43431. req.Header = reqHeaders
  43432. googleapi.Expand(req.URL, map[string]string{
  43433. "project": c.project,
  43434. "zone": c.zone,
  43435. "instanceGroupManager": c.instanceGroupManager,
  43436. })
  43437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43438. }
  43439. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  43440. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43441. // status code is an error. Response headers are in either
  43442. // *Operation.ServerResponse.Header or (if a response was returned at
  43443. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43444. // to check whether the returned error was because
  43445. // http.StatusNotModified was returned.
  43446. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43447. gensupport.SetOptions(c.urlParams_, opts...)
  43448. res, err := c.doRequest("json")
  43449. if res != nil && res.StatusCode == http.StatusNotModified {
  43450. if res.Body != nil {
  43451. res.Body.Close()
  43452. }
  43453. return nil, &googleapi.Error{
  43454. Code: res.StatusCode,
  43455. Header: res.Header,
  43456. }
  43457. }
  43458. if err != nil {
  43459. return nil, err
  43460. }
  43461. defer googleapi.CloseBody(res)
  43462. if err := googleapi.CheckResponse(res); err != nil {
  43463. return nil, err
  43464. }
  43465. ret := &Operation{
  43466. ServerResponse: googleapi.ServerResponse{
  43467. Header: res.Header,
  43468. HTTPStatusCode: res.StatusCode,
  43469. },
  43470. }
  43471. target := &ret
  43472. if err := gensupport.DecodeResponse(target, res); err != nil {
  43473. return nil, err
  43474. }
  43475. return ret, nil
  43476. // {
  43477. // "description": "Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  43478. // "httpMethod": "POST",
  43479. // "id": "compute.instanceGroupManagers.abandonInstances",
  43480. // "parameterOrder": [
  43481. // "project",
  43482. // "zone",
  43483. // "instanceGroupManager"
  43484. // ],
  43485. // "parameters": {
  43486. // "instanceGroupManager": {
  43487. // "description": "The name of the managed instance group.",
  43488. // "location": "path",
  43489. // "required": true,
  43490. // "type": "string"
  43491. // },
  43492. // "project": {
  43493. // "description": "Project ID for this request.",
  43494. // "location": "path",
  43495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43496. // "required": true,
  43497. // "type": "string"
  43498. // },
  43499. // "requestId": {
  43500. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43501. // "location": "query",
  43502. // "type": "string"
  43503. // },
  43504. // "zone": {
  43505. // "description": "The name of the zone where the managed instance group is located.",
  43506. // "location": "path",
  43507. // "required": true,
  43508. // "type": "string"
  43509. // }
  43510. // },
  43511. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  43512. // "request": {
  43513. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  43514. // },
  43515. // "response": {
  43516. // "$ref": "Operation"
  43517. // },
  43518. // "scopes": [
  43519. // "https://www.googleapis.com/auth/cloud-platform",
  43520. // "https://www.googleapis.com/auth/compute"
  43521. // ]
  43522. // }
  43523. }
  43524. // method id "compute.instanceGroupManagers.aggregatedList":
  43525. type InstanceGroupManagersAggregatedListCall struct {
  43526. s *Service
  43527. project string
  43528. urlParams_ gensupport.URLParams
  43529. ifNoneMatch_ string
  43530. ctx_ context.Context
  43531. header_ http.Header
  43532. }
  43533. // AggregatedList: Retrieves the list of managed instance groups and
  43534. // groups them by zone.
  43535. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  43536. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43537. c.project = project
  43538. return c
  43539. }
  43540. // Filter sets the optional parameter "filter": A filter expression that
  43541. // filters resources listed in the response. The expression must specify
  43542. // the field name, a comparison operator, and the value that you want to
  43543. // use for filtering. The value must be a string, a number, or a
  43544. // boolean. The comparison operator must be either =, !=, >, or <.
  43545. //
  43546. // For example, if you are filtering Compute Engine instances, you can
  43547. // exclude instances named example-instance by specifying name !=
  43548. // example-instance.
  43549. //
  43550. // You can also filter nested fields. For example, you could specify
  43551. // scheduling.automaticRestart = false to include instances only if they
  43552. // are not scheduled for automatic restarts. You can use filtering on
  43553. // nested fields to filter based on resource labels.
  43554. //
  43555. // To filter on multiple expressions, provide each separate expression
  43556. // within parentheses. For example, (scheduling.automaticRestart = true)
  43557. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43558. // AND expression. However, you can include AND and OR expressions
  43559. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43560. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43561. // true).
  43562. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  43563. c.urlParams_.Set("filter", filter)
  43564. return c
  43565. }
  43566. // MaxResults sets the optional parameter "maxResults": The maximum
  43567. // number of results per page that should be returned. If the number of
  43568. // available results is larger than maxResults, Compute Engine returns a
  43569. // nextPageToken that can be used to get the next page of results in
  43570. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43571. // (Default: 500)
  43572. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  43573. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43574. return c
  43575. }
  43576. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43577. // a certain order. By default, results are returned in alphanumerical
  43578. // order based on the resource name.
  43579. //
  43580. // You can also sort results in descending order based on the creation
  43581. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43582. // based on the creationTimestamp field in reverse chronological order
  43583. // (newest result first). Use this to sort resources like operations so
  43584. // that the newest operation is returned first.
  43585. //
  43586. // Currently, only sorting by name or creationTimestamp desc is
  43587. // supported.
  43588. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  43589. c.urlParams_.Set("orderBy", orderBy)
  43590. return c
  43591. }
  43592. // PageToken sets the optional parameter "pageToken": Specifies a page
  43593. // token to use. Set pageToken to the nextPageToken returned by a
  43594. // previous list request to get the next page of results.
  43595. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  43596. c.urlParams_.Set("pageToken", pageToken)
  43597. return c
  43598. }
  43599. // Fields allows partial responses to be retrieved. See
  43600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43601. // for more information.
  43602. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  43603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43604. return c
  43605. }
  43606. // IfNoneMatch sets the optional parameter which makes the operation
  43607. // fail if the object's ETag matches the given value. This is useful for
  43608. // getting updates only after the object has changed since the last
  43609. // request. Use googleapi.IsNotModified to check whether the response
  43610. // error from Do is the result of In-None-Match.
  43611. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  43612. c.ifNoneMatch_ = entityTag
  43613. return c
  43614. }
  43615. // Context sets the context to be used in this call's Do method. Any
  43616. // pending HTTP request will be aborted if the provided context is
  43617. // canceled.
  43618. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  43619. c.ctx_ = ctx
  43620. return c
  43621. }
  43622. // Header returns an http.Header that can be modified by the caller to
  43623. // add HTTP headers to the request.
  43624. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  43625. if c.header_ == nil {
  43626. c.header_ = make(http.Header)
  43627. }
  43628. return c.header_
  43629. }
  43630. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  43631. reqHeaders := make(http.Header)
  43632. for k, v := range c.header_ {
  43633. reqHeaders[k] = v
  43634. }
  43635. reqHeaders.Set("User-Agent", c.s.userAgent())
  43636. if c.ifNoneMatch_ != "" {
  43637. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43638. }
  43639. var body io.Reader = nil
  43640. c.urlParams_.Set("alt", alt)
  43641. c.urlParams_.Set("prettyPrint", "false")
  43642. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  43643. urls += "?" + c.urlParams_.Encode()
  43644. req, err := http.NewRequest("GET", urls, body)
  43645. if err != nil {
  43646. return nil, err
  43647. }
  43648. req.Header = reqHeaders
  43649. googleapi.Expand(req.URL, map[string]string{
  43650. "project": c.project,
  43651. })
  43652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43653. }
  43654. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  43655. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  43656. // non-nil. Any non-2xx status code is an error. Response headers are in
  43657. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  43658. // (if a response was returned at all) in
  43659. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  43660. // whether the returned error was because http.StatusNotModified was
  43661. // returned.
  43662. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  43663. gensupport.SetOptions(c.urlParams_, opts...)
  43664. res, err := c.doRequest("json")
  43665. if res != nil && res.StatusCode == http.StatusNotModified {
  43666. if res.Body != nil {
  43667. res.Body.Close()
  43668. }
  43669. return nil, &googleapi.Error{
  43670. Code: res.StatusCode,
  43671. Header: res.Header,
  43672. }
  43673. }
  43674. if err != nil {
  43675. return nil, err
  43676. }
  43677. defer googleapi.CloseBody(res)
  43678. if err := googleapi.CheckResponse(res); err != nil {
  43679. return nil, err
  43680. }
  43681. ret := &InstanceGroupManagerAggregatedList{
  43682. ServerResponse: googleapi.ServerResponse{
  43683. Header: res.Header,
  43684. HTTPStatusCode: res.StatusCode,
  43685. },
  43686. }
  43687. target := &ret
  43688. if err := gensupport.DecodeResponse(target, res); err != nil {
  43689. return nil, err
  43690. }
  43691. return ret, nil
  43692. // {
  43693. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  43694. // "httpMethod": "GET",
  43695. // "id": "compute.instanceGroupManagers.aggregatedList",
  43696. // "parameterOrder": [
  43697. // "project"
  43698. // ],
  43699. // "parameters": {
  43700. // "filter": {
  43701. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43702. // "location": "query",
  43703. // "type": "string"
  43704. // },
  43705. // "maxResults": {
  43706. // "default": "500",
  43707. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43708. // "format": "uint32",
  43709. // "location": "query",
  43710. // "minimum": "0",
  43711. // "type": "integer"
  43712. // },
  43713. // "orderBy": {
  43714. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43715. // "location": "query",
  43716. // "type": "string"
  43717. // },
  43718. // "pageToken": {
  43719. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43720. // "location": "query",
  43721. // "type": "string"
  43722. // },
  43723. // "project": {
  43724. // "description": "Project ID for this request.",
  43725. // "location": "path",
  43726. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43727. // "required": true,
  43728. // "type": "string"
  43729. // }
  43730. // },
  43731. // "path": "{project}/aggregated/instanceGroupManagers",
  43732. // "response": {
  43733. // "$ref": "InstanceGroupManagerAggregatedList"
  43734. // },
  43735. // "scopes": [
  43736. // "https://www.googleapis.com/auth/cloud-platform",
  43737. // "https://www.googleapis.com/auth/compute",
  43738. // "https://www.googleapis.com/auth/compute.readonly"
  43739. // ]
  43740. // }
  43741. }
  43742. // Pages invokes f for each page of results.
  43743. // A non-nil error returned from f will halt the iteration.
  43744. // The provided context supersedes any context provided to the Context method.
  43745. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  43746. c.ctx_ = ctx
  43747. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43748. for {
  43749. x, err := c.Do()
  43750. if err != nil {
  43751. return err
  43752. }
  43753. if err := f(x); err != nil {
  43754. return err
  43755. }
  43756. if x.NextPageToken == "" {
  43757. return nil
  43758. }
  43759. c.PageToken(x.NextPageToken)
  43760. }
  43761. }
  43762. // method id "compute.instanceGroupManagers.delete":
  43763. type InstanceGroupManagersDeleteCall struct {
  43764. s *Service
  43765. project string
  43766. zone string
  43767. instanceGroupManager string
  43768. urlParams_ gensupport.URLParams
  43769. ctx_ context.Context
  43770. header_ http.Header
  43771. }
  43772. // Delete: Deletes the specified managed instance group and all of the
  43773. // instances in that group. Note that the instance group must not belong
  43774. // to a backend service. Read Deleting an instance group for more
  43775. // information.
  43776. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  43777. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43778. c.project = project
  43779. c.zone = zone
  43780. c.instanceGroupManager = instanceGroupManager
  43781. return c
  43782. }
  43783. // RequestId sets the optional parameter "requestId": An optional
  43784. // request ID to identify requests. Specify a unique request ID so that
  43785. // if you must retry your request, the server will know to ignore the
  43786. // request if it has already been completed.
  43787. //
  43788. // For example, consider a situation where you make an initial request
  43789. // and the request times out. If you make the request again with the
  43790. // same request ID, the server can check if original operation with the
  43791. // same request ID was received, and if so, will ignore the second
  43792. // request. This prevents clients from accidentally creating duplicate
  43793. // commitments.
  43794. //
  43795. // The request ID must be a valid UUID with the exception that zero UUID
  43796. // is not supported (00000000-0000-0000-0000-000000000000).
  43797. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  43798. c.urlParams_.Set("requestId", requestId)
  43799. return c
  43800. }
  43801. // Fields allows partial responses to be retrieved. See
  43802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43803. // for more information.
  43804. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  43805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43806. return c
  43807. }
  43808. // Context sets the context to be used in this call's Do method. Any
  43809. // pending HTTP request will be aborted if the provided context is
  43810. // canceled.
  43811. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  43812. c.ctx_ = ctx
  43813. return c
  43814. }
  43815. // Header returns an http.Header that can be modified by the caller to
  43816. // add HTTP headers to the request.
  43817. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  43818. if c.header_ == nil {
  43819. c.header_ = make(http.Header)
  43820. }
  43821. return c.header_
  43822. }
  43823. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  43824. reqHeaders := make(http.Header)
  43825. for k, v := range c.header_ {
  43826. reqHeaders[k] = v
  43827. }
  43828. reqHeaders.Set("User-Agent", c.s.userAgent())
  43829. var body io.Reader = nil
  43830. c.urlParams_.Set("alt", alt)
  43831. c.urlParams_.Set("prettyPrint", "false")
  43832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  43833. urls += "?" + c.urlParams_.Encode()
  43834. req, err := http.NewRequest("DELETE", urls, body)
  43835. if err != nil {
  43836. return nil, err
  43837. }
  43838. req.Header = reqHeaders
  43839. googleapi.Expand(req.URL, map[string]string{
  43840. "project": c.project,
  43841. "zone": c.zone,
  43842. "instanceGroupManager": c.instanceGroupManager,
  43843. })
  43844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43845. }
  43846. // Do executes the "compute.instanceGroupManagers.delete" call.
  43847. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43848. // status code is an error. Response headers are in either
  43849. // *Operation.ServerResponse.Header or (if a response was returned at
  43850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43851. // to check whether the returned error was because
  43852. // http.StatusNotModified was returned.
  43853. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43854. gensupport.SetOptions(c.urlParams_, opts...)
  43855. res, err := c.doRequest("json")
  43856. if res != nil && res.StatusCode == http.StatusNotModified {
  43857. if res.Body != nil {
  43858. res.Body.Close()
  43859. }
  43860. return nil, &googleapi.Error{
  43861. Code: res.StatusCode,
  43862. Header: res.Header,
  43863. }
  43864. }
  43865. if err != nil {
  43866. return nil, err
  43867. }
  43868. defer googleapi.CloseBody(res)
  43869. if err := googleapi.CheckResponse(res); err != nil {
  43870. return nil, err
  43871. }
  43872. ret := &Operation{
  43873. ServerResponse: googleapi.ServerResponse{
  43874. Header: res.Header,
  43875. HTTPStatusCode: res.StatusCode,
  43876. },
  43877. }
  43878. target := &ret
  43879. if err := gensupport.DecodeResponse(target, res); err != nil {
  43880. return nil, err
  43881. }
  43882. return ret, nil
  43883. // {
  43884. // "description": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  43885. // "httpMethod": "DELETE",
  43886. // "id": "compute.instanceGroupManagers.delete",
  43887. // "parameterOrder": [
  43888. // "project",
  43889. // "zone",
  43890. // "instanceGroupManager"
  43891. // ],
  43892. // "parameters": {
  43893. // "instanceGroupManager": {
  43894. // "description": "The name of the managed instance group to delete.",
  43895. // "location": "path",
  43896. // "required": true,
  43897. // "type": "string"
  43898. // },
  43899. // "project": {
  43900. // "description": "Project ID for this request.",
  43901. // "location": "path",
  43902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43903. // "required": true,
  43904. // "type": "string"
  43905. // },
  43906. // "requestId": {
  43907. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43908. // "location": "query",
  43909. // "type": "string"
  43910. // },
  43911. // "zone": {
  43912. // "description": "The name of the zone where the managed instance group is located.",
  43913. // "location": "path",
  43914. // "required": true,
  43915. // "type": "string"
  43916. // }
  43917. // },
  43918. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  43919. // "response": {
  43920. // "$ref": "Operation"
  43921. // },
  43922. // "scopes": [
  43923. // "https://www.googleapis.com/auth/cloud-platform",
  43924. // "https://www.googleapis.com/auth/compute"
  43925. // ]
  43926. // }
  43927. }
  43928. // method id "compute.instanceGroupManagers.deleteInstances":
  43929. type InstanceGroupManagersDeleteInstancesCall struct {
  43930. s *Service
  43931. project string
  43932. zone string
  43933. instanceGroupManager string
  43934. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  43935. urlParams_ gensupport.URLParams
  43936. ctx_ context.Context
  43937. header_ http.Header
  43938. }
  43939. // DeleteInstances: Flags the specified instances in the managed
  43940. // instance group for immediate deletion. The instances are also removed
  43941. // from any target pools of which they were a member. This method
  43942. // reduces the targetSize of the managed instance group by the number of
  43943. // instances that you delete. This operation is marked as DONE when the
  43944. // action is scheduled even if the instances are still being deleted.
  43945. // You must separately verify the status of the deleting action with the
  43946. // listmanagedinstances method.
  43947. //
  43948. // If the group is part of a backend service that has enabled connection
  43949. // draining, it can take up to 60 seconds after the connection draining
  43950. // duration has elapsed before the VM instance is removed or
  43951. // deleted.
  43952. //
  43953. // You can specify a maximum of 1000 instances with this method per
  43954. // request.
  43955. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  43956. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43957. c.project = project
  43958. c.zone = zone
  43959. c.instanceGroupManager = instanceGroupManager
  43960. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  43961. return c
  43962. }
  43963. // RequestId sets the optional parameter "requestId": An optional
  43964. // request ID to identify requests. Specify a unique request ID so that
  43965. // if you must retry your request, the server will know to ignore the
  43966. // request if it has already been completed.
  43967. //
  43968. // For example, consider a situation where you make an initial request
  43969. // and the request times out. If you make the request again with the
  43970. // same request ID, the server can check if original operation with the
  43971. // same request ID was received, and if so, will ignore the second
  43972. // request. This prevents clients from accidentally creating duplicate
  43973. // commitments.
  43974. //
  43975. // The request ID must be a valid UUID with the exception that zero UUID
  43976. // is not supported (00000000-0000-0000-0000-000000000000).
  43977. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  43978. c.urlParams_.Set("requestId", requestId)
  43979. return c
  43980. }
  43981. // Fields allows partial responses to be retrieved. See
  43982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43983. // for more information.
  43984. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  43985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43986. return c
  43987. }
  43988. // Context sets the context to be used in this call's Do method. Any
  43989. // pending HTTP request will be aborted if the provided context is
  43990. // canceled.
  43991. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  43992. c.ctx_ = ctx
  43993. return c
  43994. }
  43995. // Header returns an http.Header that can be modified by the caller to
  43996. // add HTTP headers to the request.
  43997. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  43998. if c.header_ == nil {
  43999. c.header_ = make(http.Header)
  44000. }
  44001. return c.header_
  44002. }
  44003. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  44004. reqHeaders := make(http.Header)
  44005. for k, v := range c.header_ {
  44006. reqHeaders[k] = v
  44007. }
  44008. reqHeaders.Set("User-Agent", c.s.userAgent())
  44009. var body io.Reader = nil
  44010. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  44011. if err != nil {
  44012. return nil, err
  44013. }
  44014. reqHeaders.Set("Content-Type", "application/json")
  44015. c.urlParams_.Set("alt", alt)
  44016. c.urlParams_.Set("prettyPrint", "false")
  44017. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  44018. urls += "?" + c.urlParams_.Encode()
  44019. req, err := http.NewRequest("POST", urls, body)
  44020. if err != nil {
  44021. return nil, err
  44022. }
  44023. req.Header = reqHeaders
  44024. googleapi.Expand(req.URL, map[string]string{
  44025. "project": c.project,
  44026. "zone": c.zone,
  44027. "instanceGroupManager": c.instanceGroupManager,
  44028. })
  44029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44030. }
  44031. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  44032. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44033. // status code is an error. Response headers are in either
  44034. // *Operation.ServerResponse.Header or (if a response was returned at
  44035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44036. // to check whether the returned error was because
  44037. // http.StatusNotModified was returned.
  44038. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44039. gensupport.SetOptions(c.urlParams_, opts...)
  44040. res, err := c.doRequest("json")
  44041. if res != nil && res.StatusCode == http.StatusNotModified {
  44042. if res.Body != nil {
  44043. res.Body.Close()
  44044. }
  44045. return nil, &googleapi.Error{
  44046. Code: res.StatusCode,
  44047. Header: res.Header,
  44048. }
  44049. }
  44050. if err != nil {
  44051. return nil, err
  44052. }
  44053. defer googleapi.CloseBody(res)
  44054. if err := googleapi.CheckResponse(res); err != nil {
  44055. return nil, err
  44056. }
  44057. ret := &Operation{
  44058. ServerResponse: googleapi.ServerResponse{
  44059. Header: res.Header,
  44060. HTTPStatusCode: res.StatusCode,
  44061. },
  44062. }
  44063. target := &ret
  44064. if err := gensupport.DecodeResponse(target, res); err != nil {
  44065. return nil, err
  44066. }
  44067. return ret, nil
  44068. // {
  44069. // "description": "Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  44070. // "httpMethod": "POST",
  44071. // "id": "compute.instanceGroupManagers.deleteInstances",
  44072. // "parameterOrder": [
  44073. // "project",
  44074. // "zone",
  44075. // "instanceGroupManager"
  44076. // ],
  44077. // "parameters": {
  44078. // "instanceGroupManager": {
  44079. // "description": "The name of the managed instance group.",
  44080. // "location": "path",
  44081. // "required": true,
  44082. // "type": "string"
  44083. // },
  44084. // "project": {
  44085. // "description": "Project ID for this request.",
  44086. // "location": "path",
  44087. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44088. // "required": true,
  44089. // "type": "string"
  44090. // },
  44091. // "requestId": {
  44092. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44093. // "location": "query",
  44094. // "type": "string"
  44095. // },
  44096. // "zone": {
  44097. // "description": "The name of the zone where the managed instance group is located.",
  44098. // "location": "path",
  44099. // "required": true,
  44100. // "type": "string"
  44101. // }
  44102. // },
  44103. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  44104. // "request": {
  44105. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  44106. // },
  44107. // "response": {
  44108. // "$ref": "Operation"
  44109. // },
  44110. // "scopes": [
  44111. // "https://www.googleapis.com/auth/cloud-platform",
  44112. // "https://www.googleapis.com/auth/compute"
  44113. // ]
  44114. // }
  44115. }
  44116. // method id "compute.instanceGroupManagers.get":
  44117. type InstanceGroupManagersGetCall struct {
  44118. s *Service
  44119. project string
  44120. zone string
  44121. instanceGroupManager string
  44122. urlParams_ gensupport.URLParams
  44123. ifNoneMatch_ string
  44124. ctx_ context.Context
  44125. header_ http.Header
  44126. }
  44127. // Get: Returns all of the details about the specified managed instance
  44128. // group. Gets a list of available managed instance groups by making a
  44129. // list() request.
  44130. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  44131. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44132. c.project = project
  44133. c.zone = zone
  44134. c.instanceGroupManager = instanceGroupManager
  44135. return c
  44136. }
  44137. // Fields allows partial responses to be retrieved. See
  44138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44139. // for more information.
  44140. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  44141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44142. return c
  44143. }
  44144. // IfNoneMatch sets the optional parameter which makes the operation
  44145. // fail if the object's ETag matches the given value. This is useful for
  44146. // getting updates only after the object has changed since the last
  44147. // request. Use googleapi.IsNotModified to check whether the response
  44148. // error from Do is the result of In-None-Match.
  44149. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  44150. c.ifNoneMatch_ = entityTag
  44151. return c
  44152. }
  44153. // Context sets the context to be used in this call's Do method. Any
  44154. // pending HTTP request will be aborted if the provided context is
  44155. // canceled.
  44156. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  44157. c.ctx_ = ctx
  44158. return c
  44159. }
  44160. // Header returns an http.Header that can be modified by the caller to
  44161. // add HTTP headers to the request.
  44162. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  44163. if c.header_ == nil {
  44164. c.header_ = make(http.Header)
  44165. }
  44166. return c.header_
  44167. }
  44168. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  44169. reqHeaders := make(http.Header)
  44170. for k, v := range c.header_ {
  44171. reqHeaders[k] = v
  44172. }
  44173. reqHeaders.Set("User-Agent", c.s.userAgent())
  44174. if c.ifNoneMatch_ != "" {
  44175. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44176. }
  44177. var body io.Reader = nil
  44178. c.urlParams_.Set("alt", alt)
  44179. c.urlParams_.Set("prettyPrint", "false")
  44180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  44181. urls += "?" + c.urlParams_.Encode()
  44182. req, err := http.NewRequest("GET", urls, body)
  44183. if err != nil {
  44184. return nil, err
  44185. }
  44186. req.Header = reqHeaders
  44187. googleapi.Expand(req.URL, map[string]string{
  44188. "project": c.project,
  44189. "zone": c.zone,
  44190. "instanceGroupManager": c.instanceGroupManager,
  44191. })
  44192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44193. }
  44194. // Do executes the "compute.instanceGroupManagers.get" call.
  44195. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  44196. // non-2xx status code is an error. Response headers are in either
  44197. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  44198. // returned at all) in error.(*googleapi.Error).Header. Use
  44199. // googleapi.IsNotModified to check whether the returned error was
  44200. // because http.StatusNotModified was returned.
  44201. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  44202. gensupport.SetOptions(c.urlParams_, opts...)
  44203. res, err := c.doRequest("json")
  44204. if res != nil && res.StatusCode == http.StatusNotModified {
  44205. if res.Body != nil {
  44206. res.Body.Close()
  44207. }
  44208. return nil, &googleapi.Error{
  44209. Code: res.StatusCode,
  44210. Header: res.Header,
  44211. }
  44212. }
  44213. if err != nil {
  44214. return nil, err
  44215. }
  44216. defer googleapi.CloseBody(res)
  44217. if err := googleapi.CheckResponse(res); err != nil {
  44218. return nil, err
  44219. }
  44220. ret := &InstanceGroupManager{
  44221. ServerResponse: googleapi.ServerResponse{
  44222. Header: res.Header,
  44223. HTTPStatusCode: res.StatusCode,
  44224. },
  44225. }
  44226. target := &ret
  44227. if err := gensupport.DecodeResponse(target, res); err != nil {
  44228. return nil, err
  44229. }
  44230. return ret, nil
  44231. // {
  44232. // "description": "Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.",
  44233. // "httpMethod": "GET",
  44234. // "id": "compute.instanceGroupManagers.get",
  44235. // "parameterOrder": [
  44236. // "project",
  44237. // "zone",
  44238. // "instanceGroupManager"
  44239. // ],
  44240. // "parameters": {
  44241. // "instanceGroupManager": {
  44242. // "description": "The name of the managed instance group.",
  44243. // "location": "path",
  44244. // "required": true,
  44245. // "type": "string"
  44246. // },
  44247. // "project": {
  44248. // "description": "Project ID for this request.",
  44249. // "location": "path",
  44250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44251. // "required": true,
  44252. // "type": "string"
  44253. // },
  44254. // "zone": {
  44255. // "description": "The name of the zone where the managed instance group is located.",
  44256. // "location": "path",
  44257. // "required": true,
  44258. // "type": "string"
  44259. // }
  44260. // },
  44261. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  44262. // "response": {
  44263. // "$ref": "InstanceGroupManager"
  44264. // },
  44265. // "scopes": [
  44266. // "https://www.googleapis.com/auth/cloud-platform",
  44267. // "https://www.googleapis.com/auth/compute",
  44268. // "https://www.googleapis.com/auth/compute.readonly"
  44269. // ]
  44270. // }
  44271. }
  44272. // method id "compute.instanceGroupManagers.insert":
  44273. type InstanceGroupManagersInsertCall struct {
  44274. s *Service
  44275. project string
  44276. zone string
  44277. instancegroupmanager *InstanceGroupManager
  44278. urlParams_ gensupport.URLParams
  44279. ctx_ context.Context
  44280. header_ http.Header
  44281. }
  44282. // Insert: Creates a managed instance group using the information that
  44283. // you specify in the request. After the group is created, instances in
  44284. // the group are created using the specified instance template. This
  44285. // operation is marked as DONE when the group is created even if the
  44286. // instances in the group have not yet been created. You must separately
  44287. // verify the status of the individual instances with the
  44288. // listmanagedinstances method.
  44289. //
  44290. // A managed instance group can have up to 1000 VM instances per group.
  44291. // Please contact Cloud Support if you need an increase in this limit.
  44292. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  44293. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44294. c.project = project
  44295. c.zone = zone
  44296. c.instancegroupmanager = instancegroupmanager
  44297. return c
  44298. }
  44299. // RequestId sets the optional parameter "requestId": An optional
  44300. // request ID to identify requests. Specify a unique request ID so that
  44301. // if you must retry your request, the server will know to ignore the
  44302. // request if it has already been completed.
  44303. //
  44304. // For example, consider a situation where you make an initial request
  44305. // and the request times out. If you make the request again with the
  44306. // same request ID, the server can check if original operation with the
  44307. // same request ID was received, and if so, will ignore the second
  44308. // request. This prevents clients from accidentally creating duplicate
  44309. // commitments.
  44310. //
  44311. // The request ID must be a valid UUID with the exception that zero UUID
  44312. // is not supported (00000000-0000-0000-0000-000000000000).
  44313. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  44314. c.urlParams_.Set("requestId", requestId)
  44315. return c
  44316. }
  44317. // Fields allows partial responses to be retrieved. See
  44318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44319. // for more information.
  44320. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  44321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44322. return c
  44323. }
  44324. // Context sets the context to be used in this call's Do method. Any
  44325. // pending HTTP request will be aborted if the provided context is
  44326. // canceled.
  44327. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  44328. c.ctx_ = ctx
  44329. return c
  44330. }
  44331. // Header returns an http.Header that can be modified by the caller to
  44332. // add HTTP headers to the request.
  44333. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  44334. if c.header_ == nil {
  44335. c.header_ = make(http.Header)
  44336. }
  44337. return c.header_
  44338. }
  44339. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  44340. reqHeaders := make(http.Header)
  44341. for k, v := range c.header_ {
  44342. reqHeaders[k] = v
  44343. }
  44344. reqHeaders.Set("User-Agent", c.s.userAgent())
  44345. var body io.Reader = nil
  44346. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  44347. if err != nil {
  44348. return nil, err
  44349. }
  44350. reqHeaders.Set("Content-Type", "application/json")
  44351. c.urlParams_.Set("alt", alt)
  44352. c.urlParams_.Set("prettyPrint", "false")
  44353. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  44354. urls += "?" + c.urlParams_.Encode()
  44355. req, err := http.NewRequest("POST", urls, body)
  44356. if err != nil {
  44357. return nil, err
  44358. }
  44359. req.Header = reqHeaders
  44360. googleapi.Expand(req.URL, map[string]string{
  44361. "project": c.project,
  44362. "zone": c.zone,
  44363. })
  44364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44365. }
  44366. // Do executes the "compute.instanceGroupManagers.insert" call.
  44367. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44368. // status code is an error. Response headers are in either
  44369. // *Operation.ServerResponse.Header or (if a response was returned at
  44370. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44371. // to check whether the returned error was because
  44372. // http.StatusNotModified was returned.
  44373. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44374. gensupport.SetOptions(c.urlParams_, opts...)
  44375. res, err := c.doRequest("json")
  44376. if res != nil && res.StatusCode == http.StatusNotModified {
  44377. if res.Body != nil {
  44378. res.Body.Close()
  44379. }
  44380. return nil, &googleapi.Error{
  44381. Code: res.StatusCode,
  44382. Header: res.Header,
  44383. }
  44384. }
  44385. if err != nil {
  44386. return nil, err
  44387. }
  44388. defer googleapi.CloseBody(res)
  44389. if err := googleapi.CheckResponse(res); err != nil {
  44390. return nil, err
  44391. }
  44392. ret := &Operation{
  44393. ServerResponse: googleapi.ServerResponse{
  44394. Header: res.Header,
  44395. HTTPStatusCode: res.StatusCode,
  44396. },
  44397. }
  44398. target := &ret
  44399. if err := gensupport.DecodeResponse(target, res); err != nil {
  44400. return nil, err
  44401. }
  44402. return ret, nil
  44403. // {
  44404. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.",
  44405. // "httpMethod": "POST",
  44406. // "id": "compute.instanceGroupManagers.insert",
  44407. // "parameterOrder": [
  44408. // "project",
  44409. // "zone"
  44410. // ],
  44411. // "parameters": {
  44412. // "project": {
  44413. // "description": "Project ID for this request.",
  44414. // "location": "path",
  44415. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44416. // "required": true,
  44417. // "type": "string"
  44418. // },
  44419. // "requestId": {
  44420. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44421. // "location": "query",
  44422. // "type": "string"
  44423. // },
  44424. // "zone": {
  44425. // "description": "The name of the zone where you want to create the managed instance group.",
  44426. // "location": "path",
  44427. // "required": true,
  44428. // "type": "string"
  44429. // }
  44430. // },
  44431. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  44432. // "request": {
  44433. // "$ref": "InstanceGroupManager"
  44434. // },
  44435. // "response": {
  44436. // "$ref": "Operation"
  44437. // },
  44438. // "scopes": [
  44439. // "https://www.googleapis.com/auth/cloud-platform",
  44440. // "https://www.googleapis.com/auth/compute"
  44441. // ]
  44442. // }
  44443. }
  44444. // method id "compute.instanceGroupManagers.list":
  44445. type InstanceGroupManagersListCall struct {
  44446. s *Service
  44447. project string
  44448. zone string
  44449. urlParams_ gensupport.URLParams
  44450. ifNoneMatch_ string
  44451. ctx_ context.Context
  44452. header_ http.Header
  44453. }
  44454. // List: Retrieves a list of managed instance groups that are contained
  44455. // within the specified project and zone.
  44456. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  44457. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44458. c.project = project
  44459. c.zone = zone
  44460. return c
  44461. }
  44462. // Filter sets the optional parameter "filter": A filter expression that
  44463. // filters resources listed in the response. The expression must specify
  44464. // the field name, a comparison operator, and the value that you want to
  44465. // use for filtering. The value must be a string, a number, or a
  44466. // boolean. The comparison operator must be either =, !=, >, or <.
  44467. //
  44468. // For example, if you are filtering Compute Engine instances, you can
  44469. // exclude instances named example-instance by specifying name !=
  44470. // example-instance.
  44471. //
  44472. // You can also filter nested fields. For example, you could specify
  44473. // scheduling.automaticRestart = false to include instances only if they
  44474. // are not scheduled for automatic restarts. You can use filtering on
  44475. // nested fields to filter based on resource labels.
  44476. //
  44477. // To filter on multiple expressions, provide each separate expression
  44478. // within parentheses. For example, (scheduling.automaticRestart = true)
  44479. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44480. // AND expression. However, you can include AND and OR expressions
  44481. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44482. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44483. // true).
  44484. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  44485. c.urlParams_.Set("filter", filter)
  44486. return c
  44487. }
  44488. // MaxResults sets the optional parameter "maxResults": The maximum
  44489. // number of results per page that should be returned. If the number of
  44490. // available results is larger than maxResults, Compute Engine returns a
  44491. // nextPageToken that can be used to get the next page of results in
  44492. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44493. // (Default: 500)
  44494. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  44495. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44496. return c
  44497. }
  44498. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44499. // a certain order. By default, results are returned in alphanumerical
  44500. // order based on the resource name.
  44501. //
  44502. // You can also sort results in descending order based on the creation
  44503. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44504. // based on the creationTimestamp field in reverse chronological order
  44505. // (newest result first). Use this to sort resources like operations so
  44506. // that the newest operation is returned first.
  44507. //
  44508. // Currently, only sorting by name or creationTimestamp desc is
  44509. // supported.
  44510. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  44511. c.urlParams_.Set("orderBy", orderBy)
  44512. return c
  44513. }
  44514. // PageToken sets the optional parameter "pageToken": Specifies a page
  44515. // token to use. Set pageToken to the nextPageToken returned by a
  44516. // previous list request to get the next page of results.
  44517. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  44518. c.urlParams_.Set("pageToken", pageToken)
  44519. return c
  44520. }
  44521. // Fields allows partial responses to be retrieved. See
  44522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44523. // for more information.
  44524. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  44525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44526. return c
  44527. }
  44528. // IfNoneMatch sets the optional parameter which makes the operation
  44529. // fail if the object's ETag matches the given value. This is useful for
  44530. // getting updates only after the object has changed since the last
  44531. // request. Use googleapi.IsNotModified to check whether the response
  44532. // error from Do is the result of In-None-Match.
  44533. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  44534. c.ifNoneMatch_ = entityTag
  44535. return c
  44536. }
  44537. // Context sets the context to be used in this call's Do method. Any
  44538. // pending HTTP request will be aborted if the provided context is
  44539. // canceled.
  44540. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  44541. c.ctx_ = ctx
  44542. return c
  44543. }
  44544. // Header returns an http.Header that can be modified by the caller to
  44545. // add HTTP headers to the request.
  44546. func (c *InstanceGroupManagersListCall) Header() http.Header {
  44547. if c.header_ == nil {
  44548. c.header_ = make(http.Header)
  44549. }
  44550. return c.header_
  44551. }
  44552. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  44553. reqHeaders := make(http.Header)
  44554. for k, v := range c.header_ {
  44555. reqHeaders[k] = v
  44556. }
  44557. reqHeaders.Set("User-Agent", c.s.userAgent())
  44558. if c.ifNoneMatch_ != "" {
  44559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44560. }
  44561. var body io.Reader = nil
  44562. c.urlParams_.Set("alt", alt)
  44563. c.urlParams_.Set("prettyPrint", "false")
  44564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  44565. urls += "?" + c.urlParams_.Encode()
  44566. req, err := http.NewRequest("GET", urls, body)
  44567. if err != nil {
  44568. return nil, err
  44569. }
  44570. req.Header = reqHeaders
  44571. googleapi.Expand(req.URL, map[string]string{
  44572. "project": c.project,
  44573. "zone": c.zone,
  44574. })
  44575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44576. }
  44577. // Do executes the "compute.instanceGroupManagers.list" call.
  44578. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  44579. // Any non-2xx status code is an error. Response headers are in either
  44580. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  44581. // returned at all) in error.(*googleapi.Error).Header. Use
  44582. // googleapi.IsNotModified to check whether the returned error was
  44583. // because http.StatusNotModified was returned.
  44584. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  44585. gensupport.SetOptions(c.urlParams_, opts...)
  44586. res, err := c.doRequest("json")
  44587. if res != nil && res.StatusCode == http.StatusNotModified {
  44588. if res.Body != nil {
  44589. res.Body.Close()
  44590. }
  44591. return nil, &googleapi.Error{
  44592. Code: res.StatusCode,
  44593. Header: res.Header,
  44594. }
  44595. }
  44596. if err != nil {
  44597. return nil, err
  44598. }
  44599. defer googleapi.CloseBody(res)
  44600. if err := googleapi.CheckResponse(res); err != nil {
  44601. return nil, err
  44602. }
  44603. ret := &InstanceGroupManagerList{
  44604. ServerResponse: googleapi.ServerResponse{
  44605. Header: res.Header,
  44606. HTTPStatusCode: res.StatusCode,
  44607. },
  44608. }
  44609. target := &ret
  44610. if err := gensupport.DecodeResponse(target, res); err != nil {
  44611. return nil, err
  44612. }
  44613. return ret, nil
  44614. // {
  44615. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  44616. // "httpMethod": "GET",
  44617. // "id": "compute.instanceGroupManagers.list",
  44618. // "parameterOrder": [
  44619. // "project",
  44620. // "zone"
  44621. // ],
  44622. // "parameters": {
  44623. // "filter": {
  44624. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44625. // "location": "query",
  44626. // "type": "string"
  44627. // },
  44628. // "maxResults": {
  44629. // "default": "500",
  44630. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44631. // "format": "uint32",
  44632. // "location": "query",
  44633. // "minimum": "0",
  44634. // "type": "integer"
  44635. // },
  44636. // "orderBy": {
  44637. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  44638. // "location": "query",
  44639. // "type": "string"
  44640. // },
  44641. // "pageToken": {
  44642. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  44643. // "location": "query",
  44644. // "type": "string"
  44645. // },
  44646. // "project": {
  44647. // "description": "Project ID for this request.",
  44648. // "location": "path",
  44649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44650. // "required": true,
  44651. // "type": "string"
  44652. // },
  44653. // "zone": {
  44654. // "description": "The name of the zone where the managed instance group is located.",
  44655. // "location": "path",
  44656. // "required": true,
  44657. // "type": "string"
  44658. // }
  44659. // },
  44660. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  44661. // "response": {
  44662. // "$ref": "InstanceGroupManagerList"
  44663. // },
  44664. // "scopes": [
  44665. // "https://www.googleapis.com/auth/cloud-platform",
  44666. // "https://www.googleapis.com/auth/compute",
  44667. // "https://www.googleapis.com/auth/compute.readonly"
  44668. // ]
  44669. // }
  44670. }
  44671. // Pages invokes f for each page of results.
  44672. // A non-nil error returned from f will halt the iteration.
  44673. // The provided context supersedes any context provided to the Context method.
  44674. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  44675. c.ctx_ = ctx
  44676. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44677. for {
  44678. x, err := c.Do()
  44679. if err != nil {
  44680. return err
  44681. }
  44682. if err := f(x); err != nil {
  44683. return err
  44684. }
  44685. if x.NextPageToken == "" {
  44686. return nil
  44687. }
  44688. c.PageToken(x.NextPageToken)
  44689. }
  44690. }
  44691. // method id "compute.instanceGroupManagers.listManagedInstances":
  44692. type InstanceGroupManagersListManagedInstancesCall struct {
  44693. s *Service
  44694. project string
  44695. zone string
  44696. instanceGroupManager string
  44697. urlParams_ gensupport.URLParams
  44698. ctx_ context.Context
  44699. header_ http.Header
  44700. }
  44701. // ListManagedInstances: Lists all of the instances in the managed
  44702. // instance group. Each instance in the list has a currentAction, which
  44703. // indicates the action that the managed instance group is performing on
  44704. // the instance. For example, if the group is still creating an
  44705. // instance, the currentAction is CREATING. If a previous action failed,
  44706. // the list displays the errors for that failed action.
  44707. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  44708. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44709. c.project = project
  44710. c.zone = zone
  44711. c.instanceGroupManager = instanceGroupManager
  44712. return c
  44713. }
  44714. // Filter sets the optional parameter "filter": A filter expression that
  44715. // filters resources listed in the response. The expression must specify
  44716. // the field name, a comparison operator, and the value that you want to
  44717. // use for filtering. The value must be a string, a number, or a
  44718. // boolean. The comparison operator must be either =, !=, >, or <.
  44719. //
  44720. // For example, if you are filtering Compute Engine instances, you can
  44721. // exclude instances named example-instance by specifying name !=
  44722. // example-instance.
  44723. //
  44724. // You can also filter nested fields. For example, you could specify
  44725. // scheduling.automaticRestart = false to include instances only if they
  44726. // are not scheduled for automatic restarts. You can use filtering on
  44727. // nested fields to filter based on resource labels.
  44728. //
  44729. // To filter on multiple expressions, provide each separate expression
  44730. // within parentheses. For example, (scheduling.automaticRestart = true)
  44731. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44732. // AND expression. However, you can include AND and OR expressions
  44733. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44734. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44735. // true).
  44736. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  44737. c.urlParams_.Set("filter", filter)
  44738. return c
  44739. }
  44740. // MaxResults sets the optional parameter "maxResults": The maximum
  44741. // number of results per page that should be returned. If the number of
  44742. // available results is larger than maxResults, Compute Engine returns a
  44743. // nextPageToken that can be used to get the next page of results in
  44744. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44745. // (Default: 500)
  44746. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  44747. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44748. return c
  44749. }
  44750. // OrderBy sets the optional parameter "order_by": Sorts list results by
  44751. // a certain order. By default, results are returned in alphanumerical
  44752. // order based on the resource name.
  44753. //
  44754. // You can also sort results in descending order based on the creation
  44755. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44756. // based on the creationTimestamp field in reverse chronological order
  44757. // (newest result first). Use this to sort resources like operations so
  44758. // that the newest operation is returned first.
  44759. //
  44760. // Currently, only sorting by name or creationTimestamp desc is
  44761. // supported.
  44762. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  44763. c.urlParams_.Set("order_by", orderBy)
  44764. return c
  44765. }
  44766. // PageToken sets the optional parameter "pageToken": Specifies a page
  44767. // token to use. Set pageToken to the nextPageToken returned by a
  44768. // previous list request to get the next page of results.
  44769. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  44770. c.urlParams_.Set("pageToken", pageToken)
  44771. return c
  44772. }
  44773. // Fields allows partial responses to be retrieved. See
  44774. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44775. // for more information.
  44776. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  44777. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44778. return c
  44779. }
  44780. // Context sets the context to be used in this call's Do method. Any
  44781. // pending HTTP request will be aborted if the provided context is
  44782. // canceled.
  44783. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  44784. c.ctx_ = ctx
  44785. return c
  44786. }
  44787. // Header returns an http.Header that can be modified by the caller to
  44788. // add HTTP headers to the request.
  44789. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  44790. if c.header_ == nil {
  44791. c.header_ = make(http.Header)
  44792. }
  44793. return c.header_
  44794. }
  44795. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  44796. reqHeaders := make(http.Header)
  44797. for k, v := range c.header_ {
  44798. reqHeaders[k] = v
  44799. }
  44800. reqHeaders.Set("User-Agent", c.s.userAgent())
  44801. var body io.Reader = nil
  44802. c.urlParams_.Set("alt", alt)
  44803. c.urlParams_.Set("prettyPrint", "false")
  44804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  44805. urls += "?" + c.urlParams_.Encode()
  44806. req, err := http.NewRequest("POST", urls, body)
  44807. if err != nil {
  44808. return nil, err
  44809. }
  44810. req.Header = reqHeaders
  44811. googleapi.Expand(req.URL, map[string]string{
  44812. "project": c.project,
  44813. "zone": c.zone,
  44814. "instanceGroupManager": c.instanceGroupManager,
  44815. })
  44816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44817. }
  44818. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  44819. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  44820. // error will be non-nil. Any non-2xx status code is an error. Response
  44821. // headers are in either
  44822. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  44823. // er or (if a response was returned at all) in
  44824. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  44825. // whether the returned error was because http.StatusNotModified was
  44826. // returned.
  44827. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  44828. gensupport.SetOptions(c.urlParams_, opts...)
  44829. res, err := c.doRequest("json")
  44830. if res != nil && res.StatusCode == http.StatusNotModified {
  44831. if res.Body != nil {
  44832. res.Body.Close()
  44833. }
  44834. return nil, &googleapi.Error{
  44835. Code: res.StatusCode,
  44836. Header: res.Header,
  44837. }
  44838. }
  44839. if err != nil {
  44840. return nil, err
  44841. }
  44842. defer googleapi.CloseBody(res)
  44843. if err := googleapi.CheckResponse(res); err != nil {
  44844. return nil, err
  44845. }
  44846. ret := &InstanceGroupManagersListManagedInstancesResponse{
  44847. ServerResponse: googleapi.ServerResponse{
  44848. Header: res.Header,
  44849. HTTPStatusCode: res.StatusCode,
  44850. },
  44851. }
  44852. target := &ret
  44853. if err := gensupport.DecodeResponse(target, res); err != nil {
  44854. return nil, err
  44855. }
  44856. return ret, nil
  44857. // {
  44858. // "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.",
  44859. // "httpMethod": "POST",
  44860. // "id": "compute.instanceGroupManagers.listManagedInstances",
  44861. // "parameterOrder": [
  44862. // "project",
  44863. // "zone",
  44864. // "instanceGroupManager"
  44865. // ],
  44866. // "parameters": {
  44867. // "filter": {
  44868. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44869. // "location": "query",
  44870. // "type": "string"
  44871. // },
  44872. // "instanceGroupManager": {
  44873. // "description": "The name of the managed instance group.",
  44874. // "location": "path",
  44875. // "required": true,
  44876. // "type": "string"
  44877. // },
  44878. // "maxResults": {
  44879. // "default": "500",
  44880. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44881. // "format": "uint32",
  44882. // "location": "query",
  44883. // "minimum": "0",
  44884. // "type": "integer"
  44885. // },
  44886. // "order_by": {
  44887. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  44888. // "location": "query",
  44889. // "type": "string"
  44890. // },
  44891. // "pageToken": {
  44892. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  44893. // "location": "query",
  44894. // "type": "string"
  44895. // },
  44896. // "project": {
  44897. // "description": "Project ID for this request.",
  44898. // "location": "path",
  44899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44900. // "required": true,
  44901. // "type": "string"
  44902. // },
  44903. // "zone": {
  44904. // "description": "The name of the zone where the managed instance group is located.",
  44905. // "location": "path",
  44906. // "required": true,
  44907. // "type": "string"
  44908. // }
  44909. // },
  44910. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  44911. // "response": {
  44912. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  44913. // },
  44914. // "scopes": [
  44915. // "https://www.googleapis.com/auth/cloud-platform",
  44916. // "https://www.googleapis.com/auth/compute",
  44917. // "https://www.googleapis.com/auth/compute.readonly"
  44918. // ]
  44919. // }
  44920. }
  44921. // method id "compute.instanceGroupManagers.patch":
  44922. type InstanceGroupManagersPatchCall struct {
  44923. s *Service
  44924. project string
  44925. zone string
  44926. instanceGroupManager string
  44927. instancegroupmanager *InstanceGroupManager
  44928. urlParams_ gensupport.URLParams
  44929. ctx_ context.Context
  44930. header_ http.Header
  44931. }
  44932. // Patch: Updates a managed instance group using the information that
  44933. // you specify in the request. This operation is marked as DONE when the
  44934. // group is patched even if the instances in the group are still in the
  44935. // process of being patched. You must separately verify the status of
  44936. // the individual instances with the listManagedInstances method. This
  44937. // method supports PATCH semantics and uses the JSON merge patch format
  44938. // and processing rules.
  44939. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  44940. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44941. c.project = project
  44942. c.zone = zone
  44943. c.instanceGroupManager = instanceGroupManager
  44944. c.instancegroupmanager = instancegroupmanager
  44945. return c
  44946. }
  44947. // RequestId sets the optional parameter "requestId": An optional
  44948. // request ID to identify requests. Specify a unique request ID so that
  44949. // if you must retry your request, the server will know to ignore the
  44950. // request if it has already been completed.
  44951. //
  44952. // For example, consider a situation where you make an initial request
  44953. // and the request times out. If you make the request again with the
  44954. // same request ID, the server can check if original operation with the
  44955. // same request ID was received, and if so, will ignore the second
  44956. // request. This prevents clients from accidentally creating duplicate
  44957. // commitments.
  44958. //
  44959. // The request ID must be a valid UUID with the exception that zero UUID
  44960. // is not supported (00000000-0000-0000-0000-000000000000).
  44961. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  44962. c.urlParams_.Set("requestId", requestId)
  44963. return c
  44964. }
  44965. // Fields allows partial responses to be retrieved. See
  44966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44967. // for more information.
  44968. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  44969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44970. return c
  44971. }
  44972. // Context sets the context to be used in this call's Do method. Any
  44973. // pending HTTP request will be aborted if the provided context is
  44974. // canceled.
  44975. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  44976. c.ctx_ = ctx
  44977. return c
  44978. }
  44979. // Header returns an http.Header that can be modified by the caller to
  44980. // add HTTP headers to the request.
  44981. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  44982. if c.header_ == nil {
  44983. c.header_ = make(http.Header)
  44984. }
  44985. return c.header_
  44986. }
  44987. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  44988. reqHeaders := make(http.Header)
  44989. for k, v := range c.header_ {
  44990. reqHeaders[k] = v
  44991. }
  44992. reqHeaders.Set("User-Agent", c.s.userAgent())
  44993. var body io.Reader = nil
  44994. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  44995. if err != nil {
  44996. return nil, err
  44997. }
  44998. reqHeaders.Set("Content-Type", "application/json")
  44999. c.urlParams_.Set("alt", alt)
  45000. c.urlParams_.Set("prettyPrint", "false")
  45001. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  45002. urls += "?" + c.urlParams_.Encode()
  45003. req, err := http.NewRequest("PATCH", urls, body)
  45004. if err != nil {
  45005. return nil, err
  45006. }
  45007. req.Header = reqHeaders
  45008. googleapi.Expand(req.URL, map[string]string{
  45009. "project": c.project,
  45010. "zone": c.zone,
  45011. "instanceGroupManager": c.instanceGroupManager,
  45012. })
  45013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45014. }
  45015. // Do executes the "compute.instanceGroupManagers.patch" call.
  45016. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45017. // status code is an error. Response headers are in either
  45018. // *Operation.ServerResponse.Header or (if a response was returned at
  45019. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45020. // to check whether the returned error was because
  45021. // http.StatusNotModified was returned.
  45022. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45023. gensupport.SetOptions(c.urlParams_, opts...)
  45024. res, err := c.doRequest("json")
  45025. if res != nil && res.StatusCode == http.StatusNotModified {
  45026. if res.Body != nil {
  45027. res.Body.Close()
  45028. }
  45029. return nil, &googleapi.Error{
  45030. Code: res.StatusCode,
  45031. Header: res.Header,
  45032. }
  45033. }
  45034. if err != nil {
  45035. return nil, err
  45036. }
  45037. defer googleapi.CloseBody(res)
  45038. if err := googleapi.CheckResponse(res); err != nil {
  45039. return nil, err
  45040. }
  45041. ret := &Operation{
  45042. ServerResponse: googleapi.ServerResponse{
  45043. Header: res.Header,
  45044. HTTPStatusCode: res.StatusCode,
  45045. },
  45046. }
  45047. target := &ret
  45048. if err := gensupport.DecodeResponse(target, res); err != nil {
  45049. return nil, err
  45050. }
  45051. return ret, nil
  45052. // {
  45053. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  45054. // "httpMethod": "PATCH",
  45055. // "id": "compute.instanceGroupManagers.patch",
  45056. // "parameterOrder": [
  45057. // "project",
  45058. // "zone",
  45059. // "instanceGroupManager"
  45060. // ],
  45061. // "parameters": {
  45062. // "instanceGroupManager": {
  45063. // "description": "The name of the instance group manager.",
  45064. // "location": "path",
  45065. // "required": true,
  45066. // "type": "string"
  45067. // },
  45068. // "project": {
  45069. // "description": "Project ID for this request.",
  45070. // "location": "path",
  45071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45072. // "required": true,
  45073. // "type": "string"
  45074. // },
  45075. // "requestId": {
  45076. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45077. // "location": "query",
  45078. // "type": "string"
  45079. // },
  45080. // "zone": {
  45081. // "description": "The name of the zone where you want to create the managed instance group.",
  45082. // "location": "path",
  45083. // "required": true,
  45084. // "type": "string"
  45085. // }
  45086. // },
  45087. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  45088. // "request": {
  45089. // "$ref": "InstanceGroupManager"
  45090. // },
  45091. // "response": {
  45092. // "$ref": "Operation"
  45093. // },
  45094. // "scopes": [
  45095. // "https://www.googleapis.com/auth/cloud-platform",
  45096. // "https://www.googleapis.com/auth/compute"
  45097. // ]
  45098. // }
  45099. }
  45100. // method id "compute.instanceGroupManagers.recreateInstances":
  45101. type InstanceGroupManagersRecreateInstancesCall struct {
  45102. s *Service
  45103. project string
  45104. zone string
  45105. instanceGroupManager string
  45106. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  45107. urlParams_ gensupport.URLParams
  45108. ctx_ context.Context
  45109. header_ http.Header
  45110. }
  45111. // RecreateInstances: Flags the specified instances in the managed
  45112. // instance group to be immediately recreated. The instances are deleted
  45113. // and recreated using the current instance template for the managed
  45114. // instance group. This operation is marked as DONE when the flag is set
  45115. // even if the instances have not yet been recreated. You must
  45116. // separately verify the status of the recreating action with the
  45117. // listmanagedinstances method.
  45118. //
  45119. // If the group is part of a backend service that has enabled connection
  45120. // draining, it can take up to 60 seconds after the connection draining
  45121. // duration has elapsed before the VM instance is removed or
  45122. // deleted.
  45123. //
  45124. // You can specify a maximum of 1000 instances with this method per
  45125. // request.
  45126. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  45127. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45128. c.project = project
  45129. c.zone = zone
  45130. c.instanceGroupManager = instanceGroupManager
  45131. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  45132. return c
  45133. }
  45134. // RequestId sets the optional parameter "requestId": An optional
  45135. // request ID to identify requests. Specify a unique request ID so that
  45136. // if you must retry your request, the server will know to ignore the
  45137. // request if it has already been completed.
  45138. //
  45139. // For example, consider a situation where you make an initial request
  45140. // and the request times out. If you make the request again with the
  45141. // same request ID, the server can check if original operation with the
  45142. // same request ID was received, and if so, will ignore the second
  45143. // request. This prevents clients from accidentally creating duplicate
  45144. // commitments.
  45145. //
  45146. // The request ID must be a valid UUID with the exception that zero UUID
  45147. // is not supported (00000000-0000-0000-0000-000000000000).
  45148. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  45149. c.urlParams_.Set("requestId", requestId)
  45150. return c
  45151. }
  45152. // Fields allows partial responses to be retrieved. See
  45153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45154. // for more information.
  45155. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  45156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45157. return c
  45158. }
  45159. // Context sets the context to be used in this call's Do method. Any
  45160. // pending HTTP request will be aborted if the provided context is
  45161. // canceled.
  45162. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  45163. c.ctx_ = ctx
  45164. return c
  45165. }
  45166. // Header returns an http.Header that can be modified by the caller to
  45167. // add HTTP headers to the request.
  45168. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  45169. if c.header_ == nil {
  45170. c.header_ = make(http.Header)
  45171. }
  45172. return c.header_
  45173. }
  45174. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  45175. reqHeaders := make(http.Header)
  45176. for k, v := range c.header_ {
  45177. reqHeaders[k] = v
  45178. }
  45179. reqHeaders.Set("User-Agent", c.s.userAgent())
  45180. var body io.Reader = nil
  45181. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  45182. if err != nil {
  45183. return nil, err
  45184. }
  45185. reqHeaders.Set("Content-Type", "application/json")
  45186. c.urlParams_.Set("alt", alt)
  45187. c.urlParams_.Set("prettyPrint", "false")
  45188. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  45189. urls += "?" + c.urlParams_.Encode()
  45190. req, err := http.NewRequest("POST", urls, body)
  45191. if err != nil {
  45192. return nil, err
  45193. }
  45194. req.Header = reqHeaders
  45195. googleapi.Expand(req.URL, map[string]string{
  45196. "project": c.project,
  45197. "zone": c.zone,
  45198. "instanceGroupManager": c.instanceGroupManager,
  45199. })
  45200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45201. }
  45202. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  45203. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45204. // status code is an error. Response headers are in either
  45205. // *Operation.ServerResponse.Header or (if a response was returned at
  45206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45207. // to check whether the returned error was because
  45208. // http.StatusNotModified was returned.
  45209. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45210. gensupport.SetOptions(c.urlParams_, opts...)
  45211. res, err := c.doRequest("json")
  45212. if res != nil && res.StatusCode == http.StatusNotModified {
  45213. if res.Body != nil {
  45214. res.Body.Close()
  45215. }
  45216. return nil, &googleapi.Error{
  45217. Code: res.StatusCode,
  45218. Header: res.Header,
  45219. }
  45220. }
  45221. if err != nil {
  45222. return nil, err
  45223. }
  45224. defer googleapi.CloseBody(res)
  45225. if err := googleapi.CheckResponse(res); err != nil {
  45226. return nil, err
  45227. }
  45228. ret := &Operation{
  45229. ServerResponse: googleapi.ServerResponse{
  45230. Header: res.Header,
  45231. HTTPStatusCode: res.StatusCode,
  45232. },
  45233. }
  45234. target := &ret
  45235. if err := gensupport.DecodeResponse(target, res); err != nil {
  45236. return nil, err
  45237. }
  45238. return ret, nil
  45239. // {
  45240. // "description": "Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  45241. // "httpMethod": "POST",
  45242. // "id": "compute.instanceGroupManagers.recreateInstances",
  45243. // "parameterOrder": [
  45244. // "project",
  45245. // "zone",
  45246. // "instanceGroupManager"
  45247. // ],
  45248. // "parameters": {
  45249. // "instanceGroupManager": {
  45250. // "description": "The name of the managed instance group.",
  45251. // "location": "path",
  45252. // "required": true,
  45253. // "type": "string"
  45254. // },
  45255. // "project": {
  45256. // "description": "Project ID for this request.",
  45257. // "location": "path",
  45258. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45259. // "required": true,
  45260. // "type": "string"
  45261. // },
  45262. // "requestId": {
  45263. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45264. // "location": "query",
  45265. // "type": "string"
  45266. // },
  45267. // "zone": {
  45268. // "description": "The name of the zone where the managed instance group is located.",
  45269. // "location": "path",
  45270. // "required": true,
  45271. // "type": "string"
  45272. // }
  45273. // },
  45274. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  45275. // "request": {
  45276. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  45277. // },
  45278. // "response": {
  45279. // "$ref": "Operation"
  45280. // },
  45281. // "scopes": [
  45282. // "https://www.googleapis.com/auth/cloud-platform",
  45283. // "https://www.googleapis.com/auth/compute"
  45284. // ]
  45285. // }
  45286. }
  45287. // method id "compute.instanceGroupManagers.resize":
  45288. type InstanceGroupManagersResizeCall struct {
  45289. s *Service
  45290. project string
  45291. zone string
  45292. instanceGroupManager string
  45293. urlParams_ gensupport.URLParams
  45294. ctx_ context.Context
  45295. header_ http.Header
  45296. }
  45297. // Resize: Resizes the managed instance group. If you increase the size,
  45298. // the group creates new instances using the current instance template.
  45299. // If you decrease the size, the group deletes instances. The resize
  45300. // operation is marked DONE when the resize actions are scheduled even
  45301. // if the group has not yet added or deleted any instances. You must
  45302. // separately verify the status of the creating or deleting actions with
  45303. // the listmanagedinstances method.
  45304. //
  45305. // When resizing down, the instance group arbitrarily chooses the order
  45306. // in which VMs are deleted. The group takes into account some VM
  45307. // attributes when making the selection including:
  45308. //
  45309. // + The status of the VM instance. + The health of the VM instance. +
  45310. // The instance template version the VM is based on. + For regional
  45311. // managed instance groups, the location of the VM instance.
  45312. //
  45313. // This list is subject to change.
  45314. //
  45315. // If the group is part of a backend service that has enabled connection
  45316. // draining, it can take up to 60 seconds after the connection draining
  45317. // duration has elapsed before the VM instance is removed or deleted.
  45318. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  45319. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45320. c.project = project
  45321. c.zone = zone
  45322. c.instanceGroupManager = instanceGroupManager
  45323. c.urlParams_.Set("size", fmt.Sprint(size))
  45324. return c
  45325. }
  45326. // RequestId sets the optional parameter "requestId": An optional
  45327. // request ID to identify requests. Specify a unique request ID so that
  45328. // if you must retry your request, the server will know to ignore the
  45329. // request if it has already been completed.
  45330. //
  45331. // For example, consider a situation where you make an initial request
  45332. // and the request times out. If you make the request again with the
  45333. // same request ID, the server can check if original operation with the
  45334. // same request ID was received, and if so, will ignore the second
  45335. // request. This prevents clients from accidentally creating duplicate
  45336. // commitments.
  45337. //
  45338. // The request ID must be a valid UUID with the exception that zero UUID
  45339. // is not supported (00000000-0000-0000-0000-000000000000).
  45340. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  45341. c.urlParams_.Set("requestId", requestId)
  45342. return c
  45343. }
  45344. // Fields allows partial responses to be retrieved. See
  45345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45346. // for more information.
  45347. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  45348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45349. return c
  45350. }
  45351. // Context sets the context to be used in this call's Do method. Any
  45352. // pending HTTP request will be aborted if the provided context is
  45353. // canceled.
  45354. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  45355. c.ctx_ = ctx
  45356. return c
  45357. }
  45358. // Header returns an http.Header that can be modified by the caller to
  45359. // add HTTP headers to the request.
  45360. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  45361. if c.header_ == nil {
  45362. c.header_ = make(http.Header)
  45363. }
  45364. return c.header_
  45365. }
  45366. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  45367. reqHeaders := make(http.Header)
  45368. for k, v := range c.header_ {
  45369. reqHeaders[k] = v
  45370. }
  45371. reqHeaders.Set("User-Agent", c.s.userAgent())
  45372. var body io.Reader = nil
  45373. c.urlParams_.Set("alt", alt)
  45374. c.urlParams_.Set("prettyPrint", "false")
  45375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  45376. urls += "?" + c.urlParams_.Encode()
  45377. req, err := http.NewRequest("POST", urls, body)
  45378. if err != nil {
  45379. return nil, err
  45380. }
  45381. req.Header = reqHeaders
  45382. googleapi.Expand(req.URL, map[string]string{
  45383. "project": c.project,
  45384. "zone": c.zone,
  45385. "instanceGroupManager": c.instanceGroupManager,
  45386. })
  45387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45388. }
  45389. // Do executes the "compute.instanceGroupManagers.resize" call.
  45390. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45391. // status code is an error. Response headers are in either
  45392. // *Operation.ServerResponse.Header or (if a response was returned at
  45393. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45394. // to check whether the returned error was because
  45395. // http.StatusNotModified was returned.
  45396. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45397. gensupport.SetOptions(c.urlParams_, opts...)
  45398. res, err := c.doRequest("json")
  45399. if res != nil && res.StatusCode == http.StatusNotModified {
  45400. if res.Body != nil {
  45401. res.Body.Close()
  45402. }
  45403. return nil, &googleapi.Error{
  45404. Code: res.StatusCode,
  45405. Header: res.Header,
  45406. }
  45407. }
  45408. if err != nil {
  45409. return nil, err
  45410. }
  45411. defer googleapi.CloseBody(res)
  45412. if err := googleapi.CheckResponse(res); err != nil {
  45413. return nil, err
  45414. }
  45415. ret := &Operation{
  45416. ServerResponse: googleapi.ServerResponse{
  45417. Header: res.Header,
  45418. HTTPStatusCode: res.StatusCode,
  45419. },
  45420. }
  45421. target := &ret
  45422. if err := gensupport.DecodeResponse(target, res); err != nil {
  45423. return nil, err
  45424. }
  45425. return ret, nil
  45426. // {
  45427. // "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nWhen resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including:\n\n+ The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance.\n\nThis list is subject to change.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  45428. // "httpMethod": "POST",
  45429. // "id": "compute.instanceGroupManagers.resize",
  45430. // "parameterOrder": [
  45431. // "project",
  45432. // "zone",
  45433. // "instanceGroupManager",
  45434. // "size"
  45435. // ],
  45436. // "parameters": {
  45437. // "instanceGroupManager": {
  45438. // "description": "The name of the managed instance group.",
  45439. // "location": "path",
  45440. // "required": true,
  45441. // "type": "string"
  45442. // },
  45443. // "project": {
  45444. // "description": "Project ID for this request.",
  45445. // "location": "path",
  45446. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45447. // "required": true,
  45448. // "type": "string"
  45449. // },
  45450. // "requestId": {
  45451. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45452. // "location": "query",
  45453. // "type": "string"
  45454. // },
  45455. // "size": {
  45456. // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.",
  45457. // "format": "int32",
  45458. // "location": "query",
  45459. // "required": true,
  45460. // "type": "integer"
  45461. // },
  45462. // "zone": {
  45463. // "description": "The name of the zone where the managed instance group is located.",
  45464. // "location": "path",
  45465. // "required": true,
  45466. // "type": "string"
  45467. // }
  45468. // },
  45469. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  45470. // "response": {
  45471. // "$ref": "Operation"
  45472. // },
  45473. // "scopes": [
  45474. // "https://www.googleapis.com/auth/cloud-platform",
  45475. // "https://www.googleapis.com/auth/compute"
  45476. // ]
  45477. // }
  45478. }
  45479. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  45480. type InstanceGroupManagersSetInstanceTemplateCall struct {
  45481. s *Service
  45482. project string
  45483. zone string
  45484. instanceGroupManager string
  45485. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  45486. urlParams_ gensupport.URLParams
  45487. ctx_ context.Context
  45488. header_ http.Header
  45489. }
  45490. // SetInstanceTemplate: Specifies the instance template to use when
  45491. // creating new instances in this group. The templates for existing
  45492. // instances in the group do not change unless you recreate them.
  45493. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  45494. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45495. c.project = project
  45496. c.zone = zone
  45497. c.instanceGroupManager = instanceGroupManager
  45498. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  45499. return c
  45500. }
  45501. // RequestId sets the optional parameter "requestId": An optional
  45502. // request ID to identify requests. Specify a unique request ID so that
  45503. // if you must retry your request, the server will know to ignore the
  45504. // request if it has already been completed.
  45505. //
  45506. // For example, consider a situation where you make an initial request
  45507. // and the request times out. If you make the request again with the
  45508. // same request ID, the server can check if original operation with the
  45509. // same request ID was received, and if so, will ignore the second
  45510. // request. This prevents clients from accidentally creating duplicate
  45511. // commitments.
  45512. //
  45513. // The request ID must be a valid UUID with the exception that zero UUID
  45514. // is not supported (00000000-0000-0000-0000-000000000000).
  45515. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  45516. c.urlParams_.Set("requestId", requestId)
  45517. return c
  45518. }
  45519. // Fields allows partial responses to be retrieved. See
  45520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45521. // for more information.
  45522. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  45523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45524. return c
  45525. }
  45526. // Context sets the context to be used in this call's Do method. Any
  45527. // pending HTTP request will be aborted if the provided context is
  45528. // canceled.
  45529. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  45530. c.ctx_ = ctx
  45531. return c
  45532. }
  45533. // Header returns an http.Header that can be modified by the caller to
  45534. // add HTTP headers to the request.
  45535. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  45536. if c.header_ == nil {
  45537. c.header_ = make(http.Header)
  45538. }
  45539. return c.header_
  45540. }
  45541. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  45542. reqHeaders := make(http.Header)
  45543. for k, v := range c.header_ {
  45544. reqHeaders[k] = v
  45545. }
  45546. reqHeaders.Set("User-Agent", c.s.userAgent())
  45547. var body io.Reader = nil
  45548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  45549. if err != nil {
  45550. return nil, err
  45551. }
  45552. reqHeaders.Set("Content-Type", "application/json")
  45553. c.urlParams_.Set("alt", alt)
  45554. c.urlParams_.Set("prettyPrint", "false")
  45555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  45556. urls += "?" + c.urlParams_.Encode()
  45557. req, err := http.NewRequest("POST", urls, body)
  45558. if err != nil {
  45559. return nil, err
  45560. }
  45561. req.Header = reqHeaders
  45562. googleapi.Expand(req.URL, map[string]string{
  45563. "project": c.project,
  45564. "zone": c.zone,
  45565. "instanceGroupManager": c.instanceGroupManager,
  45566. })
  45567. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45568. }
  45569. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  45570. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45571. // status code is an error. Response headers are in either
  45572. // *Operation.ServerResponse.Header or (if a response was returned at
  45573. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45574. // to check whether the returned error was because
  45575. // http.StatusNotModified was returned.
  45576. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45577. gensupport.SetOptions(c.urlParams_, opts...)
  45578. res, err := c.doRequest("json")
  45579. if res != nil && res.StatusCode == http.StatusNotModified {
  45580. if res.Body != nil {
  45581. res.Body.Close()
  45582. }
  45583. return nil, &googleapi.Error{
  45584. Code: res.StatusCode,
  45585. Header: res.Header,
  45586. }
  45587. }
  45588. if err != nil {
  45589. return nil, err
  45590. }
  45591. defer googleapi.CloseBody(res)
  45592. if err := googleapi.CheckResponse(res); err != nil {
  45593. return nil, err
  45594. }
  45595. ret := &Operation{
  45596. ServerResponse: googleapi.ServerResponse{
  45597. Header: res.Header,
  45598. HTTPStatusCode: res.StatusCode,
  45599. },
  45600. }
  45601. target := &ret
  45602. if err := gensupport.DecodeResponse(target, res); err != nil {
  45603. return nil, err
  45604. }
  45605. return ret, nil
  45606. // {
  45607. // "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.",
  45608. // "httpMethod": "POST",
  45609. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  45610. // "parameterOrder": [
  45611. // "project",
  45612. // "zone",
  45613. // "instanceGroupManager"
  45614. // ],
  45615. // "parameters": {
  45616. // "instanceGroupManager": {
  45617. // "description": "The name of the managed instance group.",
  45618. // "location": "path",
  45619. // "required": true,
  45620. // "type": "string"
  45621. // },
  45622. // "project": {
  45623. // "description": "Project ID for this request.",
  45624. // "location": "path",
  45625. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45626. // "required": true,
  45627. // "type": "string"
  45628. // },
  45629. // "requestId": {
  45630. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45631. // "location": "query",
  45632. // "type": "string"
  45633. // },
  45634. // "zone": {
  45635. // "description": "The name of the zone where the managed instance group is located.",
  45636. // "location": "path",
  45637. // "required": true,
  45638. // "type": "string"
  45639. // }
  45640. // },
  45641. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  45642. // "request": {
  45643. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  45644. // },
  45645. // "response": {
  45646. // "$ref": "Operation"
  45647. // },
  45648. // "scopes": [
  45649. // "https://www.googleapis.com/auth/cloud-platform",
  45650. // "https://www.googleapis.com/auth/compute"
  45651. // ]
  45652. // }
  45653. }
  45654. // method id "compute.instanceGroupManagers.setTargetPools":
  45655. type InstanceGroupManagersSetTargetPoolsCall struct {
  45656. s *Service
  45657. project string
  45658. zone string
  45659. instanceGroupManager string
  45660. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  45661. urlParams_ gensupport.URLParams
  45662. ctx_ context.Context
  45663. header_ http.Header
  45664. }
  45665. // SetTargetPools: Modifies the target pools to which all instances in
  45666. // this managed instance group are assigned. The target pools
  45667. // automatically apply to all of the instances in the managed instance
  45668. // group. This operation is marked DONE when you make the request even
  45669. // if the instances have not yet been added to their target pools. The
  45670. // change might take some time to apply to all of the instances in the
  45671. // group depending on the size of the group.
  45672. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  45673. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45674. c.project = project
  45675. c.zone = zone
  45676. c.instanceGroupManager = instanceGroupManager
  45677. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  45678. return c
  45679. }
  45680. // RequestId sets the optional parameter "requestId": An optional
  45681. // request ID to identify requests. Specify a unique request ID so that
  45682. // if you must retry your request, the server will know to ignore the
  45683. // request if it has already been completed.
  45684. //
  45685. // For example, consider a situation where you make an initial request
  45686. // and the request times out. If you make the request again with the
  45687. // same request ID, the server can check if original operation with the
  45688. // same request ID was received, and if so, will ignore the second
  45689. // request. This prevents clients from accidentally creating duplicate
  45690. // commitments.
  45691. //
  45692. // The request ID must be a valid UUID with the exception that zero UUID
  45693. // is not supported (00000000-0000-0000-0000-000000000000).
  45694. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  45695. c.urlParams_.Set("requestId", requestId)
  45696. return c
  45697. }
  45698. // Fields allows partial responses to be retrieved. See
  45699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45700. // for more information.
  45701. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  45702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45703. return c
  45704. }
  45705. // Context sets the context to be used in this call's Do method. Any
  45706. // pending HTTP request will be aborted if the provided context is
  45707. // canceled.
  45708. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  45709. c.ctx_ = ctx
  45710. return c
  45711. }
  45712. // Header returns an http.Header that can be modified by the caller to
  45713. // add HTTP headers to the request.
  45714. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  45715. if c.header_ == nil {
  45716. c.header_ = make(http.Header)
  45717. }
  45718. return c.header_
  45719. }
  45720. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  45721. reqHeaders := make(http.Header)
  45722. for k, v := range c.header_ {
  45723. reqHeaders[k] = v
  45724. }
  45725. reqHeaders.Set("User-Agent", c.s.userAgent())
  45726. var body io.Reader = nil
  45727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  45728. if err != nil {
  45729. return nil, err
  45730. }
  45731. reqHeaders.Set("Content-Type", "application/json")
  45732. c.urlParams_.Set("alt", alt)
  45733. c.urlParams_.Set("prettyPrint", "false")
  45734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  45735. urls += "?" + c.urlParams_.Encode()
  45736. req, err := http.NewRequest("POST", urls, body)
  45737. if err != nil {
  45738. return nil, err
  45739. }
  45740. req.Header = reqHeaders
  45741. googleapi.Expand(req.URL, map[string]string{
  45742. "project": c.project,
  45743. "zone": c.zone,
  45744. "instanceGroupManager": c.instanceGroupManager,
  45745. })
  45746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45747. }
  45748. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  45749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45750. // status code is an error. Response headers are in either
  45751. // *Operation.ServerResponse.Header or (if a response was returned at
  45752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45753. // to check whether the returned error was because
  45754. // http.StatusNotModified was returned.
  45755. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45756. gensupport.SetOptions(c.urlParams_, opts...)
  45757. res, err := c.doRequest("json")
  45758. if res != nil && res.StatusCode == http.StatusNotModified {
  45759. if res.Body != nil {
  45760. res.Body.Close()
  45761. }
  45762. return nil, &googleapi.Error{
  45763. Code: res.StatusCode,
  45764. Header: res.Header,
  45765. }
  45766. }
  45767. if err != nil {
  45768. return nil, err
  45769. }
  45770. defer googleapi.CloseBody(res)
  45771. if err := googleapi.CheckResponse(res); err != nil {
  45772. return nil, err
  45773. }
  45774. ret := &Operation{
  45775. ServerResponse: googleapi.ServerResponse{
  45776. Header: res.Header,
  45777. HTTPStatusCode: res.StatusCode,
  45778. },
  45779. }
  45780. target := &ret
  45781. if err := gensupport.DecodeResponse(target, res); err != nil {
  45782. return nil, err
  45783. }
  45784. return ret, nil
  45785. // {
  45786. // "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.",
  45787. // "httpMethod": "POST",
  45788. // "id": "compute.instanceGroupManagers.setTargetPools",
  45789. // "parameterOrder": [
  45790. // "project",
  45791. // "zone",
  45792. // "instanceGroupManager"
  45793. // ],
  45794. // "parameters": {
  45795. // "instanceGroupManager": {
  45796. // "description": "The name of the managed instance group.",
  45797. // "location": "path",
  45798. // "required": true,
  45799. // "type": "string"
  45800. // },
  45801. // "project": {
  45802. // "description": "Project ID for this request.",
  45803. // "location": "path",
  45804. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45805. // "required": true,
  45806. // "type": "string"
  45807. // },
  45808. // "requestId": {
  45809. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45810. // "location": "query",
  45811. // "type": "string"
  45812. // },
  45813. // "zone": {
  45814. // "description": "The name of the zone where the managed instance group is located.",
  45815. // "location": "path",
  45816. // "required": true,
  45817. // "type": "string"
  45818. // }
  45819. // },
  45820. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  45821. // "request": {
  45822. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  45823. // },
  45824. // "response": {
  45825. // "$ref": "Operation"
  45826. // },
  45827. // "scopes": [
  45828. // "https://www.googleapis.com/auth/cloud-platform",
  45829. // "https://www.googleapis.com/auth/compute"
  45830. // ]
  45831. // }
  45832. }
  45833. // method id "compute.instanceGroups.addInstances":
  45834. type InstanceGroupsAddInstancesCall struct {
  45835. s *Service
  45836. project string
  45837. zone string
  45838. instanceGroup string
  45839. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  45840. urlParams_ gensupport.URLParams
  45841. ctx_ context.Context
  45842. header_ http.Header
  45843. }
  45844. // AddInstances: Adds a list of instances to the specified instance
  45845. // group. All of the instances in the instance group must be in the same
  45846. // network/subnetwork. Read Adding instances for more information.
  45847. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  45848. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45849. c.project = project
  45850. c.zone = zone
  45851. c.instanceGroup = instanceGroup
  45852. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  45853. return c
  45854. }
  45855. // RequestId sets the optional parameter "requestId": An optional
  45856. // request ID to identify requests. Specify a unique request ID so that
  45857. // if you must retry your request, the server will know to ignore the
  45858. // request if it has already been completed.
  45859. //
  45860. // For example, consider a situation where you make an initial request
  45861. // and the request times out. If you make the request again with the
  45862. // same request ID, the server can check if original operation with the
  45863. // same request ID was received, and if so, will ignore the second
  45864. // request. This prevents clients from accidentally creating duplicate
  45865. // commitments.
  45866. //
  45867. // The request ID must be a valid UUID with the exception that zero UUID
  45868. // is not supported (00000000-0000-0000-0000-000000000000).
  45869. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  45870. c.urlParams_.Set("requestId", requestId)
  45871. return c
  45872. }
  45873. // Fields allows partial responses to be retrieved. See
  45874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45875. // for more information.
  45876. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  45877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45878. return c
  45879. }
  45880. // Context sets the context to be used in this call's Do method. Any
  45881. // pending HTTP request will be aborted if the provided context is
  45882. // canceled.
  45883. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  45884. c.ctx_ = ctx
  45885. return c
  45886. }
  45887. // Header returns an http.Header that can be modified by the caller to
  45888. // add HTTP headers to the request.
  45889. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  45890. if c.header_ == nil {
  45891. c.header_ = make(http.Header)
  45892. }
  45893. return c.header_
  45894. }
  45895. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  45896. reqHeaders := make(http.Header)
  45897. for k, v := range c.header_ {
  45898. reqHeaders[k] = v
  45899. }
  45900. reqHeaders.Set("User-Agent", c.s.userAgent())
  45901. var body io.Reader = nil
  45902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  45903. if err != nil {
  45904. return nil, err
  45905. }
  45906. reqHeaders.Set("Content-Type", "application/json")
  45907. c.urlParams_.Set("alt", alt)
  45908. c.urlParams_.Set("prettyPrint", "false")
  45909. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  45910. urls += "?" + c.urlParams_.Encode()
  45911. req, err := http.NewRequest("POST", urls, body)
  45912. if err != nil {
  45913. return nil, err
  45914. }
  45915. req.Header = reqHeaders
  45916. googleapi.Expand(req.URL, map[string]string{
  45917. "project": c.project,
  45918. "zone": c.zone,
  45919. "instanceGroup": c.instanceGroup,
  45920. })
  45921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45922. }
  45923. // Do executes the "compute.instanceGroups.addInstances" call.
  45924. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45925. // status code is an error. Response headers are in either
  45926. // *Operation.ServerResponse.Header or (if a response was returned at
  45927. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45928. // to check whether the returned error was because
  45929. // http.StatusNotModified was returned.
  45930. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45931. gensupport.SetOptions(c.urlParams_, opts...)
  45932. res, err := c.doRequest("json")
  45933. if res != nil && res.StatusCode == http.StatusNotModified {
  45934. if res.Body != nil {
  45935. res.Body.Close()
  45936. }
  45937. return nil, &googleapi.Error{
  45938. Code: res.StatusCode,
  45939. Header: res.Header,
  45940. }
  45941. }
  45942. if err != nil {
  45943. return nil, err
  45944. }
  45945. defer googleapi.CloseBody(res)
  45946. if err := googleapi.CheckResponse(res); err != nil {
  45947. return nil, err
  45948. }
  45949. ret := &Operation{
  45950. ServerResponse: googleapi.ServerResponse{
  45951. Header: res.Header,
  45952. HTTPStatusCode: res.StatusCode,
  45953. },
  45954. }
  45955. target := &ret
  45956. if err := gensupport.DecodeResponse(target, res); err != nil {
  45957. return nil, err
  45958. }
  45959. return ret, nil
  45960. // {
  45961. // "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.",
  45962. // "httpMethod": "POST",
  45963. // "id": "compute.instanceGroups.addInstances",
  45964. // "parameterOrder": [
  45965. // "project",
  45966. // "zone",
  45967. // "instanceGroup"
  45968. // ],
  45969. // "parameters": {
  45970. // "instanceGroup": {
  45971. // "description": "The name of the instance group where you are adding instances.",
  45972. // "location": "path",
  45973. // "required": true,
  45974. // "type": "string"
  45975. // },
  45976. // "project": {
  45977. // "description": "Project ID for this request.",
  45978. // "location": "path",
  45979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45980. // "required": true,
  45981. // "type": "string"
  45982. // },
  45983. // "requestId": {
  45984. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45985. // "location": "query",
  45986. // "type": "string"
  45987. // },
  45988. // "zone": {
  45989. // "description": "The name of the zone where the instance group is located.",
  45990. // "location": "path",
  45991. // "required": true,
  45992. // "type": "string"
  45993. // }
  45994. // },
  45995. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  45996. // "request": {
  45997. // "$ref": "InstanceGroupsAddInstancesRequest"
  45998. // },
  45999. // "response": {
  46000. // "$ref": "Operation"
  46001. // },
  46002. // "scopes": [
  46003. // "https://www.googleapis.com/auth/cloud-platform",
  46004. // "https://www.googleapis.com/auth/compute"
  46005. // ]
  46006. // }
  46007. }
  46008. // method id "compute.instanceGroups.aggregatedList":
  46009. type InstanceGroupsAggregatedListCall struct {
  46010. s *Service
  46011. project string
  46012. urlParams_ gensupport.URLParams
  46013. ifNoneMatch_ string
  46014. ctx_ context.Context
  46015. header_ http.Header
  46016. }
  46017. // AggregatedList: Retrieves the list of instance groups and sorts them
  46018. // by zone.
  46019. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  46020. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46021. c.project = project
  46022. return c
  46023. }
  46024. // Filter sets the optional parameter "filter": A filter expression that
  46025. // filters resources listed in the response. The expression must specify
  46026. // the field name, a comparison operator, and the value that you want to
  46027. // use for filtering. The value must be a string, a number, or a
  46028. // boolean. The comparison operator must be either =, !=, >, or <.
  46029. //
  46030. // For example, if you are filtering Compute Engine instances, you can
  46031. // exclude instances named example-instance by specifying name !=
  46032. // example-instance.
  46033. //
  46034. // You can also filter nested fields. For example, you could specify
  46035. // scheduling.automaticRestart = false to include instances only if they
  46036. // are not scheduled for automatic restarts. You can use filtering on
  46037. // nested fields to filter based on resource labels.
  46038. //
  46039. // To filter on multiple expressions, provide each separate expression
  46040. // within parentheses. For example, (scheduling.automaticRestart = true)
  46041. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46042. // AND expression. However, you can include AND and OR expressions
  46043. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46044. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46045. // true).
  46046. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  46047. c.urlParams_.Set("filter", filter)
  46048. return c
  46049. }
  46050. // MaxResults sets the optional parameter "maxResults": The maximum
  46051. // number of results per page that should be returned. If the number of
  46052. // available results is larger than maxResults, Compute Engine returns a
  46053. // nextPageToken that can be used to get the next page of results in
  46054. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46055. // (Default: 500)
  46056. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  46057. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46058. return c
  46059. }
  46060. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46061. // a certain order. By default, results are returned in alphanumerical
  46062. // order based on the resource name.
  46063. //
  46064. // You can also sort results in descending order based on the creation
  46065. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46066. // based on the creationTimestamp field in reverse chronological order
  46067. // (newest result first). Use this to sort resources like operations so
  46068. // that the newest operation is returned first.
  46069. //
  46070. // Currently, only sorting by name or creationTimestamp desc is
  46071. // supported.
  46072. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  46073. c.urlParams_.Set("orderBy", orderBy)
  46074. return c
  46075. }
  46076. // PageToken sets the optional parameter "pageToken": Specifies a page
  46077. // token to use. Set pageToken to the nextPageToken returned by a
  46078. // previous list request to get the next page of results.
  46079. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  46080. c.urlParams_.Set("pageToken", pageToken)
  46081. return c
  46082. }
  46083. // Fields allows partial responses to be retrieved. See
  46084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46085. // for more information.
  46086. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  46087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46088. return c
  46089. }
  46090. // IfNoneMatch sets the optional parameter which makes the operation
  46091. // fail if the object's ETag matches the given value. This is useful for
  46092. // getting updates only after the object has changed since the last
  46093. // request. Use googleapi.IsNotModified to check whether the response
  46094. // error from Do is the result of In-None-Match.
  46095. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  46096. c.ifNoneMatch_ = entityTag
  46097. return c
  46098. }
  46099. // Context sets the context to be used in this call's Do method. Any
  46100. // pending HTTP request will be aborted if the provided context is
  46101. // canceled.
  46102. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  46103. c.ctx_ = ctx
  46104. return c
  46105. }
  46106. // Header returns an http.Header that can be modified by the caller to
  46107. // add HTTP headers to the request.
  46108. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  46109. if c.header_ == nil {
  46110. c.header_ = make(http.Header)
  46111. }
  46112. return c.header_
  46113. }
  46114. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46115. reqHeaders := make(http.Header)
  46116. for k, v := range c.header_ {
  46117. reqHeaders[k] = v
  46118. }
  46119. reqHeaders.Set("User-Agent", c.s.userAgent())
  46120. if c.ifNoneMatch_ != "" {
  46121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46122. }
  46123. var body io.Reader = nil
  46124. c.urlParams_.Set("alt", alt)
  46125. c.urlParams_.Set("prettyPrint", "false")
  46126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  46127. urls += "?" + c.urlParams_.Encode()
  46128. req, err := http.NewRequest("GET", urls, body)
  46129. if err != nil {
  46130. return nil, err
  46131. }
  46132. req.Header = reqHeaders
  46133. googleapi.Expand(req.URL, map[string]string{
  46134. "project": c.project,
  46135. })
  46136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46137. }
  46138. // Do executes the "compute.instanceGroups.aggregatedList" call.
  46139. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  46140. // Any non-2xx status code is an error. Response headers are in either
  46141. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  46142. // was returned at all) in error.(*googleapi.Error).Header. Use
  46143. // googleapi.IsNotModified to check whether the returned error was
  46144. // because http.StatusNotModified was returned.
  46145. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  46146. gensupport.SetOptions(c.urlParams_, opts...)
  46147. res, err := c.doRequest("json")
  46148. if res != nil && res.StatusCode == http.StatusNotModified {
  46149. if res.Body != nil {
  46150. res.Body.Close()
  46151. }
  46152. return nil, &googleapi.Error{
  46153. Code: res.StatusCode,
  46154. Header: res.Header,
  46155. }
  46156. }
  46157. if err != nil {
  46158. return nil, err
  46159. }
  46160. defer googleapi.CloseBody(res)
  46161. if err := googleapi.CheckResponse(res); err != nil {
  46162. return nil, err
  46163. }
  46164. ret := &InstanceGroupAggregatedList{
  46165. ServerResponse: googleapi.ServerResponse{
  46166. Header: res.Header,
  46167. HTTPStatusCode: res.StatusCode,
  46168. },
  46169. }
  46170. target := &ret
  46171. if err := gensupport.DecodeResponse(target, res); err != nil {
  46172. return nil, err
  46173. }
  46174. return ret, nil
  46175. // {
  46176. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  46177. // "httpMethod": "GET",
  46178. // "id": "compute.instanceGroups.aggregatedList",
  46179. // "parameterOrder": [
  46180. // "project"
  46181. // ],
  46182. // "parameters": {
  46183. // "filter": {
  46184. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46185. // "location": "query",
  46186. // "type": "string"
  46187. // },
  46188. // "maxResults": {
  46189. // "default": "500",
  46190. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46191. // "format": "uint32",
  46192. // "location": "query",
  46193. // "minimum": "0",
  46194. // "type": "integer"
  46195. // },
  46196. // "orderBy": {
  46197. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46198. // "location": "query",
  46199. // "type": "string"
  46200. // },
  46201. // "pageToken": {
  46202. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46203. // "location": "query",
  46204. // "type": "string"
  46205. // },
  46206. // "project": {
  46207. // "description": "Project ID for this request.",
  46208. // "location": "path",
  46209. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46210. // "required": true,
  46211. // "type": "string"
  46212. // }
  46213. // },
  46214. // "path": "{project}/aggregated/instanceGroups",
  46215. // "response": {
  46216. // "$ref": "InstanceGroupAggregatedList"
  46217. // },
  46218. // "scopes": [
  46219. // "https://www.googleapis.com/auth/cloud-platform",
  46220. // "https://www.googleapis.com/auth/compute",
  46221. // "https://www.googleapis.com/auth/compute.readonly"
  46222. // ]
  46223. // }
  46224. }
  46225. // Pages invokes f for each page of results.
  46226. // A non-nil error returned from f will halt the iteration.
  46227. // The provided context supersedes any context provided to the Context method.
  46228. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  46229. c.ctx_ = ctx
  46230. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46231. for {
  46232. x, err := c.Do()
  46233. if err != nil {
  46234. return err
  46235. }
  46236. if err := f(x); err != nil {
  46237. return err
  46238. }
  46239. if x.NextPageToken == "" {
  46240. return nil
  46241. }
  46242. c.PageToken(x.NextPageToken)
  46243. }
  46244. }
  46245. // method id "compute.instanceGroups.delete":
  46246. type InstanceGroupsDeleteCall struct {
  46247. s *Service
  46248. project string
  46249. zone string
  46250. instanceGroup string
  46251. urlParams_ gensupport.URLParams
  46252. ctx_ context.Context
  46253. header_ http.Header
  46254. }
  46255. // Delete: Deletes the specified instance group. The instances in the
  46256. // group are not deleted. Note that instance group must not belong to a
  46257. // backend service. Read Deleting an instance group for more
  46258. // information.
  46259. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  46260. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46261. c.project = project
  46262. c.zone = zone
  46263. c.instanceGroup = instanceGroup
  46264. return c
  46265. }
  46266. // RequestId sets the optional parameter "requestId": An optional
  46267. // request ID to identify requests. Specify a unique request ID so that
  46268. // if you must retry your request, the server will know to ignore the
  46269. // request if it has already been completed.
  46270. //
  46271. // For example, consider a situation where you make an initial request
  46272. // and the request times out. If you make the request again with the
  46273. // same request ID, the server can check if original operation with the
  46274. // same request ID was received, and if so, will ignore the second
  46275. // request. This prevents clients from accidentally creating duplicate
  46276. // commitments.
  46277. //
  46278. // The request ID must be a valid UUID with the exception that zero UUID
  46279. // is not supported (00000000-0000-0000-0000-000000000000).
  46280. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  46281. c.urlParams_.Set("requestId", requestId)
  46282. return c
  46283. }
  46284. // Fields allows partial responses to be retrieved. See
  46285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46286. // for more information.
  46287. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  46288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46289. return c
  46290. }
  46291. // Context sets the context to be used in this call's Do method. Any
  46292. // pending HTTP request will be aborted if the provided context is
  46293. // canceled.
  46294. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  46295. c.ctx_ = ctx
  46296. return c
  46297. }
  46298. // Header returns an http.Header that can be modified by the caller to
  46299. // add HTTP headers to the request.
  46300. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  46301. if c.header_ == nil {
  46302. c.header_ = make(http.Header)
  46303. }
  46304. return c.header_
  46305. }
  46306. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  46307. reqHeaders := make(http.Header)
  46308. for k, v := range c.header_ {
  46309. reqHeaders[k] = v
  46310. }
  46311. reqHeaders.Set("User-Agent", c.s.userAgent())
  46312. var body io.Reader = nil
  46313. c.urlParams_.Set("alt", alt)
  46314. c.urlParams_.Set("prettyPrint", "false")
  46315. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  46316. urls += "?" + c.urlParams_.Encode()
  46317. req, err := http.NewRequest("DELETE", urls, body)
  46318. if err != nil {
  46319. return nil, err
  46320. }
  46321. req.Header = reqHeaders
  46322. googleapi.Expand(req.URL, map[string]string{
  46323. "project": c.project,
  46324. "zone": c.zone,
  46325. "instanceGroup": c.instanceGroup,
  46326. })
  46327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46328. }
  46329. // Do executes the "compute.instanceGroups.delete" call.
  46330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46331. // status code is an error. Response headers are in either
  46332. // *Operation.ServerResponse.Header or (if a response was returned at
  46333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46334. // to check whether the returned error was because
  46335. // http.StatusNotModified was returned.
  46336. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46337. gensupport.SetOptions(c.urlParams_, opts...)
  46338. res, err := c.doRequest("json")
  46339. if res != nil && res.StatusCode == http.StatusNotModified {
  46340. if res.Body != nil {
  46341. res.Body.Close()
  46342. }
  46343. return nil, &googleapi.Error{
  46344. Code: res.StatusCode,
  46345. Header: res.Header,
  46346. }
  46347. }
  46348. if err != nil {
  46349. return nil, err
  46350. }
  46351. defer googleapi.CloseBody(res)
  46352. if err := googleapi.CheckResponse(res); err != nil {
  46353. return nil, err
  46354. }
  46355. ret := &Operation{
  46356. ServerResponse: googleapi.ServerResponse{
  46357. Header: res.Header,
  46358. HTTPStatusCode: res.StatusCode,
  46359. },
  46360. }
  46361. target := &ret
  46362. if err := gensupport.DecodeResponse(target, res); err != nil {
  46363. return nil, err
  46364. }
  46365. return ret, nil
  46366. // {
  46367. // "description": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  46368. // "httpMethod": "DELETE",
  46369. // "id": "compute.instanceGroups.delete",
  46370. // "parameterOrder": [
  46371. // "project",
  46372. // "zone",
  46373. // "instanceGroup"
  46374. // ],
  46375. // "parameters": {
  46376. // "instanceGroup": {
  46377. // "description": "The name of the instance group to delete.",
  46378. // "location": "path",
  46379. // "required": true,
  46380. // "type": "string"
  46381. // },
  46382. // "project": {
  46383. // "description": "Project ID for this request.",
  46384. // "location": "path",
  46385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46386. // "required": true,
  46387. // "type": "string"
  46388. // },
  46389. // "requestId": {
  46390. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46391. // "location": "query",
  46392. // "type": "string"
  46393. // },
  46394. // "zone": {
  46395. // "description": "The name of the zone where the instance group is located.",
  46396. // "location": "path",
  46397. // "required": true,
  46398. // "type": "string"
  46399. // }
  46400. // },
  46401. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  46402. // "response": {
  46403. // "$ref": "Operation"
  46404. // },
  46405. // "scopes": [
  46406. // "https://www.googleapis.com/auth/cloud-platform",
  46407. // "https://www.googleapis.com/auth/compute"
  46408. // ]
  46409. // }
  46410. }
  46411. // method id "compute.instanceGroups.get":
  46412. type InstanceGroupsGetCall struct {
  46413. s *Service
  46414. project string
  46415. zone string
  46416. instanceGroup string
  46417. urlParams_ gensupport.URLParams
  46418. ifNoneMatch_ string
  46419. ctx_ context.Context
  46420. header_ http.Header
  46421. }
  46422. // Get: Returns the specified instance group. Gets a list of available
  46423. // instance groups by making a list() request.
  46424. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  46425. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46426. c.project = project
  46427. c.zone = zone
  46428. c.instanceGroup = instanceGroup
  46429. return c
  46430. }
  46431. // Fields allows partial responses to be retrieved. See
  46432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46433. // for more information.
  46434. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  46435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46436. return c
  46437. }
  46438. // IfNoneMatch sets the optional parameter which makes the operation
  46439. // fail if the object's ETag matches the given value. This is useful for
  46440. // getting updates only after the object has changed since the last
  46441. // request. Use googleapi.IsNotModified to check whether the response
  46442. // error from Do is the result of In-None-Match.
  46443. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  46444. c.ifNoneMatch_ = entityTag
  46445. return c
  46446. }
  46447. // Context sets the context to be used in this call's Do method. Any
  46448. // pending HTTP request will be aborted if the provided context is
  46449. // canceled.
  46450. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  46451. c.ctx_ = ctx
  46452. return c
  46453. }
  46454. // Header returns an http.Header that can be modified by the caller to
  46455. // add HTTP headers to the request.
  46456. func (c *InstanceGroupsGetCall) Header() http.Header {
  46457. if c.header_ == nil {
  46458. c.header_ = make(http.Header)
  46459. }
  46460. return c.header_
  46461. }
  46462. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  46463. reqHeaders := make(http.Header)
  46464. for k, v := range c.header_ {
  46465. reqHeaders[k] = v
  46466. }
  46467. reqHeaders.Set("User-Agent", c.s.userAgent())
  46468. if c.ifNoneMatch_ != "" {
  46469. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46470. }
  46471. var body io.Reader = nil
  46472. c.urlParams_.Set("alt", alt)
  46473. c.urlParams_.Set("prettyPrint", "false")
  46474. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  46475. urls += "?" + c.urlParams_.Encode()
  46476. req, err := http.NewRequest("GET", urls, body)
  46477. if err != nil {
  46478. return nil, err
  46479. }
  46480. req.Header = reqHeaders
  46481. googleapi.Expand(req.URL, map[string]string{
  46482. "project": c.project,
  46483. "zone": c.zone,
  46484. "instanceGroup": c.instanceGroup,
  46485. })
  46486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46487. }
  46488. // Do executes the "compute.instanceGroups.get" call.
  46489. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  46490. // status code is an error. Response headers are in either
  46491. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  46492. // at all) in error.(*googleapi.Error).Header. Use
  46493. // googleapi.IsNotModified to check whether the returned error was
  46494. // because http.StatusNotModified was returned.
  46495. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  46496. gensupport.SetOptions(c.urlParams_, opts...)
  46497. res, err := c.doRequest("json")
  46498. if res != nil && res.StatusCode == http.StatusNotModified {
  46499. if res.Body != nil {
  46500. res.Body.Close()
  46501. }
  46502. return nil, &googleapi.Error{
  46503. Code: res.StatusCode,
  46504. Header: res.Header,
  46505. }
  46506. }
  46507. if err != nil {
  46508. return nil, err
  46509. }
  46510. defer googleapi.CloseBody(res)
  46511. if err := googleapi.CheckResponse(res); err != nil {
  46512. return nil, err
  46513. }
  46514. ret := &InstanceGroup{
  46515. ServerResponse: googleapi.ServerResponse{
  46516. Header: res.Header,
  46517. HTTPStatusCode: res.StatusCode,
  46518. },
  46519. }
  46520. target := &ret
  46521. if err := gensupport.DecodeResponse(target, res); err != nil {
  46522. return nil, err
  46523. }
  46524. return ret, nil
  46525. // {
  46526. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  46527. // "httpMethod": "GET",
  46528. // "id": "compute.instanceGroups.get",
  46529. // "parameterOrder": [
  46530. // "project",
  46531. // "zone",
  46532. // "instanceGroup"
  46533. // ],
  46534. // "parameters": {
  46535. // "instanceGroup": {
  46536. // "description": "The name of the instance group.",
  46537. // "location": "path",
  46538. // "required": true,
  46539. // "type": "string"
  46540. // },
  46541. // "project": {
  46542. // "description": "Project ID for this request.",
  46543. // "location": "path",
  46544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46545. // "required": true,
  46546. // "type": "string"
  46547. // },
  46548. // "zone": {
  46549. // "description": "The name of the zone where the instance group is located.",
  46550. // "location": "path",
  46551. // "required": true,
  46552. // "type": "string"
  46553. // }
  46554. // },
  46555. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  46556. // "response": {
  46557. // "$ref": "InstanceGroup"
  46558. // },
  46559. // "scopes": [
  46560. // "https://www.googleapis.com/auth/cloud-platform",
  46561. // "https://www.googleapis.com/auth/compute",
  46562. // "https://www.googleapis.com/auth/compute.readonly"
  46563. // ]
  46564. // }
  46565. }
  46566. // method id "compute.instanceGroups.insert":
  46567. type InstanceGroupsInsertCall struct {
  46568. s *Service
  46569. project string
  46570. zone string
  46571. instancegroup *InstanceGroup
  46572. urlParams_ gensupport.URLParams
  46573. ctx_ context.Context
  46574. header_ http.Header
  46575. }
  46576. // Insert: Creates an instance group in the specified project using the
  46577. // parameters that are included in the request.
  46578. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  46579. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46580. c.project = project
  46581. c.zone = zone
  46582. c.instancegroup = instancegroup
  46583. return c
  46584. }
  46585. // RequestId sets the optional parameter "requestId": An optional
  46586. // request ID to identify requests. Specify a unique request ID so that
  46587. // if you must retry your request, the server will know to ignore the
  46588. // request if it has already been completed.
  46589. //
  46590. // For example, consider a situation where you make an initial request
  46591. // and the request times out. If you make the request again with the
  46592. // same request ID, the server can check if original operation with the
  46593. // same request ID was received, and if so, will ignore the second
  46594. // request. This prevents clients from accidentally creating duplicate
  46595. // commitments.
  46596. //
  46597. // The request ID must be a valid UUID with the exception that zero UUID
  46598. // is not supported (00000000-0000-0000-0000-000000000000).
  46599. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  46600. c.urlParams_.Set("requestId", requestId)
  46601. return c
  46602. }
  46603. // Fields allows partial responses to be retrieved. See
  46604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46605. // for more information.
  46606. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  46607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46608. return c
  46609. }
  46610. // Context sets the context to be used in this call's Do method. Any
  46611. // pending HTTP request will be aborted if the provided context is
  46612. // canceled.
  46613. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  46614. c.ctx_ = ctx
  46615. return c
  46616. }
  46617. // Header returns an http.Header that can be modified by the caller to
  46618. // add HTTP headers to the request.
  46619. func (c *InstanceGroupsInsertCall) Header() http.Header {
  46620. if c.header_ == nil {
  46621. c.header_ = make(http.Header)
  46622. }
  46623. return c.header_
  46624. }
  46625. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  46626. reqHeaders := make(http.Header)
  46627. for k, v := range c.header_ {
  46628. reqHeaders[k] = v
  46629. }
  46630. reqHeaders.Set("User-Agent", c.s.userAgent())
  46631. var body io.Reader = nil
  46632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  46633. if err != nil {
  46634. return nil, err
  46635. }
  46636. reqHeaders.Set("Content-Type", "application/json")
  46637. c.urlParams_.Set("alt", alt)
  46638. c.urlParams_.Set("prettyPrint", "false")
  46639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  46640. urls += "?" + c.urlParams_.Encode()
  46641. req, err := http.NewRequest("POST", urls, body)
  46642. if err != nil {
  46643. return nil, err
  46644. }
  46645. req.Header = reqHeaders
  46646. googleapi.Expand(req.URL, map[string]string{
  46647. "project": c.project,
  46648. "zone": c.zone,
  46649. })
  46650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46651. }
  46652. // Do executes the "compute.instanceGroups.insert" call.
  46653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46654. // status code is an error. Response headers are in either
  46655. // *Operation.ServerResponse.Header or (if a response was returned at
  46656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46657. // to check whether the returned error was because
  46658. // http.StatusNotModified was returned.
  46659. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46660. gensupport.SetOptions(c.urlParams_, opts...)
  46661. res, err := c.doRequest("json")
  46662. if res != nil && res.StatusCode == http.StatusNotModified {
  46663. if res.Body != nil {
  46664. res.Body.Close()
  46665. }
  46666. return nil, &googleapi.Error{
  46667. Code: res.StatusCode,
  46668. Header: res.Header,
  46669. }
  46670. }
  46671. if err != nil {
  46672. return nil, err
  46673. }
  46674. defer googleapi.CloseBody(res)
  46675. if err := googleapi.CheckResponse(res); err != nil {
  46676. return nil, err
  46677. }
  46678. ret := &Operation{
  46679. ServerResponse: googleapi.ServerResponse{
  46680. Header: res.Header,
  46681. HTTPStatusCode: res.StatusCode,
  46682. },
  46683. }
  46684. target := &ret
  46685. if err := gensupport.DecodeResponse(target, res); err != nil {
  46686. return nil, err
  46687. }
  46688. return ret, nil
  46689. // {
  46690. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  46691. // "httpMethod": "POST",
  46692. // "id": "compute.instanceGroups.insert",
  46693. // "parameterOrder": [
  46694. // "project",
  46695. // "zone"
  46696. // ],
  46697. // "parameters": {
  46698. // "project": {
  46699. // "description": "Project ID for this request.",
  46700. // "location": "path",
  46701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46702. // "required": true,
  46703. // "type": "string"
  46704. // },
  46705. // "requestId": {
  46706. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46707. // "location": "query",
  46708. // "type": "string"
  46709. // },
  46710. // "zone": {
  46711. // "description": "The name of the zone where you want to create the instance group.",
  46712. // "location": "path",
  46713. // "required": true,
  46714. // "type": "string"
  46715. // }
  46716. // },
  46717. // "path": "{project}/zones/{zone}/instanceGroups",
  46718. // "request": {
  46719. // "$ref": "InstanceGroup"
  46720. // },
  46721. // "response": {
  46722. // "$ref": "Operation"
  46723. // },
  46724. // "scopes": [
  46725. // "https://www.googleapis.com/auth/cloud-platform",
  46726. // "https://www.googleapis.com/auth/compute"
  46727. // ]
  46728. // }
  46729. }
  46730. // method id "compute.instanceGroups.list":
  46731. type InstanceGroupsListCall struct {
  46732. s *Service
  46733. project string
  46734. zone string
  46735. urlParams_ gensupport.URLParams
  46736. ifNoneMatch_ string
  46737. ctx_ context.Context
  46738. header_ http.Header
  46739. }
  46740. // List: Retrieves the list of instance groups that are located in the
  46741. // specified project and zone.
  46742. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  46743. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46744. c.project = project
  46745. c.zone = zone
  46746. return c
  46747. }
  46748. // Filter sets the optional parameter "filter": A filter expression that
  46749. // filters resources listed in the response. The expression must specify
  46750. // the field name, a comparison operator, and the value that you want to
  46751. // use for filtering. The value must be a string, a number, or a
  46752. // boolean. The comparison operator must be either =, !=, >, or <.
  46753. //
  46754. // For example, if you are filtering Compute Engine instances, you can
  46755. // exclude instances named example-instance by specifying name !=
  46756. // example-instance.
  46757. //
  46758. // You can also filter nested fields. For example, you could specify
  46759. // scheduling.automaticRestart = false to include instances only if they
  46760. // are not scheduled for automatic restarts. You can use filtering on
  46761. // nested fields to filter based on resource labels.
  46762. //
  46763. // To filter on multiple expressions, provide each separate expression
  46764. // within parentheses. For example, (scheduling.automaticRestart = true)
  46765. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46766. // AND expression. However, you can include AND and OR expressions
  46767. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46768. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46769. // true).
  46770. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  46771. c.urlParams_.Set("filter", filter)
  46772. return c
  46773. }
  46774. // MaxResults sets the optional parameter "maxResults": The maximum
  46775. // number of results per page that should be returned. If the number of
  46776. // available results is larger than maxResults, Compute Engine returns a
  46777. // nextPageToken that can be used to get the next page of results in
  46778. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46779. // (Default: 500)
  46780. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  46781. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46782. return c
  46783. }
  46784. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46785. // a certain order. By default, results are returned in alphanumerical
  46786. // order based on the resource name.
  46787. //
  46788. // You can also sort results in descending order based on the creation
  46789. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46790. // based on the creationTimestamp field in reverse chronological order
  46791. // (newest result first). Use this to sort resources like operations so
  46792. // that the newest operation is returned first.
  46793. //
  46794. // Currently, only sorting by name or creationTimestamp desc is
  46795. // supported.
  46796. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  46797. c.urlParams_.Set("orderBy", orderBy)
  46798. return c
  46799. }
  46800. // PageToken sets the optional parameter "pageToken": Specifies a page
  46801. // token to use. Set pageToken to the nextPageToken returned by a
  46802. // previous list request to get the next page of results.
  46803. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  46804. c.urlParams_.Set("pageToken", pageToken)
  46805. return c
  46806. }
  46807. // Fields allows partial responses to be retrieved. See
  46808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46809. // for more information.
  46810. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  46811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46812. return c
  46813. }
  46814. // IfNoneMatch sets the optional parameter which makes the operation
  46815. // fail if the object's ETag matches the given value. This is useful for
  46816. // getting updates only after the object has changed since the last
  46817. // request. Use googleapi.IsNotModified to check whether the response
  46818. // error from Do is the result of In-None-Match.
  46819. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  46820. c.ifNoneMatch_ = entityTag
  46821. return c
  46822. }
  46823. // Context sets the context to be used in this call's Do method. Any
  46824. // pending HTTP request will be aborted if the provided context is
  46825. // canceled.
  46826. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  46827. c.ctx_ = ctx
  46828. return c
  46829. }
  46830. // Header returns an http.Header that can be modified by the caller to
  46831. // add HTTP headers to the request.
  46832. func (c *InstanceGroupsListCall) Header() http.Header {
  46833. if c.header_ == nil {
  46834. c.header_ = make(http.Header)
  46835. }
  46836. return c.header_
  46837. }
  46838. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  46839. reqHeaders := make(http.Header)
  46840. for k, v := range c.header_ {
  46841. reqHeaders[k] = v
  46842. }
  46843. reqHeaders.Set("User-Agent", c.s.userAgent())
  46844. if c.ifNoneMatch_ != "" {
  46845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46846. }
  46847. var body io.Reader = nil
  46848. c.urlParams_.Set("alt", alt)
  46849. c.urlParams_.Set("prettyPrint", "false")
  46850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  46851. urls += "?" + c.urlParams_.Encode()
  46852. req, err := http.NewRequest("GET", urls, body)
  46853. if err != nil {
  46854. return nil, err
  46855. }
  46856. req.Header = reqHeaders
  46857. googleapi.Expand(req.URL, map[string]string{
  46858. "project": c.project,
  46859. "zone": c.zone,
  46860. })
  46861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46862. }
  46863. // Do executes the "compute.instanceGroups.list" call.
  46864. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  46865. // non-2xx status code is an error. Response headers are in either
  46866. // *InstanceGroupList.ServerResponse.Header or (if a response was
  46867. // returned at all) in error.(*googleapi.Error).Header. Use
  46868. // googleapi.IsNotModified to check whether the returned error was
  46869. // because http.StatusNotModified was returned.
  46870. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  46871. gensupport.SetOptions(c.urlParams_, opts...)
  46872. res, err := c.doRequest("json")
  46873. if res != nil && res.StatusCode == http.StatusNotModified {
  46874. if res.Body != nil {
  46875. res.Body.Close()
  46876. }
  46877. return nil, &googleapi.Error{
  46878. Code: res.StatusCode,
  46879. Header: res.Header,
  46880. }
  46881. }
  46882. if err != nil {
  46883. return nil, err
  46884. }
  46885. defer googleapi.CloseBody(res)
  46886. if err := googleapi.CheckResponse(res); err != nil {
  46887. return nil, err
  46888. }
  46889. ret := &InstanceGroupList{
  46890. ServerResponse: googleapi.ServerResponse{
  46891. Header: res.Header,
  46892. HTTPStatusCode: res.StatusCode,
  46893. },
  46894. }
  46895. target := &ret
  46896. if err := gensupport.DecodeResponse(target, res); err != nil {
  46897. return nil, err
  46898. }
  46899. return ret, nil
  46900. // {
  46901. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  46902. // "httpMethod": "GET",
  46903. // "id": "compute.instanceGroups.list",
  46904. // "parameterOrder": [
  46905. // "project",
  46906. // "zone"
  46907. // ],
  46908. // "parameters": {
  46909. // "filter": {
  46910. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46911. // "location": "query",
  46912. // "type": "string"
  46913. // },
  46914. // "maxResults": {
  46915. // "default": "500",
  46916. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46917. // "format": "uint32",
  46918. // "location": "query",
  46919. // "minimum": "0",
  46920. // "type": "integer"
  46921. // },
  46922. // "orderBy": {
  46923. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46924. // "location": "query",
  46925. // "type": "string"
  46926. // },
  46927. // "pageToken": {
  46928. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46929. // "location": "query",
  46930. // "type": "string"
  46931. // },
  46932. // "project": {
  46933. // "description": "Project ID for this request.",
  46934. // "location": "path",
  46935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46936. // "required": true,
  46937. // "type": "string"
  46938. // },
  46939. // "zone": {
  46940. // "description": "The name of the zone where the instance group is located.",
  46941. // "location": "path",
  46942. // "required": true,
  46943. // "type": "string"
  46944. // }
  46945. // },
  46946. // "path": "{project}/zones/{zone}/instanceGroups",
  46947. // "response": {
  46948. // "$ref": "InstanceGroupList"
  46949. // },
  46950. // "scopes": [
  46951. // "https://www.googleapis.com/auth/cloud-platform",
  46952. // "https://www.googleapis.com/auth/compute",
  46953. // "https://www.googleapis.com/auth/compute.readonly"
  46954. // ]
  46955. // }
  46956. }
  46957. // Pages invokes f for each page of results.
  46958. // A non-nil error returned from f will halt the iteration.
  46959. // The provided context supersedes any context provided to the Context method.
  46960. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  46961. c.ctx_ = ctx
  46962. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46963. for {
  46964. x, err := c.Do()
  46965. if err != nil {
  46966. return err
  46967. }
  46968. if err := f(x); err != nil {
  46969. return err
  46970. }
  46971. if x.NextPageToken == "" {
  46972. return nil
  46973. }
  46974. c.PageToken(x.NextPageToken)
  46975. }
  46976. }
  46977. // method id "compute.instanceGroups.listInstances":
  46978. type InstanceGroupsListInstancesCall struct {
  46979. s *Service
  46980. project string
  46981. zone string
  46982. instanceGroup string
  46983. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  46984. urlParams_ gensupport.URLParams
  46985. ctx_ context.Context
  46986. header_ http.Header
  46987. }
  46988. // ListInstances: Lists the instances in the specified instance group.
  46989. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  46990. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46991. c.project = project
  46992. c.zone = zone
  46993. c.instanceGroup = instanceGroup
  46994. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  46995. return c
  46996. }
  46997. // Filter sets the optional parameter "filter": A filter expression that
  46998. // filters resources listed in the response. The expression must specify
  46999. // the field name, a comparison operator, and the value that you want to
  47000. // use for filtering. The value must be a string, a number, or a
  47001. // boolean. The comparison operator must be either =, !=, >, or <.
  47002. //
  47003. // For example, if you are filtering Compute Engine instances, you can
  47004. // exclude instances named example-instance by specifying name !=
  47005. // example-instance.
  47006. //
  47007. // You can also filter nested fields. For example, you could specify
  47008. // scheduling.automaticRestart = false to include instances only if they
  47009. // are not scheduled for automatic restarts. You can use filtering on
  47010. // nested fields to filter based on resource labels.
  47011. //
  47012. // To filter on multiple expressions, provide each separate expression
  47013. // within parentheses. For example, (scheduling.automaticRestart = true)
  47014. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47015. // AND expression. However, you can include AND and OR expressions
  47016. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47017. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47018. // true).
  47019. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  47020. c.urlParams_.Set("filter", filter)
  47021. return c
  47022. }
  47023. // MaxResults sets the optional parameter "maxResults": The maximum
  47024. // number of results per page that should be returned. If the number of
  47025. // available results is larger than maxResults, Compute Engine returns a
  47026. // nextPageToken that can be used to get the next page of results in
  47027. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47028. // (Default: 500)
  47029. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  47030. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47031. return c
  47032. }
  47033. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47034. // a certain order. By default, results are returned in alphanumerical
  47035. // order based on the resource name.
  47036. //
  47037. // You can also sort results in descending order based on the creation
  47038. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47039. // based on the creationTimestamp field in reverse chronological order
  47040. // (newest result first). Use this to sort resources like operations so
  47041. // that the newest operation is returned first.
  47042. //
  47043. // Currently, only sorting by name or creationTimestamp desc is
  47044. // supported.
  47045. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  47046. c.urlParams_.Set("orderBy", orderBy)
  47047. return c
  47048. }
  47049. // PageToken sets the optional parameter "pageToken": Specifies a page
  47050. // token to use. Set pageToken to the nextPageToken returned by a
  47051. // previous list request to get the next page of results.
  47052. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  47053. c.urlParams_.Set("pageToken", pageToken)
  47054. return c
  47055. }
  47056. // Fields allows partial responses to be retrieved. See
  47057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47058. // for more information.
  47059. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  47060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47061. return c
  47062. }
  47063. // Context sets the context to be used in this call's Do method. Any
  47064. // pending HTTP request will be aborted if the provided context is
  47065. // canceled.
  47066. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  47067. c.ctx_ = ctx
  47068. return c
  47069. }
  47070. // Header returns an http.Header that can be modified by the caller to
  47071. // add HTTP headers to the request.
  47072. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  47073. if c.header_ == nil {
  47074. c.header_ = make(http.Header)
  47075. }
  47076. return c.header_
  47077. }
  47078. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  47079. reqHeaders := make(http.Header)
  47080. for k, v := range c.header_ {
  47081. reqHeaders[k] = v
  47082. }
  47083. reqHeaders.Set("User-Agent", c.s.userAgent())
  47084. var body io.Reader = nil
  47085. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  47086. if err != nil {
  47087. return nil, err
  47088. }
  47089. reqHeaders.Set("Content-Type", "application/json")
  47090. c.urlParams_.Set("alt", alt)
  47091. c.urlParams_.Set("prettyPrint", "false")
  47092. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  47093. urls += "?" + c.urlParams_.Encode()
  47094. req, err := http.NewRequest("POST", urls, body)
  47095. if err != nil {
  47096. return nil, err
  47097. }
  47098. req.Header = reqHeaders
  47099. googleapi.Expand(req.URL, map[string]string{
  47100. "project": c.project,
  47101. "zone": c.zone,
  47102. "instanceGroup": c.instanceGroup,
  47103. })
  47104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47105. }
  47106. // Do executes the "compute.instanceGroups.listInstances" call.
  47107. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  47108. // Any non-2xx status code is an error. Response headers are in either
  47109. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  47110. // was returned at all) in error.(*googleapi.Error).Header. Use
  47111. // googleapi.IsNotModified to check whether the returned error was
  47112. // because http.StatusNotModified was returned.
  47113. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  47114. gensupport.SetOptions(c.urlParams_, opts...)
  47115. res, err := c.doRequest("json")
  47116. if res != nil && res.StatusCode == http.StatusNotModified {
  47117. if res.Body != nil {
  47118. res.Body.Close()
  47119. }
  47120. return nil, &googleapi.Error{
  47121. Code: res.StatusCode,
  47122. Header: res.Header,
  47123. }
  47124. }
  47125. if err != nil {
  47126. return nil, err
  47127. }
  47128. defer googleapi.CloseBody(res)
  47129. if err := googleapi.CheckResponse(res); err != nil {
  47130. return nil, err
  47131. }
  47132. ret := &InstanceGroupsListInstances{
  47133. ServerResponse: googleapi.ServerResponse{
  47134. Header: res.Header,
  47135. HTTPStatusCode: res.StatusCode,
  47136. },
  47137. }
  47138. target := &ret
  47139. if err := gensupport.DecodeResponse(target, res); err != nil {
  47140. return nil, err
  47141. }
  47142. return ret, nil
  47143. // {
  47144. // "description": "Lists the instances in the specified instance group.",
  47145. // "httpMethod": "POST",
  47146. // "id": "compute.instanceGroups.listInstances",
  47147. // "parameterOrder": [
  47148. // "project",
  47149. // "zone",
  47150. // "instanceGroup"
  47151. // ],
  47152. // "parameters": {
  47153. // "filter": {
  47154. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47155. // "location": "query",
  47156. // "type": "string"
  47157. // },
  47158. // "instanceGroup": {
  47159. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  47160. // "location": "path",
  47161. // "required": true,
  47162. // "type": "string"
  47163. // },
  47164. // "maxResults": {
  47165. // "default": "500",
  47166. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47167. // "format": "uint32",
  47168. // "location": "query",
  47169. // "minimum": "0",
  47170. // "type": "integer"
  47171. // },
  47172. // "orderBy": {
  47173. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47174. // "location": "query",
  47175. // "type": "string"
  47176. // },
  47177. // "pageToken": {
  47178. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47179. // "location": "query",
  47180. // "type": "string"
  47181. // },
  47182. // "project": {
  47183. // "description": "Project ID for this request.",
  47184. // "location": "path",
  47185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47186. // "required": true,
  47187. // "type": "string"
  47188. // },
  47189. // "zone": {
  47190. // "description": "The name of the zone where the instance group is located.",
  47191. // "location": "path",
  47192. // "required": true,
  47193. // "type": "string"
  47194. // }
  47195. // },
  47196. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  47197. // "request": {
  47198. // "$ref": "InstanceGroupsListInstancesRequest"
  47199. // },
  47200. // "response": {
  47201. // "$ref": "InstanceGroupsListInstances"
  47202. // },
  47203. // "scopes": [
  47204. // "https://www.googleapis.com/auth/cloud-platform",
  47205. // "https://www.googleapis.com/auth/compute",
  47206. // "https://www.googleapis.com/auth/compute.readonly"
  47207. // ]
  47208. // }
  47209. }
  47210. // Pages invokes f for each page of results.
  47211. // A non-nil error returned from f will halt the iteration.
  47212. // The provided context supersedes any context provided to the Context method.
  47213. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  47214. c.ctx_ = ctx
  47215. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47216. for {
  47217. x, err := c.Do()
  47218. if err != nil {
  47219. return err
  47220. }
  47221. if err := f(x); err != nil {
  47222. return err
  47223. }
  47224. if x.NextPageToken == "" {
  47225. return nil
  47226. }
  47227. c.PageToken(x.NextPageToken)
  47228. }
  47229. }
  47230. // method id "compute.instanceGroups.removeInstances":
  47231. type InstanceGroupsRemoveInstancesCall struct {
  47232. s *Service
  47233. project string
  47234. zone string
  47235. instanceGroup string
  47236. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  47237. urlParams_ gensupport.URLParams
  47238. ctx_ context.Context
  47239. header_ http.Header
  47240. }
  47241. // RemoveInstances: Removes one or more instances from the specified
  47242. // instance group, but does not delete those instances.
  47243. //
  47244. // If the group is part of a backend service that has enabled connection
  47245. // draining, it can take up to 60 seconds after the connection draining
  47246. // duration before the VM instance is removed or deleted.
  47247. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  47248. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47249. c.project = project
  47250. c.zone = zone
  47251. c.instanceGroup = instanceGroup
  47252. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  47253. return c
  47254. }
  47255. // RequestId sets the optional parameter "requestId": An optional
  47256. // request ID to identify requests. Specify a unique request ID so that
  47257. // if you must retry your request, the server will know to ignore the
  47258. // request if it has already been completed.
  47259. //
  47260. // For example, consider a situation where you make an initial request
  47261. // and the request times out. If you make the request again with the
  47262. // same request ID, the server can check if original operation with the
  47263. // same request ID was received, and if so, will ignore the second
  47264. // request. This prevents clients from accidentally creating duplicate
  47265. // commitments.
  47266. //
  47267. // The request ID must be a valid UUID with the exception that zero UUID
  47268. // is not supported (00000000-0000-0000-0000-000000000000).
  47269. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  47270. c.urlParams_.Set("requestId", requestId)
  47271. return c
  47272. }
  47273. // Fields allows partial responses to be retrieved. See
  47274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47275. // for more information.
  47276. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  47277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47278. return c
  47279. }
  47280. // Context sets the context to be used in this call's Do method. Any
  47281. // pending HTTP request will be aborted if the provided context is
  47282. // canceled.
  47283. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  47284. c.ctx_ = ctx
  47285. return c
  47286. }
  47287. // Header returns an http.Header that can be modified by the caller to
  47288. // add HTTP headers to the request.
  47289. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  47290. if c.header_ == nil {
  47291. c.header_ = make(http.Header)
  47292. }
  47293. return c.header_
  47294. }
  47295. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  47296. reqHeaders := make(http.Header)
  47297. for k, v := range c.header_ {
  47298. reqHeaders[k] = v
  47299. }
  47300. reqHeaders.Set("User-Agent", c.s.userAgent())
  47301. var body io.Reader = nil
  47302. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  47303. if err != nil {
  47304. return nil, err
  47305. }
  47306. reqHeaders.Set("Content-Type", "application/json")
  47307. c.urlParams_.Set("alt", alt)
  47308. c.urlParams_.Set("prettyPrint", "false")
  47309. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  47310. urls += "?" + c.urlParams_.Encode()
  47311. req, err := http.NewRequest("POST", urls, body)
  47312. if err != nil {
  47313. return nil, err
  47314. }
  47315. req.Header = reqHeaders
  47316. googleapi.Expand(req.URL, map[string]string{
  47317. "project": c.project,
  47318. "zone": c.zone,
  47319. "instanceGroup": c.instanceGroup,
  47320. })
  47321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47322. }
  47323. // Do executes the "compute.instanceGroups.removeInstances" call.
  47324. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47325. // status code is an error. Response headers are in either
  47326. // *Operation.ServerResponse.Header or (if a response was returned at
  47327. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47328. // to check whether the returned error was because
  47329. // http.StatusNotModified was returned.
  47330. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47331. gensupport.SetOptions(c.urlParams_, opts...)
  47332. res, err := c.doRequest("json")
  47333. if res != nil && res.StatusCode == http.StatusNotModified {
  47334. if res.Body != nil {
  47335. res.Body.Close()
  47336. }
  47337. return nil, &googleapi.Error{
  47338. Code: res.StatusCode,
  47339. Header: res.Header,
  47340. }
  47341. }
  47342. if err != nil {
  47343. return nil, err
  47344. }
  47345. defer googleapi.CloseBody(res)
  47346. if err := googleapi.CheckResponse(res); err != nil {
  47347. return nil, err
  47348. }
  47349. ret := &Operation{
  47350. ServerResponse: googleapi.ServerResponse{
  47351. Header: res.Header,
  47352. HTTPStatusCode: res.StatusCode,
  47353. },
  47354. }
  47355. target := &ret
  47356. if err := gensupport.DecodeResponse(target, res); err != nil {
  47357. return nil, err
  47358. }
  47359. return ret, nil
  47360. // {
  47361. // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.",
  47362. // "httpMethod": "POST",
  47363. // "id": "compute.instanceGroups.removeInstances",
  47364. // "parameterOrder": [
  47365. // "project",
  47366. // "zone",
  47367. // "instanceGroup"
  47368. // ],
  47369. // "parameters": {
  47370. // "instanceGroup": {
  47371. // "description": "The name of the instance group where the specified instances will be removed.",
  47372. // "location": "path",
  47373. // "required": true,
  47374. // "type": "string"
  47375. // },
  47376. // "project": {
  47377. // "description": "Project ID for this request.",
  47378. // "location": "path",
  47379. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47380. // "required": true,
  47381. // "type": "string"
  47382. // },
  47383. // "requestId": {
  47384. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47385. // "location": "query",
  47386. // "type": "string"
  47387. // },
  47388. // "zone": {
  47389. // "description": "The name of the zone where the instance group is located.",
  47390. // "location": "path",
  47391. // "required": true,
  47392. // "type": "string"
  47393. // }
  47394. // },
  47395. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  47396. // "request": {
  47397. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  47398. // },
  47399. // "response": {
  47400. // "$ref": "Operation"
  47401. // },
  47402. // "scopes": [
  47403. // "https://www.googleapis.com/auth/cloud-platform",
  47404. // "https://www.googleapis.com/auth/compute"
  47405. // ]
  47406. // }
  47407. }
  47408. // method id "compute.instanceGroups.setNamedPorts":
  47409. type InstanceGroupsSetNamedPortsCall struct {
  47410. s *Service
  47411. project string
  47412. zone string
  47413. instanceGroup string
  47414. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  47415. urlParams_ gensupport.URLParams
  47416. ctx_ context.Context
  47417. header_ http.Header
  47418. }
  47419. // SetNamedPorts: Sets the named ports for the specified instance group.
  47420. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  47421. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47422. c.project = project
  47423. c.zone = zone
  47424. c.instanceGroup = instanceGroup
  47425. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  47426. return c
  47427. }
  47428. // RequestId sets the optional parameter "requestId": An optional
  47429. // request ID to identify requests. Specify a unique request ID so that
  47430. // if you must retry your request, the server will know to ignore the
  47431. // request if it has already been completed.
  47432. //
  47433. // For example, consider a situation where you make an initial request
  47434. // and the request times out. If you make the request again with the
  47435. // same request ID, the server can check if original operation with the
  47436. // same request ID was received, and if so, will ignore the second
  47437. // request. This prevents clients from accidentally creating duplicate
  47438. // commitments.
  47439. //
  47440. // The request ID must be a valid UUID with the exception that zero UUID
  47441. // is not supported (00000000-0000-0000-0000-000000000000).
  47442. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  47443. c.urlParams_.Set("requestId", requestId)
  47444. return c
  47445. }
  47446. // Fields allows partial responses to be retrieved. See
  47447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47448. // for more information.
  47449. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  47450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47451. return c
  47452. }
  47453. // Context sets the context to be used in this call's Do method. Any
  47454. // pending HTTP request will be aborted if the provided context is
  47455. // canceled.
  47456. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  47457. c.ctx_ = ctx
  47458. return c
  47459. }
  47460. // Header returns an http.Header that can be modified by the caller to
  47461. // add HTTP headers to the request.
  47462. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  47463. if c.header_ == nil {
  47464. c.header_ = make(http.Header)
  47465. }
  47466. return c.header_
  47467. }
  47468. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  47469. reqHeaders := make(http.Header)
  47470. for k, v := range c.header_ {
  47471. reqHeaders[k] = v
  47472. }
  47473. reqHeaders.Set("User-Agent", c.s.userAgent())
  47474. var body io.Reader = nil
  47475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  47476. if err != nil {
  47477. return nil, err
  47478. }
  47479. reqHeaders.Set("Content-Type", "application/json")
  47480. c.urlParams_.Set("alt", alt)
  47481. c.urlParams_.Set("prettyPrint", "false")
  47482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  47483. urls += "?" + c.urlParams_.Encode()
  47484. req, err := http.NewRequest("POST", urls, body)
  47485. if err != nil {
  47486. return nil, err
  47487. }
  47488. req.Header = reqHeaders
  47489. googleapi.Expand(req.URL, map[string]string{
  47490. "project": c.project,
  47491. "zone": c.zone,
  47492. "instanceGroup": c.instanceGroup,
  47493. })
  47494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47495. }
  47496. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  47497. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47498. // status code is an error. Response headers are in either
  47499. // *Operation.ServerResponse.Header or (if a response was returned at
  47500. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47501. // to check whether the returned error was because
  47502. // http.StatusNotModified was returned.
  47503. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47504. gensupport.SetOptions(c.urlParams_, opts...)
  47505. res, err := c.doRequest("json")
  47506. if res != nil && res.StatusCode == http.StatusNotModified {
  47507. if res.Body != nil {
  47508. res.Body.Close()
  47509. }
  47510. return nil, &googleapi.Error{
  47511. Code: res.StatusCode,
  47512. Header: res.Header,
  47513. }
  47514. }
  47515. if err != nil {
  47516. return nil, err
  47517. }
  47518. defer googleapi.CloseBody(res)
  47519. if err := googleapi.CheckResponse(res); err != nil {
  47520. return nil, err
  47521. }
  47522. ret := &Operation{
  47523. ServerResponse: googleapi.ServerResponse{
  47524. Header: res.Header,
  47525. HTTPStatusCode: res.StatusCode,
  47526. },
  47527. }
  47528. target := &ret
  47529. if err := gensupport.DecodeResponse(target, res); err != nil {
  47530. return nil, err
  47531. }
  47532. return ret, nil
  47533. // {
  47534. // "description": "Sets the named ports for the specified instance group.",
  47535. // "httpMethod": "POST",
  47536. // "id": "compute.instanceGroups.setNamedPorts",
  47537. // "parameterOrder": [
  47538. // "project",
  47539. // "zone",
  47540. // "instanceGroup"
  47541. // ],
  47542. // "parameters": {
  47543. // "instanceGroup": {
  47544. // "description": "The name of the instance group where the named ports are updated.",
  47545. // "location": "path",
  47546. // "required": true,
  47547. // "type": "string"
  47548. // },
  47549. // "project": {
  47550. // "description": "Project ID for this request.",
  47551. // "location": "path",
  47552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47553. // "required": true,
  47554. // "type": "string"
  47555. // },
  47556. // "requestId": {
  47557. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47558. // "location": "query",
  47559. // "type": "string"
  47560. // },
  47561. // "zone": {
  47562. // "description": "The name of the zone where the instance group is located.",
  47563. // "location": "path",
  47564. // "required": true,
  47565. // "type": "string"
  47566. // }
  47567. // },
  47568. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  47569. // "request": {
  47570. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  47571. // },
  47572. // "response": {
  47573. // "$ref": "Operation"
  47574. // },
  47575. // "scopes": [
  47576. // "https://www.googleapis.com/auth/cloud-platform",
  47577. // "https://www.googleapis.com/auth/compute"
  47578. // ]
  47579. // }
  47580. }
  47581. // method id "compute.instanceTemplates.delete":
  47582. type InstanceTemplatesDeleteCall struct {
  47583. s *Service
  47584. project string
  47585. instanceTemplate string
  47586. urlParams_ gensupport.URLParams
  47587. ctx_ context.Context
  47588. header_ http.Header
  47589. }
  47590. // Delete: Deletes the specified instance template. Deleting an instance
  47591. // template is permanent and cannot be undone. It's not possible to
  47592. // delete templates which are in use by an instance group.
  47593. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  47594. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  47595. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47596. c.project = project
  47597. c.instanceTemplate = instanceTemplate
  47598. return c
  47599. }
  47600. // RequestId sets the optional parameter "requestId": An optional
  47601. // request ID to identify requests. Specify a unique request ID so that
  47602. // if you must retry your request, the server will know to ignore the
  47603. // request if it has already been completed.
  47604. //
  47605. // For example, consider a situation where you make an initial request
  47606. // and the request times out. If you make the request again with the
  47607. // same request ID, the server can check if original operation with the
  47608. // same request ID was received, and if so, will ignore the second
  47609. // request. This prevents clients from accidentally creating duplicate
  47610. // commitments.
  47611. //
  47612. // The request ID must be a valid UUID with the exception that zero UUID
  47613. // is not supported (00000000-0000-0000-0000-000000000000).
  47614. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  47615. c.urlParams_.Set("requestId", requestId)
  47616. return c
  47617. }
  47618. // Fields allows partial responses to be retrieved. See
  47619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47620. // for more information.
  47621. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  47622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47623. return c
  47624. }
  47625. // Context sets the context to be used in this call's Do method. Any
  47626. // pending HTTP request will be aborted if the provided context is
  47627. // canceled.
  47628. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  47629. c.ctx_ = ctx
  47630. return c
  47631. }
  47632. // Header returns an http.Header that can be modified by the caller to
  47633. // add HTTP headers to the request.
  47634. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  47635. if c.header_ == nil {
  47636. c.header_ = make(http.Header)
  47637. }
  47638. return c.header_
  47639. }
  47640. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  47641. reqHeaders := make(http.Header)
  47642. for k, v := range c.header_ {
  47643. reqHeaders[k] = v
  47644. }
  47645. reqHeaders.Set("User-Agent", c.s.userAgent())
  47646. var body io.Reader = nil
  47647. c.urlParams_.Set("alt", alt)
  47648. c.urlParams_.Set("prettyPrint", "false")
  47649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  47650. urls += "?" + c.urlParams_.Encode()
  47651. req, err := http.NewRequest("DELETE", urls, body)
  47652. if err != nil {
  47653. return nil, err
  47654. }
  47655. req.Header = reqHeaders
  47656. googleapi.Expand(req.URL, map[string]string{
  47657. "project": c.project,
  47658. "instanceTemplate": c.instanceTemplate,
  47659. })
  47660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47661. }
  47662. // Do executes the "compute.instanceTemplates.delete" call.
  47663. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47664. // status code is an error. Response headers are in either
  47665. // *Operation.ServerResponse.Header or (if a response was returned at
  47666. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47667. // to check whether the returned error was because
  47668. // http.StatusNotModified was returned.
  47669. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47670. gensupport.SetOptions(c.urlParams_, opts...)
  47671. res, err := c.doRequest("json")
  47672. if res != nil && res.StatusCode == http.StatusNotModified {
  47673. if res.Body != nil {
  47674. res.Body.Close()
  47675. }
  47676. return nil, &googleapi.Error{
  47677. Code: res.StatusCode,
  47678. Header: res.Header,
  47679. }
  47680. }
  47681. if err != nil {
  47682. return nil, err
  47683. }
  47684. defer googleapi.CloseBody(res)
  47685. if err := googleapi.CheckResponse(res); err != nil {
  47686. return nil, err
  47687. }
  47688. ret := &Operation{
  47689. ServerResponse: googleapi.ServerResponse{
  47690. Header: res.Header,
  47691. HTTPStatusCode: res.StatusCode,
  47692. },
  47693. }
  47694. target := &ret
  47695. if err := gensupport.DecodeResponse(target, res); err != nil {
  47696. return nil, err
  47697. }
  47698. return ret, nil
  47699. // {
  47700. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group.",
  47701. // "httpMethod": "DELETE",
  47702. // "id": "compute.instanceTemplates.delete",
  47703. // "parameterOrder": [
  47704. // "project",
  47705. // "instanceTemplate"
  47706. // ],
  47707. // "parameters": {
  47708. // "instanceTemplate": {
  47709. // "description": "The name of the instance template to delete.",
  47710. // "location": "path",
  47711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47712. // "required": true,
  47713. // "type": "string"
  47714. // },
  47715. // "project": {
  47716. // "description": "Project ID for this request.",
  47717. // "location": "path",
  47718. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47719. // "required": true,
  47720. // "type": "string"
  47721. // },
  47722. // "requestId": {
  47723. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47724. // "location": "query",
  47725. // "type": "string"
  47726. // }
  47727. // },
  47728. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  47729. // "response": {
  47730. // "$ref": "Operation"
  47731. // },
  47732. // "scopes": [
  47733. // "https://www.googleapis.com/auth/cloud-platform",
  47734. // "https://www.googleapis.com/auth/compute"
  47735. // ]
  47736. // }
  47737. }
  47738. // method id "compute.instanceTemplates.get":
  47739. type InstanceTemplatesGetCall struct {
  47740. s *Service
  47741. project string
  47742. instanceTemplate string
  47743. urlParams_ gensupport.URLParams
  47744. ifNoneMatch_ string
  47745. ctx_ context.Context
  47746. header_ http.Header
  47747. }
  47748. // Get: Returns the specified instance template. Gets a list of
  47749. // available instance templates by making a list() request.
  47750. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  47751. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  47752. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47753. c.project = project
  47754. c.instanceTemplate = instanceTemplate
  47755. return c
  47756. }
  47757. // Fields allows partial responses to be retrieved. See
  47758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47759. // for more information.
  47760. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  47761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47762. return c
  47763. }
  47764. // IfNoneMatch sets the optional parameter which makes the operation
  47765. // fail if the object's ETag matches the given value. This is useful for
  47766. // getting updates only after the object has changed since the last
  47767. // request. Use googleapi.IsNotModified to check whether the response
  47768. // error from Do is the result of In-None-Match.
  47769. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  47770. c.ifNoneMatch_ = entityTag
  47771. return c
  47772. }
  47773. // Context sets the context to be used in this call's Do method. Any
  47774. // pending HTTP request will be aborted if the provided context is
  47775. // canceled.
  47776. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  47777. c.ctx_ = ctx
  47778. return c
  47779. }
  47780. // Header returns an http.Header that can be modified by the caller to
  47781. // add HTTP headers to the request.
  47782. func (c *InstanceTemplatesGetCall) Header() http.Header {
  47783. if c.header_ == nil {
  47784. c.header_ = make(http.Header)
  47785. }
  47786. return c.header_
  47787. }
  47788. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  47789. reqHeaders := make(http.Header)
  47790. for k, v := range c.header_ {
  47791. reqHeaders[k] = v
  47792. }
  47793. reqHeaders.Set("User-Agent", c.s.userAgent())
  47794. if c.ifNoneMatch_ != "" {
  47795. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47796. }
  47797. var body io.Reader = nil
  47798. c.urlParams_.Set("alt", alt)
  47799. c.urlParams_.Set("prettyPrint", "false")
  47800. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  47801. urls += "?" + c.urlParams_.Encode()
  47802. req, err := http.NewRequest("GET", urls, body)
  47803. if err != nil {
  47804. return nil, err
  47805. }
  47806. req.Header = reqHeaders
  47807. googleapi.Expand(req.URL, map[string]string{
  47808. "project": c.project,
  47809. "instanceTemplate": c.instanceTemplate,
  47810. })
  47811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47812. }
  47813. // Do executes the "compute.instanceTemplates.get" call.
  47814. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  47815. // non-2xx status code is an error. Response headers are in either
  47816. // *InstanceTemplate.ServerResponse.Header or (if a response was
  47817. // returned at all) in error.(*googleapi.Error).Header. Use
  47818. // googleapi.IsNotModified to check whether the returned error was
  47819. // because http.StatusNotModified was returned.
  47820. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  47821. gensupport.SetOptions(c.urlParams_, opts...)
  47822. res, err := c.doRequest("json")
  47823. if res != nil && res.StatusCode == http.StatusNotModified {
  47824. if res.Body != nil {
  47825. res.Body.Close()
  47826. }
  47827. return nil, &googleapi.Error{
  47828. Code: res.StatusCode,
  47829. Header: res.Header,
  47830. }
  47831. }
  47832. if err != nil {
  47833. return nil, err
  47834. }
  47835. defer googleapi.CloseBody(res)
  47836. if err := googleapi.CheckResponse(res); err != nil {
  47837. return nil, err
  47838. }
  47839. ret := &InstanceTemplate{
  47840. ServerResponse: googleapi.ServerResponse{
  47841. Header: res.Header,
  47842. HTTPStatusCode: res.StatusCode,
  47843. },
  47844. }
  47845. target := &ret
  47846. if err := gensupport.DecodeResponse(target, res); err != nil {
  47847. return nil, err
  47848. }
  47849. return ret, nil
  47850. // {
  47851. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  47852. // "httpMethod": "GET",
  47853. // "id": "compute.instanceTemplates.get",
  47854. // "parameterOrder": [
  47855. // "project",
  47856. // "instanceTemplate"
  47857. // ],
  47858. // "parameters": {
  47859. // "instanceTemplate": {
  47860. // "description": "The name of the instance template.",
  47861. // "location": "path",
  47862. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47863. // "required": true,
  47864. // "type": "string"
  47865. // },
  47866. // "project": {
  47867. // "description": "Project ID for this request.",
  47868. // "location": "path",
  47869. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47870. // "required": true,
  47871. // "type": "string"
  47872. // }
  47873. // },
  47874. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  47875. // "response": {
  47876. // "$ref": "InstanceTemplate"
  47877. // },
  47878. // "scopes": [
  47879. // "https://www.googleapis.com/auth/cloud-platform",
  47880. // "https://www.googleapis.com/auth/compute",
  47881. // "https://www.googleapis.com/auth/compute.readonly"
  47882. // ]
  47883. // }
  47884. }
  47885. // method id "compute.instanceTemplates.getIamPolicy":
  47886. type InstanceTemplatesGetIamPolicyCall struct {
  47887. s *Service
  47888. project string
  47889. resource string
  47890. urlParams_ gensupport.URLParams
  47891. ifNoneMatch_ string
  47892. ctx_ context.Context
  47893. header_ http.Header
  47894. }
  47895. // GetIamPolicy: Gets the access control policy for a resource. May be
  47896. // empty if no such policy or resource exists.
  47897. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  47898. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47899. c.project = project
  47900. c.resource = resource
  47901. return c
  47902. }
  47903. // Fields allows partial responses to be retrieved. See
  47904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47905. // for more information.
  47906. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  47907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47908. return c
  47909. }
  47910. // IfNoneMatch sets the optional parameter which makes the operation
  47911. // fail if the object's ETag matches the given value. This is useful for
  47912. // getting updates only after the object has changed since the last
  47913. // request. Use googleapi.IsNotModified to check whether the response
  47914. // error from Do is the result of In-None-Match.
  47915. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  47916. c.ifNoneMatch_ = entityTag
  47917. return c
  47918. }
  47919. // Context sets the context to be used in this call's Do method. Any
  47920. // pending HTTP request will be aborted if the provided context is
  47921. // canceled.
  47922. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  47923. c.ctx_ = ctx
  47924. return c
  47925. }
  47926. // Header returns an http.Header that can be modified by the caller to
  47927. // add HTTP headers to the request.
  47928. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  47929. if c.header_ == nil {
  47930. c.header_ = make(http.Header)
  47931. }
  47932. return c.header_
  47933. }
  47934. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  47935. reqHeaders := make(http.Header)
  47936. for k, v := range c.header_ {
  47937. reqHeaders[k] = v
  47938. }
  47939. reqHeaders.Set("User-Agent", c.s.userAgent())
  47940. if c.ifNoneMatch_ != "" {
  47941. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47942. }
  47943. var body io.Reader = nil
  47944. c.urlParams_.Set("alt", alt)
  47945. c.urlParams_.Set("prettyPrint", "false")
  47946. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  47947. urls += "?" + c.urlParams_.Encode()
  47948. req, err := http.NewRequest("GET", urls, body)
  47949. if err != nil {
  47950. return nil, err
  47951. }
  47952. req.Header = reqHeaders
  47953. googleapi.Expand(req.URL, map[string]string{
  47954. "project": c.project,
  47955. "resource": c.resource,
  47956. })
  47957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47958. }
  47959. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  47960. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  47961. // code is an error. Response headers are in either
  47962. // *Policy.ServerResponse.Header or (if a response was returned at all)
  47963. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  47964. // check whether the returned error was because http.StatusNotModified
  47965. // was returned.
  47966. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  47967. gensupport.SetOptions(c.urlParams_, opts...)
  47968. res, err := c.doRequest("json")
  47969. if res != nil && res.StatusCode == http.StatusNotModified {
  47970. if res.Body != nil {
  47971. res.Body.Close()
  47972. }
  47973. return nil, &googleapi.Error{
  47974. Code: res.StatusCode,
  47975. Header: res.Header,
  47976. }
  47977. }
  47978. if err != nil {
  47979. return nil, err
  47980. }
  47981. defer googleapi.CloseBody(res)
  47982. if err := googleapi.CheckResponse(res); err != nil {
  47983. return nil, err
  47984. }
  47985. ret := &Policy{
  47986. ServerResponse: googleapi.ServerResponse{
  47987. Header: res.Header,
  47988. HTTPStatusCode: res.StatusCode,
  47989. },
  47990. }
  47991. target := &ret
  47992. if err := gensupport.DecodeResponse(target, res); err != nil {
  47993. return nil, err
  47994. }
  47995. return ret, nil
  47996. // {
  47997. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  47998. // "httpMethod": "GET",
  47999. // "id": "compute.instanceTemplates.getIamPolicy",
  48000. // "parameterOrder": [
  48001. // "project",
  48002. // "resource"
  48003. // ],
  48004. // "parameters": {
  48005. // "project": {
  48006. // "description": "Project ID for this request.",
  48007. // "location": "path",
  48008. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48009. // "required": true,
  48010. // "type": "string"
  48011. // },
  48012. // "resource": {
  48013. // "description": "Name or id of the resource for this request.",
  48014. // "location": "path",
  48015. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48016. // "required": true,
  48017. // "type": "string"
  48018. // }
  48019. // },
  48020. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  48021. // "response": {
  48022. // "$ref": "Policy"
  48023. // },
  48024. // "scopes": [
  48025. // "https://www.googleapis.com/auth/cloud-platform",
  48026. // "https://www.googleapis.com/auth/compute",
  48027. // "https://www.googleapis.com/auth/compute.readonly"
  48028. // ]
  48029. // }
  48030. }
  48031. // method id "compute.instanceTemplates.insert":
  48032. type InstanceTemplatesInsertCall struct {
  48033. s *Service
  48034. project string
  48035. instancetemplate *InstanceTemplate
  48036. urlParams_ gensupport.URLParams
  48037. ctx_ context.Context
  48038. header_ http.Header
  48039. }
  48040. // Insert: Creates an instance template in the specified project using
  48041. // the data that is included in the request. If you are creating a new
  48042. // template to update an existing instance group, your new instance
  48043. // template must use the same network or, if applicable, the same
  48044. // subnetwork as the original template.
  48045. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  48046. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  48047. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48048. c.project = project
  48049. c.instancetemplate = instancetemplate
  48050. return c
  48051. }
  48052. // RequestId sets the optional parameter "requestId": An optional
  48053. // request ID to identify requests. Specify a unique request ID so that
  48054. // if you must retry your request, the server will know to ignore the
  48055. // request if it has already been completed.
  48056. //
  48057. // For example, consider a situation where you make an initial request
  48058. // and the request times out. If you make the request again with the
  48059. // same request ID, the server can check if original operation with the
  48060. // same request ID was received, and if so, will ignore the second
  48061. // request. This prevents clients from accidentally creating duplicate
  48062. // commitments.
  48063. //
  48064. // The request ID must be a valid UUID with the exception that zero UUID
  48065. // is not supported (00000000-0000-0000-0000-000000000000).
  48066. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  48067. c.urlParams_.Set("requestId", requestId)
  48068. return c
  48069. }
  48070. // Fields allows partial responses to be retrieved. See
  48071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48072. // for more information.
  48073. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  48074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48075. return c
  48076. }
  48077. // Context sets the context to be used in this call's Do method. Any
  48078. // pending HTTP request will be aborted if the provided context is
  48079. // canceled.
  48080. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  48081. c.ctx_ = ctx
  48082. return c
  48083. }
  48084. // Header returns an http.Header that can be modified by the caller to
  48085. // add HTTP headers to the request.
  48086. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  48087. if c.header_ == nil {
  48088. c.header_ = make(http.Header)
  48089. }
  48090. return c.header_
  48091. }
  48092. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  48093. reqHeaders := make(http.Header)
  48094. for k, v := range c.header_ {
  48095. reqHeaders[k] = v
  48096. }
  48097. reqHeaders.Set("User-Agent", c.s.userAgent())
  48098. var body io.Reader = nil
  48099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  48100. if err != nil {
  48101. return nil, err
  48102. }
  48103. reqHeaders.Set("Content-Type", "application/json")
  48104. c.urlParams_.Set("alt", alt)
  48105. c.urlParams_.Set("prettyPrint", "false")
  48106. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  48107. urls += "?" + c.urlParams_.Encode()
  48108. req, err := http.NewRequest("POST", urls, body)
  48109. if err != nil {
  48110. return nil, err
  48111. }
  48112. req.Header = reqHeaders
  48113. googleapi.Expand(req.URL, map[string]string{
  48114. "project": c.project,
  48115. })
  48116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48117. }
  48118. // Do executes the "compute.instanceTemplates.insert" call.
  48119. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48120. // status code is an error. Response headers are in either
  48121. // *Operation.ServerResponse.Header or (if a response was returned at
  48122. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48123. // to check whether the returned error was because
  48124. // http.StatusNotModified was returned.
  48125. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48126. gensupport.SetOptions(c.urlParams_, opts...)
  48127. res, err := c.doRequest("json")
  48128. if res != nil && res.StatusCode == http.StatusNotModified {
  48129. if res.Body != nil {
  48130. res.Body.Close()
  48131. }
  48132. return nil, &googleapi.Error{
  48133. Code: res.StatusCode,
  48134. Header: res.Header,
  48135. }
  48136. }
  48137. if err != nil {
  48138. return nil, err
  48139. }
  48140. defer googleapi.CloseBody(res)
  48141. if err := googleapi.CheckResponse(res); err != nil {
  48142. return nil, err
  48143. }
  48144. ret := &Operation{
  48145. ServerResponse: googleapi.ServerResponse{
  48146. Header: res.Header,
  48147. HTTPStatusCode: res.StatusCode,
  48148. },
  48149. }
  48150. target := &ret
  48151. if err := gensupport.DecodeResponse(target, res); err != nil {
  48152. return nil, err
  48153. }
  48154. return ret, nil
  48155. // {
  48156. // "description": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.",
  48157. // "httpMethod": "POST",
  48158. // "id": "compute.instanceTemplates.insert",
  48159. // "parameterOrder": [
  48160. // "project"
  48161. // ],
  48162. // "parameters": {
  48163. // "project": {
  48164. // "description": "Project ID for this request.",
  48165. // "location": "path",
  48166. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48167. // "required": true,
  48168. // "type": "string"
  48169. // },
  48170. // "requestId": {
  48171. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48172. // "location": "query",
  48173. // "type": "string"
  48174. // }
  48175. // },
  48176. // "path": "{project}/global/instanceTemplates",
  48177. // "request": {
  48178. // "$ref": "InstanceTemplate"
  48179. // },
  48180. // "response": {
  48181. // "$ref": "Operation"
  48182. // },
  48183. // "scopes": [
  48184. // "https://www.googleapis.com/auth/cloud-platform",
  48185. // "https://www.googleapis.com/auth/compute"
  48186. // ]
  48187. // }
  48188. }
  48189. // method id "compute.instanceTemplates.list":
  48190. type InstanceTemplatesListCall struct {
  48191. s *Service
  48192. project string
  48193. urlParams_ gensupport.URLParams
  48194. ifNoneMatch_ string
  48195. ctx_ context.Context
  48196. header_ http.Header
  48197. }
  48198. // List: Retrieves a list of instance templates that are contained
  48199. // within the specified project and zone.
  48200. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  48201. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  48202. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48203. c.project = project
  48204. return c
  48205. }
  48206. // Filter sets the optional parameter "filter": A filter expression that
  48207. // filters resources listed in the response. The expression must specify
  48208. // the field name, a comparison operator, and the value that you want to
  48209. // use for filtering. The value must be a string, a number, or a
  48210. // boolean. The comparison operator must be either =, !=, >, or <.
  48211. //
  48212. // For example, if you are filtering Compute Engine instances, you can
  48213. // exclude instances named example-instance by specifying name !=
  48214. // example-instance.
  48215. //
  48216. // You can also filter nested fields. For example, you could specify
  48217. // scheduling.automaticRestart = false to include instances only if they
  48218. // are not scheduled for automatic restarts. You can use filtering on
  48219. // nested fields to filter based on resource labels.
  48220. //
  48221. // To filter on multiple expressions, provide each separate expression
  48222. // within parentheses. For example, (scheduling.automaticRestart = true)
  48223. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48224. // AND expression. However, you can include AND and OR expressions
  48225. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48226. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48227. // true).
  48228. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  48229. c.urlParams_.Set("filter", filter)
  48230. return c
  48231. }
  48232. // MaxResults sets the optional parameter "maxResults": The maximum
  48233. // number of results per page that should be returned. If the number of
  48234. // available results is larger than maxResults, Compute Engine returns a
  48235. // nextPageToken that can be used to get the next page of results in
  48236. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48237. // (Default: 500)
  48238. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  48239. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48240. return c
  48241. }
  48242. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48243. // a certain order. By default, results are returned in alphanumerical
  48244. // order based on the resource name.
  48245. //
  48246. // You can also sort results in descending order based on the creation
  48247. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48248. // based on the creationTimestamp field in reverse chronological order
  48249. // (newest result first). Use this to sort resources like operations so
  48250. // that the newest operation is returned first.
  48251. //
  48252. // Currently, only sorting by name or creationTimestamp desc is
  48253. // supported.
  48254. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  48255. c.urlParams_.Set("orderBy", orderBy)
  48256. return c
  48257. }
  48258. // PageToken sets the optional parameter "pageToken": Specifies a page
  48259. // token to use. Set pageToken to the nextPageToken returned by a
  48260. // previous list request to get the next page of results.
  48261. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  48262. c.urlParams_.Set("pageToken", pageToken)
  48263. return c
  48264. }
  48265. // Fields allows partial responses to be retrieved. See
  48266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48267. // for more information.
  48268. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  48269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48270. return c
  48271. }
  48272. // IfNoneMatch sets the optional parameter which makes the operation
  48273. // fail if the object's ETag matches the given value. This is useful for
  48274. // getting updates only after the object has changed since the last
  48275. // request. Use googleapi.IsNotModified to check whether the response
  48276. // error from Do is the result of In-None-Match.
  48277. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  48278. c.ifNoneMatch_ = entityTag
  48279. return c
  48280. }
  48281. // Context sets the context to be used in this call's Do method. Any
  48282. // pending HTTP request will be aborted if the provided context is
  48283. // canceled.
  48284. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  48285. c.ctx_ = ctx
  48286. return c
  48287. }
  48288. // Header returns an http.Header that can be modified by the caller to
  48289. // add HTTP headers to the request.
  48290. func (c *InstanceTemplatesListCall) Header() http.Header {
  48291. if c.header_ == nil {
  48292. c.header_ = make(http.Header)
  48293. }
  48294. return c.header_
  48295. }
  48296. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  48297. reqHeaders := make(http.Header)
  48298. for k, v := range c.header_ {
  48299. reqHeaders[k] = v
  48300. }
  48301. reqHeaders.Set("User-Agent", c.s.userAgent())
  48302. if c.ifNoneMatch_ != "" {
  48303. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48304. }
  48305. var body io.Reader = nil
  48306. c.urlParams_.Set("alt", alt)
  48307. c.urlParams_.Set("prettyPrint", "false")
  48308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  48309. urls += "?" + c.urlParams_.Encode()
  48310. req, err := http.NewRequest("GET", urls, body)
  48311. if err != nil {
  48312. return nil, err
  48313. }
  48314. req.Header = reqHeaders
  48315. googleapi.Expand(req.URL, map[string]string{
  48316. "project": c.project,
  48317. })
  48318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48319. }
  48320. // Do executes the "compute.instanceTemplates.list" call.
  48321. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  48322. // non-2xx status code is an error. Response headers are in either
  48323. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  48324. // returned at all) in error.(*googleapi.Error).Header. Use
  48325. // googleapi.IsNotModified to check whether the returned error was
  48326. // because http.StatusNotModified was returned.
  48327. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  48328. gensupport.SetOptions(c.urlParams_, opts...)
  48329. res, err := c.doRequest("json")
  48330. if res != nil && res.StatusCode == http.StatusNotModified {
  48331. if res.Body != nil {
  48332. res.Body.Close()
  48333. }
  48334. return nil, &googleapi.Error{
  48335. Code: res.StatusCode,
  48336. Header: res.Header,
  48337. }
  48338. }
  48339. if err != nil {
  48340. return nil, err
  48341. }
  48342. defer googleapi.CloseBody(res)
  48343. if err := googleapi.CheckResponse(res); err != nil {
  48344. return nil, err
  48345. }
  48346. ret := &InstanceTemplateList{
  48347. ServerResponse: googleapi.ServerResponse{
  48348. Header: res.Header,
  48349. HTTPStatusCode: res.StatusCode,
  48350. },
  48351. }
  48352. target := &ret
  48353. if err := gensupport.DecodeResponse(target, res); err != nil {
  48354. return nil, err
  48355. }
  48356. return ret, nil
  48357. // {
  48358. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  48359. // "httpMethod": "GET",
  48360. // "id": "compute.instanceTemplates.list",
  48361. // "parameterOrder": [
  48362. // "project"
  48363. // ],
  48364. // "parameters": {
  48365. // "filter": {
  48366. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  48367. // "location": "query",
  48368. // "type": "string"
  48369. // },
  48370. // "maxResults": {
  48371. // "default": "500",
  48372. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  48373. // "format": "uint32",
  48374. // "location": "query",
  48375. // "minimum": "0",
  48376. // "type": "integer"
  48377. // },
  48378. // "orderBy": {
  48379. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  48380. // "location": "query",
  48381. // "type": "string"
  48382. // },
  48383. // "pageToken": {
  48384. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  48385. // "location": "query",
  48386. // "type": "string"
  48387. // },
  48388. // "project": {
  48389. // "description": "Project ID for this request.",
  48390. // "location": "path",
  48391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48392. // "required": true,
  48393. // "type": "string"
  48394. // }
  48395. // },
  48396. // "path": "{project}/global/instanceTemplates",
  48397. // "response": {
  48398. // "$ref": "InstanceTemplateList"
  48399. // },
  48400. // "scopes": [
  48401. // "https://www.googleapis.com/auth/cloud-platform",
  48402. // "https://www.googleapis.com/auth/compute",
  48403. // "https://www.googleapis.com/auth/compute.readonly"
  48404. // ]
  48405. // }
  48406. }
  48407. // Pages invokes f for each page of results.
  48408. // A non-nil error returned from f will halt the iteration.
  48409. // The provided context supersedes any context provided to the Context method.
  48410. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  48411. c.ctx_ = ctx
  48412. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48413. for {
  48414. x, err := c.Do()
  48415. if err != nil {
  48416. return err
  48417. }
  48418. if err := f(x); err != nil {
  48419. return err
  48420. }
  48421. if x.NextPageToken == "" {
  48422. return nil
  48423. }
  48424. c.PageToken(x.NextPageToken)
  48425. }
  48426. }
  48427. // method id "compute.instanceTemplates.setIamPolicy":
  48428. type InstanceTemplatesSetIamPolicyCall struct {
  48429. s *Service
  48430. project string
  48431. resource string
  48432. globalsetpolicyrequest *GlobalSetPolicyRequest
  48433. urlParams_ gensupport.URLParams
  48434. ctx_ context.Context
  48435. header_ http.Header
  48436. }
  48437. // SetIamPolicy: Sets the access control policy on the specified
  48438. // resource. Replaces any existing policy.
  48439. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  48440. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48441. c.project = project
  48442. c.resource = resource
  48443. c.globalsetpolicyrequest = globalsetpolicyrequest
  48444. return c
  48445. }
  48446. // Fields allows partial responses to be retrieved. See
  48447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48448. // for more information.
  48449. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  48450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48451. return c
  48452. }
  48453. // Context sets the context to be used in this call's Do method. Any
  48454. // pending HTTP request will be aborted if the provided context is
  48455. // canceled.
  48456. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  48457. c.ctx_ = ctx
  48458. return c
  48459. }
  48460. // Header returns an http.Header that can be modified by the caller to
  48461. // add HTTP headers to the request.
  48462. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  48463. if c.header_ == nil {
  48464. c.header_ = make(http.Header)
  48465. }
  48466. return c.header_
  48467. }
  48468. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  48469. reqHeaders := make(http.Header)
  48470. for k, v := range c.header_ {
  48471. reqHeaders[k] = v
  48472. }
  48473. reqHeaders.Set("User-Agent", c.s.userAgent())
  48474. var body io.Reader = nil
  48475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  48476. if err != nil {
  48477. return nil, err
  48478. }
  48479. reqHeaders.Set("Content-Type", "application/json")
  48480. c.urlParams_.Set("alt", alt)
  48481. c.urlParams_.Set("prettyPrint", "false")
  48482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  48483. urls += "?" + c.urlParams_.Encode()
  48484. req, err := http.NewRequest("POST", urls, body)
  48485. if err != nil {
  48486. return nil, err
  48487. }
  48488. req.Header = reqHeaders
  48489. googleapi.Expand(req.URL, map[string]string{
  48490. "project": c.project,
  48491. "resource": c.resource,
  48492. })
  48493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48494. }
  48495. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  48496. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  48497. // code is an error. Response headers are in either
  48498. // *Policy.ServerResponse.Header or (if a response was returned at all)
  48499. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  48500. // check whether the returned error was because http.StatusNotModified
  48501. // was returned.
  48502. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  48503. gensupport.SetOptions(c.urlParams_, opts...)
  48504. res, err := c.doRequest("json")
  48505. if res != nil && res.StatusCode == http.StatusNotModified {
  48506. if res.Body != nil {
  48507. res.Body.Close()
  48508. }
  48509. return nil, &googleapi.Error{
  48510. Code: res.StatusCode,
  48511. Header: res.Header,
  48512. }
  48513. }
  48514. if err != nil {
  48515. return nil, err
  48516. }
  48517. defer googleapi.CloseBody(res)
  48518. if err := googleapi.CheckResponse(res); err != nil {
  48519. return nil, err
  48520. }
  48521. ret := &Policy{
  48522. ServerResponse: googleapi.ServerResponse{
  48523. Header: res.Header,
  48524. HTTPStatusCode: res.StatusCode,
  48525. },
  48526. }
  48527. target := &ret
  48528. if err := gensupport.DecodeResponse(target, res); err != nil {
  48529. return nil, err
  48530. }
  48531. return ret, nil
  48532. // {
  48533. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  48534. // "httpMethod": "POST",
  48535. // "id": "compute.instanceTemplates.setIamPolicy",
  48536. // "parameterOrder": [
  48537. // "project",
  48538. // "resource"
  48539. // ],
  48540. // "parameters": {
  48541. // "project": {
  48542. // "description": "Project ID for this request.",
  48543. // "location": "path",
  48544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48545. // "required": true,
  48546. // "type": "string"
  48547. // },
  48548. // "resource": {
  48549. // "description": "Name or id of the resource for this request.",
  48550. // "location": "path",
  48551. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48552. // "required": true,
  48553. // "type": "string"
  48554. // }
  48555. // },
  48556. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  48557. // "request": {
  48558. // "$ref": "GlobalSetPolicyRequest"
  48559. // },
  48560. // "response": {
  48561. // "$ref": "Policy"
  48562. // },
  48563. // "scopes": [
  48564. // "https://www.googleapis.com/auth/cloud-platform",
  48565. // "https://www.googleapis.com/auth/compute"
  48566. // ]
  48567. // }
  48568. }
  48569. // method id "compute.instanceTemplates.testIamPermissions":
  48570. type InstanceTemplatesTestIamPermissionsCall struct {
  48571. s *Service
  48572. project string
  48573. resource string
  48574. testpermissionsrequest *TestPermissionsRequest
  48575. urlParams_ gensupport.URLParams
  48576. ctx_ context.Context
  48577. header_ http.Header
  48578. }
  48579. // TestIamPermissions: Returns permissions that a caller has on the
  48580. // specified resource.
  48581. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  48582. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48583. c.project = project
  48584. c.resource = resource
  48585. c.testpermissionsrequest = testpermissionsrequest
  48586. return c
  48587. }
  48588. // Fields allows partial responses to be retrieved. See
  48589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48590. // for more information.
  48591. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  48592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48593. return c
  48594. }
  48595. // Context sets the context to be used in this call's Do method. Any
  48596. // pending HTTP request will be aborted if the provided context is
  48597. // canceled.
  48598. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  48599. c.ctx_ = ctx
  48600. return c
  48601. }
  48602. // Header returns an http.Header that can be modified by the caller to
  48603. // add HTTP headers to the request.
  48604. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  48605. if c.header_ == nil {
  48606. c.header_ = make(http.Header)
  48607. }
  48608. return c.header_
  48609. }
  48610. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  48611. reqHeaders := make(http.Header)
  48612. for k, v := range c.header_ {
  48613. reqHeaders[k] = v
  48614. }
  48615. reqHeaders.Set("User-Agent", c.s.userAgent())
  48616. var body io.Reader = nil
  48617. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  48618. if err != nil {
  48619. return nil, err
  48620. }
  48621. reqHeaders.Set("Content-Type", "application/json")
  48622. c.urlParams_.Set("alt", alt)
  48623. c.urlParams_.Set("prettyPrint", "false")
  48624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  48625. urls += "?" + c.urlParams_.Encode()
  48626. req, err := http.NewRequest("POST", urls, body)
  48627. if err != nil {
  48628. return nil, err
  48629. }
  48630. req.Header = reqHeaders
  48631. googleapi.Expand(req.URL, map[string]string{
  48632. "project": c.project,
  48633. "resource": c.resource,
  48634. })
  48635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48636. }
  48637. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  48638. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  48639. // non-2xx status code is an error. Response headers are in either
  48640. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  48641. // returned at all) in error.(*googleapi.Error).Header. Use
  48642. // googleapi.IsNotModified to check whether the returned error was
  48643. // because http.StatusNotModified was returned.
  48644. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  48645. gensupport.SetOptions(c.urlParams_, opts...)
  48646. res, err := c.doRequest("json")
  48647. if res != nil && res.StatusCode == http.StatusNotModified {
  48648. if res.Body != nil {
  48649. res.Body.Close()
  48650. }
  48651. return nil, &googleapi.Error{
  48652. Code: res.StatusCode,
  48653. Header: res.Header,
  48654. }
  48655. }
  48656. if err != nil {
  48657. return nil, err
  48658. }
  48659. defer googleapi.CloseBody(res)
  48660. if err := googleapi.CheckResponse(res); err != nil {
  48661. return nil, err
  48662. }
  48663. ret := &TestPermissionsResponse{
  48664. ServerResponse: googleapi.ServerResponse{
  48665. Header: res.Header,
  48666. HTTPStatusCode: res.StatusCode,
  48667. },
  48668. }
  48669. target := &ret
  48670. if err := gensupport.DecodeResponse(target, res); err != nil {
  48671. return nil, err
  48672. }
  48673. return ret, nil
  48674. // {
  48675. // "description": "Returns permissions that a caller has on the specified resource.",
  48676. // "httpMethod": "POST",
  48677. // "id": "compute.instanceTemplates.testIamPermissions",
  48678. // "parameterOrder": [
  48679. // "project",
  48680. // "resource"
  48681. // ],
  48682. // "parameters": {
  48683. // "project": {
  48684. // "description": "Project ID for this request.",
  48685. // "location": "path",
  48686. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48687. // "required": true,
  48688. // "type": "string"
  48689. // },
  48690. // "resource": {
  48691. // "description": "Name or id of the resource for this request.",
  48692. // "location": "path",
  48693. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48694. // "required": true,
  48695. // "type": "string"
  48696. // }
  48697. // },
  48698. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  48699. // "request": {
  48700. // "$ref": "TestPermissionsRequest"
  48701. // },
  48702. // "response": {
  48703. // "$ref": "TestPermissionsResponse"
  48704. // },
  48705. // "scopes": [
  48706. // "https://www.googleapis.com/auth/cloud-platform",
  48707. // "https://www.googleapis.com/auth/compute",
  48708. // "https://www.googleapis.com/auth/compute.readonly"
  48709. // ]
  48710. // }
  48711. }
  48712. // method id "compute.instances.addAccessConfig":
  48713. type InstancesAddAccessConfigCall struct {
  48714. s *Service
  48715. project string
  48716. zone string
  48717. instance string
  48718. accessconfig *AccessConfig
  48719. urlParams_ gensupport.URLParams
  48720. ctx_ context.Context
  48721. header_ http.Header
  48722. }
  48723. // AddAccessConfig: Adds an access config to an instance's network
  48724. // interface.
  48725. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  48726. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  48727. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48728. c.project = project
  48729. c.zone = zone
  48730. c.instance = instance
  48731. c.urlParams_.Set("networkInterface", networkInterface)
  48732. c.accessconfig = accessconfig
  48733. return c
  48734. }
  48735. // RequestId sets the optional parameter "requestId": An optional
  48736. // request ID to identify requests. Specify a unique request ID so that
  48737. // if you must retry your request, the server will know to ignore the
  48738. // request if it has already been completed.
  48739. //
  48740. // For example, consider a situation where you make an initial request
  48741. // and the request times out. If you make the request again with the
  48742. // same request ID, the server can check if original operation with the
  48743. // same request ID was received, and if so, will ignore the second
  48744. // request. This prevents clients from accidentally creating duplicate
  48745. // commitments.
  48746. //
  48747. // The request ID must be a valid UUID with the exception that zero UUID
  48748. // is not supported (00000000-0000-0000-0000-000000000000).
  48749. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  48750. c.urlParams_.Set("requestId", requestId)
  48751. return c
  48752. }
  48753. // Fields allows partial responses to be retrieved. See
  48754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48755. // for more information.
  48756. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  48757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48758. return c
  48759. }
  48760. // Context sets the context to be used in this call's Do method. Any
  48761. // pending HTTP request will be aborted if the provided context is
  48762. // canceled.
  48763. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  48764. c.ctx_ = ctx
  48765. return c
  48766. }
  48767. // Header returns an http.Header that can be modified by the caller to
  48768. // add HTTP headers to the request.
  48769. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  48770. if c.header_ == nil {
  48771. c.header_ = make(http.Header)
  48772. }
  48773. return c.header_
  48774. }
  48775. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  48776. reqHeaders := make(http.Header)
  48777. for k, v := range c.header_ {
  48778. reqHeaders[k] = v
  48779. }
  48780. reqHeaders.Set("User-Agent", c.s.userAgent())
  48781. var body io.Reader = nil
  48782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  48783. if err != nil {
  48784. return nil, err
  48785. }
  48786. reqHeaders.Set("Content-Type", "application/json")
  48787. c.urlParams_.Set("alt", alt)
  48788. c.urlParams_.Set("prettyPrint", "false")
  48789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  48790. urls += "?" + c.urlParams_.Encode()
  48791. req, err := http.NewRequest("POST", urls, body)
  48792. if err != nil {
  48793. return nil, err
  48794. }
  48795. req.Header = reqHeaders
  48796. googleapi.Expand(req.URL, map[string]string{
  48797. "project": c.project,
  48798. "zone": c.zone,
  48799. "instance": c.instance,
  48800. })
  48801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48802. }
  48803. // Do executes the "compute.instances.addAccessConfig" call.
  48804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48805. // status code is an error. Response headers are in either
  48806. // *Operation.ServerResponse.Header or (if a response was returned at
  48807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48808. // to check whether the returned error was because
  48809. // http.StatusNotModified was returned.
  48810. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48811. gensupport.SetOptions(c.urlParams_, opts...)
  48812. res, err := c.doRequest("json")
  48813. if res != nil && res.StatusCode == http.StatusNotModified {
  48814. if res.Body != nil {
  48815. res.Body.Close()
  48816. }
  48817. return nil, &googleapi.Error{
  48818. Code: res.StatusCode,
  48819. Header: res.Header,
  48820. }
  48821. }
  48822. if err != nil {
  48823. return nil, err
  48824. }
  48825. defer googleapi.CloseBody(res)
  48826. if err := googleapi.CheckResponse(res); err != nil {
  48827. return nil, err
  48828. }
  48829. ret := &Operation{
  48830. ServerResponse: googleapi.ServerResponse{
  48831. Header: res.Header,
  48832. HTTPStatusCode: res.StatusCode,
  48833. },
  48834. }
  48835. target := &ret
  48836. if err := gensupport.DecodeResponse(target, res); err != nil {
  48837. return nil, err
  48838. }
  48839. return ret, nil
  48840. // {
  48841. // "description": "Adds an access config to an instance's network interface.",
  48842. // "httpMethod": "POST",
  48843. // "id": "compute.instances.addAccessConfig",
  48844. // "parameterOrder": [
  48845. // "project",
  48846. // "zone",
  48847. // "instance",
  48848. // "networkInterface"
  48849. // ],
  48850. // "parameters": {
  48851. // "instance": {
  48852. // "description": "The instance name for this request.",
  48853. // "location": "path",
  48854. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48855. // "required": true,
  48856. // "type": "string"
  48857. // },
  48858. // "networkInterface": {
  48859. // "description": "The name of the network interface to add to this instance.",
  48860. // "location": "query",
  48861. // "required": true,
  48862. // "type": "string"
  48863. // },
  48864. // "project": {
  48865. // "description": "Project ID for this request.",
  48866. // "location": "path",
  48867. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48868. // "required": true,
  48869. // "type": "string"
  48870. // },
  48871. // "requestId": {
  48872. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48873. // "location": "query",
  48874. // "type": "string"
  48875. // },
  48876. // "zone": {
  48877. // "description": "The name of the zone for this request.",
  48878. // "location": "path",
  48879. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48880. // "required": true,
  48881. // "type": "string"
  48882. // }
  48883. // },
  48884. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  48885. // "request": {
  48886. // "$ref": "AccessConfig"
  48887. // },
  48888. // "response": {
  48889. // "$ref": "Operation"
  48890. // },
  48891. // "scopes": [
  48892. // "https://www.googleapis.com/auth/cloud-platform",
  48893. // "https://www.googleapis.com/auth/compute"
  48894. // ]
  48895. // }
  48896. }
  48897. // method id "compute.instances.aggregatedList":
  48898. type InstancesAggregatedListCall struct {
  48899. s *Service
  48900. project string
  48901. urlParams_ gensupport.URLParams
  48902. ifNoneMatch_ string
  48903. ctx_ context.Context
  48904. header_ http.Header
  48905. }
  48906. // AggregatedList: Retrieves aggregated list of all of the instances in
  48907. // your project across all regions and zones.
  48908. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  48909. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  48910. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48911. c.project = project
  48912. return c
  48913. }
  48914. // Filter sets the optional parameter "filter": A filter expression that
  48915. // filters resources listed in the response. The expression must specify
  48916. // the field name, a comparison operator, and the value that you want to
  48917. // use for filtering. The value must be a string, a number, or a
  48918. // boolean. The comparison operator must be either =, !=, >, or <.
  48919. //
  48920. // For example, if you are filtering Compute Engine instances, you can
  48921. // exclude instances named example-instance by specifying name !=
  48922. // example-instance.
  48923. //
  48924. // You can also filter nested fields. For example, you could specify
  48925. // scheduling.automaticRestart = false to include instances only if they
  48926. // are not scheduled for automatic restarts. You can use filtering on
  48927. // nested fields to filter based on resource labels.
  48928. //
  48929. // To filter on multiple expressions, provide each separate expression
  48930. // within parentheses. For example, (scheduling.automaticRestart = true)
  48931. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48932. // AND expression. However, you can include AND and OR expressions
  48933. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48934. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48935. // true).
  48936. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  48937. c.urlParams_.Set("filter", filter)
  48938. return c
  48939. }
  48940. // MaxResults sets the optional parameter "maxResults": The maximum
  48941. // number of results per page that should be returned. If the number of
  48942. // available results is larger than maxResults, Compute Engine returns a
  48943. // nextPageToken that can be used to get the next page of results in
  48944. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48945. // (Default: 500)
  48946. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  48947. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48948. return c
  48949. }
  48950. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48951. // a certain order. By default, results are returned in alphanumerical
  48952. // order based on the resource name.
  48953. //
  48954. // You can also sort results in descending order based on the creation
  48955. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48956. // based on the creationTimestamp field in reverse chronological order
  48957. // (newest result first). Use this to sort resources like operations so
  48958. // that the newest operation is returned first.
  48959. //
  48960. // Currently, only sorting by name or creationTimestamp desc is
  48961. // supported.
  48962. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  48963. c.urlParams_.Set("orderBy", orderBy)
  48964. return c
  48965. }
  48966. // PageToken sets the optional parameter "pageToken": Specifies a page
  48967. // token to use. Set pageToken to the nextPageToken returned by a
  48968. // previous list request to get the next page of results.
  48969. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  48970. c.urlParams_.Set("pageToken", pageToken)
  48971. return c
  48972. }
  48973. // Fields allows partial responses to be retrieved. See
  48974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48975. // for more information.
  48976. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  48977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48978. return c
  48979. }
  48980. // IfNoneMatch sets the optional parameter which makes the operation
  48981. // fail if the object's ETag matches the given value. This is useful for
  48982. // getting updates only after the object has changed since the last
  48983. // request. Use googleapi.IsNotModified to check whether the response
  48984. // error from Do is the result of In-None-Match.
  48985. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  48986. c.ifNoneMatch_ = entityTag
  48987. return c
  48988. }
  48989. // Context sets the context to be used in this call's Do method. Any
  48990. // pending HTTP request will be aborted if the provided context is
  48991. // canceled.
  48992. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  48993. c.ctx_ = ctx
  48994. return c
  48995. }
  48996. // Header returns an http.Header that can be modified by the caller to
  48997. // add HTTP headers to the request.
  48998. func (c *InstancesAggregatedListCall) Header() http.Header {
  48999. if c.header_ == nil {
  49000. c.header_ = make(http.Header)
  49001. }
  49002. return c.header_
  49003. }
  49004. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  49005. reqHeaders := make(http.Header)
  49006. for k, v := range c.header_ {
  49007. reqHeaders[k] = v
  49008. }
  49009. reqHeaders.Set("User-Agent", c.s.userAgent())
  49010. if c.ifNoneMatch_ != "" {
  49011. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49012. }
  49013. var body io.Reader = nil
  49014. c.urlParams_.Set("alt", alt)
  49015. c.urlParams_.Set("prettyPrint", "false")
  49016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  49017. urls += "?" + c.urlParams_.Encode()
  49018. req, err := http.NewRequest("GET", urls, body)
  49019. if err != nil {
  49020. return nil, err
  49021. }
  49022. req.Header = reqHeaders
  49023. googleapi.Expand(req.URL, map[string]string{
  49024. "project": c.project,
  49025. })
  49026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49027. }
  49028. // Do executes the "compute.instances.aggregatedList" call.
  49029. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  49030. // non-2xx status code is an error. Response headers are in either
  49031. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  49032. // returned at all) in error.(*googleapi.Error).Header. Use
  49033. // googleapi.IsNotModified to check whether the returned error was
  49034. // because http.StatusNotModified was returned.
  49035. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  49036. gensupport.SetOptions(c.urlParams_, opts...)
  49037. res, err := c.doRequest("json")
  49038. if res != nil && res.StatusCode == http.StatusNotModified {
  49039. if res.Body != nil {
  49040. res.Body.Close()
  49041. }
  49042. return nil, &googleapi.Error{
  49043. Code: res.StatusCode,
  49044. Header: res.Header,
  49045. }
  49046. }
  49047. if err != nil {
  49048. return nil, err
  49049. }
  49050. defer googleapi.CloseBody(res)
  49051. if err := googleapi.CheckResponse(res); err != nil {
  49052. return nil, err
  49053. }
  49054. ret := &InstanceAggregatedList{
  49055. ServerResponse: googleapi.ServerResponse{
  49056. Header: res.Header,
  49057. HTTPStatusCode: res.StatusCode,
  49058. },
  49059. }
  49060. target := &ret
  49061. if err := gensupport.DecodeResponse(target, res); err != nil {
  49062. return nil, err
  49063. }
  49064. return ret, nil
  49065. // {
  49066. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  49067. // "httpMethod": "GET",
  49068. // "id": "compute.instances.aggregatedList",
  49069. // "parameterOrder": [
  49070. // "project"
  49071. // ],
  49072. // "parameters": {
  49073. // "filter": {
  49074. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49075. // "location": "query",
  49076. // "type": "string"
  49077. // },
  49078. // "maxResults": {
  49079. // "default": "500",
  49080. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49081. // "format": "uint32",
  49082. // "location": "query",
  49083. // "minimum": "0",
  49084. // "type": "integer"
  49085. // },
  49086. // "orderBy": {
  49087. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49088. // "location": "query",
  49089. // "type": "string"
  49090. // },
  49091. // "pageToken": {
  49092. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49093. // "location": "query",
  49094. // "type": "string"
  49095. // },
  49096. // "project": {
  49097. // "description": "Project ID for this request.",
  49098. // "location": "path",
  49099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49100. // "required": true,
  49101. // "type": "string"
  49102. // }
  49103. // },
  49104. // "path": "{project}/aggregated/instances",
  49105. // "response": {
  49106. // "$ref": "InstanceAggregatedList"
  49107. // },
  49108. // "scopes": [
  49109. // "https://www.googleapis.com/auth/cloud-platform",
  49110. // "https://www.googleapis.com/auth/compute",
  49111. // "https://www.googleapis.com/auth/compute.readonly"
  49112. // ]
  49113. // }
  49114. }
  49115. // Pages invokes f for each page of results.
  49116. // A non-nil error returned from f will halt the iteration.
  49117. // The provided context supersedes any context provided to the Context method.
  49118. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  49119. c.ctx_ = ctx
  49120. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49121. for {
  49122. x, err := c.Do()
  49123. if err != nil {
  49124. return err
  49125. }
  49126. if err := f(x); err != nil {
  49127. return err
  49128. }
  49129. if x.NextPageToken == "" {
  49130. return nil
  49131. }
  49132. c.PageToken(x.NextPageToken)
  49133. }
  49134. }
  49135. // method id "compute.instances.attachDisk":
  49136. type InstancesAttachDiskCall struct {
  49137. s *Service
  49138. project string
  49139. zone string
  49140. instance string
  49141. attacheddisk *AttachedDisk
  49142. urlParams_ gensupport.URLParams
  49143. ctx_ context.Context
  49144. header_ http.Header
  49145. }
  49146. // AttachDisk: Attaches an existing Disk resource to an instance. You
  49147. // must first create the disk before you can attach it. It is not
  49148. // possible to create and attach a disk at the same time. For more
  49149. // information, read Adding a persistent disk to your instance.
  49150. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  49151. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  49152. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49153. c.project = project
  49154. c.zone = zone
  49155. c.instance = instance
  49156. c.attacheddisk = attacheddisk
  49157. return c
  49158. }
  49159. // ForceAttach sets the optional parameter "forceAttach": Whether to
  49160. // force attach the disk even if it's currently attached to another
  49161. // instance. This is only available for regional disks.
  49162. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  49163. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  49164. return c
  49165. }
  49166. // RequestId sets the optional parameter "requestId": An optional
  49167. // request ID to identify requests. Specify a unique request ID so that
  49168. // if you must retry your request, the server will know to ignore the
  49169. // request if it has already been completed.
  49170. //
  49171. // For example, consider a situation where you make an initial request
  49172. // and the request times out. If you make the request again with the
  49173. // same request ID, the server can check if original operation with the
  49174. // same request ID was received, and if so, will ignore the second
  49175. // request. This prevents clients from accidentally creating duplicate
  49176. // commitments.
  49177. //
  49178. // The request ID must be a valid UUID with the exception that zero UUID
  49179. // is not supported (00000000-0000-0000-0000-000000000000).
  49180. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  49181. c.urlParams_.Set("requestId", requestId)
  49182. return c
  49183. }
  49184. // Fields allows partial responses to be retrieved. See
  49185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49186. // for more information.
  49187. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  49188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49189. return c
  49190. }
  49191. // Context sets the context to be used in this call's Do method. Any
  49192. // pending HTTP request will be aborted if the provided context is
  49193. // canceled.
  49194. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  49195. c.ctx_ = ctx
  49196. return c
  49197. }
  49198. // Header returns an http.Header that can be modified by the caller to
  49199. // add HTTP headers to the request.
  49200. func (c *InstancesAttachDiskCall) Header() http.Header {
  49201. if c.header_ == nil {
  49202. c.header_ = make(http.Header)
  49203. }
  49204. return c.header_
  49205. }
  49206. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  49207. reqHeaders := make(http.Header)
  49208. for k, v := range c.header_ {
  49209. reqHeaders[k] = v
  49210. }
  49211. reqHeaders.Set("User-Agent", c.s.userAgent())
  49212. var body io.Reader = nil
  49213. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  49214. if err != nil {
  49215. return nil, err
  49216. }
  49217. reqHeaders.Set("Content-Type", "application/json")
  49218. c.urlParams_.Set("alt", alt)
  49219. c.urlParams_.Set("prettyPrint", "false")
  49220. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  49221. urls += "?" + c.urlParams_.Encode()
  49222. req, err := http.NewRequest("POST", urls, body)
  49223. if err != nil {
  49224. return nil, err
  49225. }
  49226. req.Header = reqHeaders
  49227. googleapi.Expand(req.URL, map[string]string{
  49228. "project": c.project,
  49229. "zone": c.zone,
  49230. "instance": c.instance,
  49231. })
  49232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49233. }
  49234. // Do executes the "compute.instances.attachDisk" call.
  49235. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49236. // status code is an error. Response headers are in either
  49237. // *Operation.ServerResponse.Header or (if a response was returned at
  49238. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49239. // to check whether the returned error was because
  49240. // http.StatusNotModified was returned.
  49241. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49242. gensupport.SetOptions(c.urlParams_, opts...)
  49243. res, err := c.doRequest("json")
  49244. if res != nil && res.StatusCode == http.StatusNotModified {
  49245. if res.Body != nil {
  49246. res.Body.Close()
  49247. }
  49248. return nil, &googleapi.Error{
  49249. Code: res.StatusCode,
  49250. Header: res.Header,
  49251. }
  49252. }
  49253. if err != nil {
  49254. return nil, err
  49255. }
  49256. defer googleapi.CloseBody(res)
  49257. if err := googleapi.CheckResponse(res); err != nil {
  49258. return nil, err
  49259. }
  49260. ret := &Operation{
  49261. ServerResponse: googleapi.ServerResponse{
  49262. Header: res.Header,
  49263. HTTPStatusCode: res.StatusCode,
  49264. },
  49265. }
  49266. target := &ret
  49267. if err := gensupport.DecodeResponse(target, res); err != nil {
  49268. return nil, err
  49269. }
  49270. return ret, nil
  49271. // {
  49272. // "description": "Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.",
  49273. // "httpMethod": "POST",
  49274. // "id": "compute.instances.attachDisk",
  49275. // "parameterOrder": [
  49276. // "project",
  49277. // "zone",
  49278. // "instance"
  49279. // ],
  49280. // "parameters": {
  49281. // "forceAttach": {
  49282. // "description": "Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.",
  49283. // "location": "query",
  49284. // "type": "boolean"
  49285. // },
  49286. // "instance": {
  49287. // "description": "The instance name for this request.",
  49288. // "location": "path",
  49289. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49290. // "required": true,
  49291. // "type": "string"
  49292. // },
  49293. // "project": {
  49294. // "description": "Project ID for this request.",
  49295. // "location": "path",
  49296. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49297. // "required": true,
  49298. // "type": "string"
  49299. // },
  49300. // "requestId": {
  49301. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49302. // "location": "query",
  49303. // "type": "string"
  49304. // },
  49305. // "zone": {
  49306. // "description": "The name of the zone for this request.",
  49307. // "location": "path",
  49308. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49309. // "required": true,
  49310. // "type": "string"
  49311. // }
  49312. // },
  49313. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  49314. // "request": {
  49315. // "$ref": "AttachedDisk"
  49316. // },
  49317. // "response": {
  49318. // "$ref": "Operation"
  49319. // },
  49320. // "scopes": [
  49321. // "https://www.googleapis.com/auth/cloud-platform",
  49322. // "https://www.googleapis.com/auth/compute"
  49323. // ]
  49324. // }
  49325. }
  49326. // method id "compute.instances.delete":
  49327. type InstancesDeleteCall struct {
  49328. s *Service
  49329. project string
  49330. zone string
  49331. instance string
  49332. urlParams_ gensupport.URLParams
  49333. ctx_ context.Context
  49334. header_ http.Header
  49335. }
  49336. // Delete: Deletes the specified Instance resource. For more
  49337. // information, see Stopping or Deleting an Instance.
  49338. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  49339. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  49340. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49341. c.project = project
  49342. c.zone = zone
  49343. c.instance = instance
  49344. return c
  49345. }
  49346. // RequestId sets the optional parameter "requestId": An optional
  49347. // request ID to identify requests. Specify a unique request ID so that
  49348. // if you must retry your request, the server will know to ignore the
  49349. // request if it has already been completed.
  49350. //
  49351. // For example, consider a situation where you make an initial request
  49352. // and the request times out. If you make the request again with the
  49353. // same request ID, the server can check if original operation with the
  49354. // same request ID was received, and if so, will ignore the second
  49355. // request. This prevents clients from accidentally creating duplicate
  49356. // commitments.
  49357. //
  49358. // The request ID must be a valid UUID with the exception that zero UUID
  49359. // is not supported (00000000-0000-0000-0000-000000000000).
  49360. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  49361. c.urlParams_.Set("requestId", requestId)
  49362. return c
  49363. }
  49364. // Fields allows partial responses to be retrieved. See
  49365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49366. // for more information.
  49367. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  49368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49369. return c
  49370. }
  49371. // Context sets the context to be used in this call's Do method. Any
  49372. // pending HTTP request will be aborted if the provided context is
  49373. // canceled.
  49374. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  49375. c.ctx_ = ctx
  49376. return c
  49377. }
  49378. // Header returns an http.Header that can be modified by the caller to
  49379. // add HTTP headers to the request.
  49380. func (c *InstancesDeleteCall) Header() http.Header {
  49381. if c.header_ == nil {
  49382. c.header_ = make(http.Header)
  49383. }
  49384. return c.header_
  49385. }
  49386. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49387. reqHeaders := make(http.Header)
  49388. for k, v := range c.header_ {
  49389. reqHeaders[k] = v
  49390. }
  49391. reqHeaders.Set("User-Agent", c.s.userAgent())
  49392. var body io.Reader = nil
  49393. c.urlParams_.Set("alt", alt)
  49394. c.urlParams_.Set("prettyPrint", "false")
  49395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  49396. urls += "?" + c.urlParams_.Encode()
  49397. req, err := http.NewRequest("DELETE", urls, body)
  49398. if err != nil {
  49399. return nil, err
  49400. }
  49401. req.Header = reqHeaders
  49402. googleapi.Expand(req.URL, map[string]string{
  49403. "project": c.project,
  49404. "zone": c.zone,
  49405. "instance": c.instance,
  49406. })
  49407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49408. }
  49409. // Do executes the "compute.instances.delete" call.
  49410. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49411. // status code is an error. Response headers are in either
  49412. // *Operation.ServerResponse.Header or (if a response was returned at
  49413. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49414. // to check whether the returned error was because
  49415. // http.StatusNotModified was returned.
  49416. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49417. gensupport.SetOptions(c.urlParams_, opts...)
  49418. res, err := c.doRequest("json")
  49419. if res != nil && res.StatusCode == http.StatusNotModified {
  49420. if res.Body != nil {
  49421. res.Body.Close()
  49422. }
  49423. return nil, &googleapi.Error{
  49424. Code: res.StatusCode,
  49425. Header: res.Header,
  49426. }
  49427. }
  49428. if err != nil {
  49429. return nil, err
  49430. }
  49431. defer googleapi.CloseBody(res)
  49432. if err := googleapi.CheckResponse(res); err != nil {
  49433. return nil, err
  49434. }
  49435. ret := &Operation{
  49436. ServerResponse: googleapi.ServerResponse{
  49437. Header: res.Header,
  49438. HTTPStatusCode: res.StatusCode,
  49439. },
  49440. }
  49441. target := &ret
  49442. if err := gensupport.DecodeResponse(target, res); err != nil {
  49443. return nil, err
  49444. }
  49445. return ret, nil
  49446. // {
  49447. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  49448. // "httpMethod": "DELETE",
  49449. // "id": "compute.instances.delete",
  49450. // "parameterOrder": [
  49451. // "project",
  49452. // "zone",
  49453. // "instance"
  49454. // ],
  49455. // "parameters": {
  49456. // "instance": {
  49457. // "description": "Name of the instance resource to delete.",
  49458. // "location": "path",
  49459. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49460. // "required": true,
  49461. // "type": "string"
  49462. // },
  49463. // "project": {
  49464. // "description": "Project ID for this request.",
  49465. // "location": "path",
  49466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49467. // "required": true,
  49468. // "type": "string"
  49469. // },
  49470. // "requestId": {
  49471. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49472. // "location": "query",
  49473. // "type": "string"
  49474. // },
  49475. // "zone": {
  49476. // "description": "The name of the zone for this request.",
  49477. // "location": "path",
  49478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49479. // "required": true,
  49480. // "type": "string"
  49481. // }
  49482. // },
  49483. // "path": "{project}/zones/{zone}/instances/{instance}",
  49484. // "response": {
  49485. // "$ref": "Operation"
  49486. // },
  49487. // "scopes": [
  49488. // "https://www.googleapis.com/auth/cloud-platform",
  49489. // "https://www.googleapis.com/auth/compute"
  49490. // ]
  49491. // }
  49492. }
  49493. // method id "compute.instances.deleteAccessConfig":
  49494. type InstancesDeleteAccessConfigCall struct {
  49495. s *Service
  49496. project string
  49497. zone string
  49498. instance string
  49499. urlParams_ gensupport.URLParams
  49500. ctx_ context.Context
  49501. header_ http.Header
  49502. }
  49503. // DeleteAccessConfig: Deletes an access config from an instance's
  49504. // network interface.
  49505. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  49506. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  49507. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49508. c.project = project
  49509. c.zone = zone
  49510. c.instance = instance
  49511. c.urlParams_.Set("accessConfig", accessConfig)
  49512. c.urlParams_.Set("networkInterface", networkInterface)
  49513. return c
  49514. }
  49515. // RequestId sets the optional parameter "requestId": An optional
  49516. // request ID to identify requests. Specify a unique request ID so that
  49517. // if you must retry your request, the server will know to ignore the
  49518. // request if it has already been completed.
  49519. //
  49520. // For example, consider a situation where you make an initial request
  49521. // and the request times out. If you make the request again with the
  49522. // same request ID, the server can check if original operation with the
  49523. // same request ID was received, and if so, will ignore the second
  49524. // request. This prevents clients from accidentally creating duplicate
  49525. // commitments.
  49526. //
  49527. // The request ID must be a valid UUID with the exception that zero UUID
  49528. // is not supported (00000000-0000-0000-0000-000000000000).
  49529. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  49530. c.urlParams_.Set("requestId", requestId)
  49531. return c
  49532. }
  49533. // Fields allows partial responses to be retrieved. See
  49534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49535. // for more information.
  49536. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  49537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49538. return c
  49539. }
  49540. // Context sets the context to be used in this call's Do method. Any
  49541. // pending HTTP request will be aborted if the provided context is
  49542. // canceled.
  49543. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  49544. c.ctx_ = ctx
  49545. return c
  49546. }
  49547. // Header returns an http.Header that can be modified by the caller to
  49548. // add HTTP headers to the request.
  49549. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  49550. if c.header_ == nil {
  49551. c.header_ = make(http.Header)
  49552. }
  49553. return c.header_
  49554. }
  49555. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  49556. reqHeaders := make(http.Header)
  49557. for k, v := range c.header_ {
  49558. reqHeaders[k] = v
  49559. }
  49560. reqHeaders.Set("User-Agent", c.s.userAgent())
  49561. var body io.Reader = nil
  49562. c.urlParams_.Set("alt", alt)
  49563. c.urlParams_.Set("prettyPrint", "false")
  49564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  49565. urls += "?" + c.urlParams_.Encode()
  49566. req, err := http.NewRequest("POST", urls, body)
  49567. if err != nil {
  49568. return nil, err
  49569. }
  49570. req.Header = reqHeaders
  49571. googleapi.Expand(req.URL, map[string]string{
  49572. "project": c.project,
  49573. "zone": c.zone,
  49574. "instance": c.instance,
  49575. })
  49576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49577. }
  49578. // Do executes the "compute.instances.deleteAccessConfig" call.
  49579. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49580. // status code is an error. Response headers are in either
  49581. // *Operation.ServerResponse.Header or (if a response was returned at
  49582. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49583. // to check whether the returned error was because
  49584. // http.StatusNotModified was returned.
  49585. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49586. gensupport.SetOptions(c.urlParams_, opts...)
  49587. res, err := c.doRequest("json")
  49588. if res != nil && res.StatusCode == http.StatusNotModified {
  49589. if res.Body != nil {
  49590. res.Body.Close()
  49591. }
  49592. return nil, &googleapi.Error{
  49593. Code: res.StatusCode,
  49594. Header: res.Header,
  49595. }
  49596. }
  49597. if err != nil {
  49598. return nil, err
  49599. }
  49600. defer googleapi.CloseBody(res)
  49601. if err := googleapi.CheckResponse(res); err != nil {
  49602. return nil, err
  49603. }
  49604. ret := &Operation{
  49605. ServerResponse: googleapi.ServerResponse{
  49606. Header: res.Header,
  49607. HTTPStatusCode: res.StatusCode,
  49608. },
  49609. }
  49610. target := &ret
  49611. if err := gensupport.DecodeResponse(target, res); err != nil {
  49612. return nil, err
  49613. }
  49614. return ret, nil
  49615. // {
  49616. // "description": "Deletes an access config from an instance's network interface.",
  49617. // "httpMethod": "POST",
  49618. // "id": "compute.instances.deleteAccessConfig",
  49619. // "parameterOrder": [
  49620. // "project",
  49621. // "zone",
  49622. // "instance",
  49623. // "accessConfig",
  49624. // "networkInterface"
  49625. // ],
  49626. // "parameters": {
  49627. // "accessConfig": {
  49628. // "description": "The name of the access config to delete.",
  49629. // "location": "query",
  49630. // "required": true,
  49631. // "type": "string"
  49632. // },
  49633. // "instance": {
  49634. // "description": "The instance name for this request.",
  49635. // "location": "path",
  49636. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49637. // "required": true,
  49638. // "type": "string"
  49639. // },
  49640. // "networkInterface": {
  49641. // "description": "The name of the network interface.",
  49642. // "location": "query",
  49643. // "required": true,
  49644. // "type": "string"
  49645. // },
  49646. // "project": {
  49647. // "description": "Project ID for this request.",
  49648. // "location": "path",
  49649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49650. // "required": true,
  49651. // "type": "string"
  49652. // },
  49653. // "requestId": {
  49654. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49655. // "location": "query",
  49656. // "type": "string"
  49657. // },
  49658. // "zone": {
  49659. // "description": "The name of the zone for this request.",
  49660. // "location": "path",
  49661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49662. // "required": true,
  49663. // "type": "string"
  49664. // }
  49665. // },
  49666. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  49667. // "response": {
  49668. // "$ref": "Operation"
  49669. // },
  49670. // "scopes": [
  49671. // "https://www.googleapis.com/auth/cloud-platform",
  49672. // "https://www.googleapis.com/auth/compute"
  49673. // ]
  49674. // }
  49675. }
  49676. // method id "compute.instances.detachDisk":
  49677. type InstancesDetachDiskCall struct {
  49678. s *Service
  49679. project string
  49680. zone string
  49681. instance string
  49682. urlParams_ gensupport.URLParams
  49683. ctx_ context.Context
  49684. header_ http.Header
  49685. }
  49686. // DetachDisk: Detaches a disk from an instance.
  49687. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  49688. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  49689. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49690. c.project = project
  49691. c.zone = zone
  49692. c.instance = instance
  49693. c.urlParams_.Set("deviceName", deviceName)
  49694. return c
  49695. }
  49696. // RequestId sets the optional parameter "requestId": An optional
  49697. // request ID to identify requests. Specify a unique request ID so that
  49698. // if you must retry your request, the server will know to ignore the
  49699. // request if it has already been completed.
  49700. //
  49701. // For example, consider a situation where you make an initial request
  49702. // and the request times out. If you make the request again with the
  49703. // same request ID, the server can check if original operation with the
  49704. // same request ID was received, and if so, will ignore the second
  49705. // request. This prevents clients from accidentally creating duplicate
  49706. // commitments.
  49707. //
  49708. // The request ID must be a valid UUID with the exception that zero UUID
  49709. // is not supported (00000000-0000-0000-0000-000000000000).
  49710. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  49711. c.urlParams_.Set("requestId", requestId)
  49712. return c
  49713. }
  49714. // Fields allows partial responses to be retrieved. See
  49715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49716. // for more information.
  49717. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  49718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49719. return c
  49720. }
  49721. // Context sets the context to be used in this call's Do method. Any
  49722. // pending HTTP request will be aborted if the provided context is
  49723. // canceled.
  49724. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  49725. c.ctx_ = ctx
  49726. return c
  49727. }
  49728. // Header returns an http.Header that can be modified by the caller to
  49729. // add HTTP headers to the request.
  49730. func (c *InstancesDetachDiskCall) Header() http.Header {
  49731. if c.header_ == nil {
  49732. c.header_ = make(http.Header)
  49733. }
  49734. return c.header_
  49735. }
  49736. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  49737. reqHeaders := make(http.Header)
  49738. for k, v := range c.header_ {
  49739. reqHeaders[k] = v
  49740. }
  49741. reqHeaders.Set("User-Agent", c.s.userAgent())
  49742. var body io.Reader = nil
  49743. c.urlParams_.Set("alt", alt)
  49744. c.urlParams_.Set("prettyPrint", "false")
  49745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  49746. urls += "?" + c.urlParams_.Encode()
  49747. req, err := http.NewRequest("POST", urls, body)
  49748. if err != nil {
  49749. return nil, err
  49750. }
  49751. req.Header = reqHeaders
  49752. googleapi.Expand(req.URL, map[string]string{
  49753. "project": c.project,
  49754. "zone": c.zone,
  49755. "instance": c.instance,
  49756. })
  49757. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49758. }
  49759. // Do executes the "compute.instances.detachDisk" call.
  49760. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49761. // status code is an error. Response headers are in either
  49762. // *Operation.ServerResponse.Header or (if a response was returned at
  49763. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49764. // to check whether the returned error was because
  49765. // http.StatusNotModified was returned.
  49766. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49767. gensupport.SetOptions(c.urlParams_, opts...)
  49768. res, err := c.doRequest("json")
  49769. if res != nil && res.StatusCode == http.StatusNotModified {
  49770. if res.Body != nil {
  49771. res.Body.Close()
  49772. }
  49773. return nil, &googleapi.Error{
  49774. Code: res.StatusCode,
  49775. Header: res.Header,
  49776. }
  49777. }
  49778. if err != nil {
  49779. return nil, err
  49780. }
  49781. defer googleapi.CloseBody(res)
  49782. if err := googleapi.CheckResponse(res); err != nil {
  49783. return nil, err
  49784. }
  49785. ret := &Operation{
  49786. ServerResponse: googleapi.ServerResponse{
  49787. Header: res.Header,
  49788. HTTPStatusCode: res.StatusCode,
  49789. },
  49790. }
  49791. target := &ret
  49792. if err := gensupport.DecodeResponse(target, res); err != nil {
  49793. return nil, err
  49794. }
  49795. return ret, nil
  49796. // {
  49797. // "description": "Detaches a disk from an instance.",
  49798. // "httpMethod": "POST",
  49799. // "id": "compute.instances.detachDisk",
  49800. // "parameterOrder": [
  49801. // "project",
  49802. // "zone",
  49803. // "instance",
  49804. // "deviceName"
  49805. // ],
  49806. // "parameters": {
  49807. // "deviceName": {
  49808. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  49809. // "location": "query",
  49810. // "required": true,
  49811. // "type": "string"
  49812. // },
  49813. // "instance": {
  49814. // "description": "Instance name for this request.",
  49815. // "location": "path",
  49816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49817. // "required": true,
  49818. // "type": "string"
  49819. // },
  49820. // "project": {
  49821. // "description": "Project ID for this request.",
  49822. // "location": "path",
  49823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49824. // "required": true,
  49825. // "type": "string"
  49826. // },
  49827. // "requestId": {
  49828. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49829. // "location": "query",
  49830. // "type": "string"
  49831. // },
  49832. // "zone": {
  49833. // "description": "The name of the zone for this request.",
  49834. // "location": "path",
  49835. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49836. // "required": true,
  49837. // "type": "string"
  49838. // }
  49839. // },
  49840. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  49841. // "response": {
  49842. // "$ref": "Operation"
  49843. // },
  49844. // "scopes": [
  49845. // "https://www.googleapis.com/auth/cloud-platform",
  49846. // "https://www.googleapis.com/auth/compute"
  49847. // ]
  49848. // }
  49849. }
  49850. // method id "compute.instances.get":
  49851. type InstancesGetCall struct {
  49852. s *Service
  49853. project string
  49854. zone string
  49855. instance string
  49856. urlParams_ gensupport.URLParams
  49857. ifNoneMatch_ string
  49858. ctx_ context.Context
  49859. header_ http.Header
  49860. }
  49861. // Get: Returns the specified Instance resource. Gets a list of
  49862. // available instances by making a list() request.
  49863. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  49864. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  49865. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49866. c.project = project
  49867. c.zone = zone
  49868. c.instance = instance
  49869. return c
  49870. }
  49871. // Fields allows partial responses to be retrieved. See
  49872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49873. // for more information.
  49874. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  49875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49876. return c
  49877. }
  49878. // IfNoneMatch sets the optional parameter which makes the operation
  49879. // fail if the object's ETag matches the given value. This is useful for
  49880. // getting updates only after the object has changed since the last
  49881. // request. Use googleapi.IsNotModified to check whether the response
  49882. // error from Do is the result of In-None-Match.
  49883. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  49884. c.ifNoneMatch_ = entityTag
  49885. return c
  49886. }
  49887. // Context sets the context to be used in this call's Do method. Any
  49888. // pending HTTP request will be aborted if the provided context is
  49889. // canceled.
  49890. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  49891. c.ctx_ = ctx
  49892. return c
  49893. }
  49894. // Header returns an http.Header that can be modified by the caller to
  49895. // add HTTP headers to the request.
  49896. func (c *InstancesGetCall) Header() http.Header {
  49897. if c.header_ == nil {
  49898. c.header_ = make(http.Header)
  49899. }
  49900. return c.header_
  49901. }
  49902. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  49903. reqHeaders := make(http.Header)
  49904. for k, v := range c.header_ {
  49905. reqHeaders[k] = v
  49906. }
  49907. reqHeaders.Set("User-Agent", c.s.userAgent())
  49908. if c.ifNoneMatch_ != "" {
  49909. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49910. }
  49911. var body io.Reader = nil
  49912. c.urlParams_.Set("alt", alt)
  49913. c.urlParams_.Set("prettyPrint", "false")
  49914. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  49915. urls += "?" + c.urlParams_.Encode()
  49916. req, err := http.NewRequest("GET", urls, body)
  49917. if err != nil {
  49918. return nil, err
  49919. }
  49920. req.Header = reqHeaders
  49921. googleapi.Expand(req.URL, map[string]string{
  49922. "project": c.project,
  49923. "zone": c.zone,
  49924. "instance": c.instance,
  49925. })
  49926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49927. }
  49928. // Do executes the "compute.instances.get" call.
  49929. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  49930. // code is an error. Response headers are in either
  49931. // *Instance.ServerResponse.Header or (if a response was returned at
  49932. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49933. // to check whether the returned error was because
  49934. // http.StatusNotModified was returned.
  49935. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  49936. gensupport.SetOptions(c.urlParams_, opts...)
  49937. res, err := c.doRequest("json")
  49938. if res != nil && res.StatusCode == http.StatusNotModified {
  49939. if res.Body != nil {
  49940. res.Body.Close()
  49941. }
  49942. return nil, &googleapi.Error{
  49943. Code: res.StatusCode,
  49944. Header: res.Header,
  49945. }
  49946. }
  49947. if err != nil {
  49948. return nil, err
  49949. }
  49950. defer googleapi.CloseBody(res)
  49951. if err := googleapi.CheckResponse(res); err != nil {
  49952. return nil, err
  49953. }
  49954. ret := &Instance{
  49955. ServerResponse: googleapi.ServerResponse{
  49956. Header: res.Header,
  49957. HTTPStatusCode: res.StatusCode,
  49958. },
  49959. }
  49960. target := &ret
  49961. if err := gensupport.DecodeResponse(target, res); err != nil {
  49962. return nil, err
  49963. }
  49964. return ret, nil
  49965. // {
  49966. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  49967. // "httpMethod": "GET",
  49968. // "id": "compute.instances.get",
  49969. // "parameterOrder": [
  49970. // "project",
  49971. // "zone",
  49972. // "instance"
  49973. // ],
  49974. // "parameters": {
  49975. // "instance": {
  49976. // "description": "Name of the instance resource to return.",
  49977. // "location": "path",
  49978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49979. // "required": true,
  49980. // "type": "string"
  49981. // },
  49982. // "project": {
  49983. // "description": "Project ID for this request.",
  49984. // "location": "path",
  49985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49986. // "required": true,
  49987. // "type": "string"
  49988. // },
  49989. // "zone": {
  49990. // "description": "The name of the zone for this request.",
  49991. // "location": "path",
  49992. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49993. // "required": true,
  49994. // "type": "string"
  49995. // }
  49996. // },
  49997. // "path": "{project}/zones/{zone}/instances/{instance}",
  49998. // "response": {
  49999. // "$ref": "Instance"
  50000. // },
  50001. // "scopes": [
  50002. // "https://www.googleapis.com/auth/cloud-platform",
  50003. // "https://www.googleapis.com/auth/compute",
  50004. // "https://www.googleapis.com/auth/compute.readonly"
  50005. // ]
  50006. // }
  50007. }
  50008. // method id "compute.instances.getIamPolicy":
  50009. type InstancesGetIamPolicyCall struct {
  50010. s *Service
  50011. project string
  50012. zone string
  50013. resource string
  50014. urlParams_ gensupport.URLParams
  50015. ifNoneMatch_ string
  50016. ctx_ context.Context
  50017. header_ http.Header
  50018. }
  50019. // GetIamPolicy: Gets the access control policy for a resource. May be
  50020. // empty if no such policy or resource exists.
  50021. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  50022. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50023. c.project = project
  50024. c.zone = zone
  50025. c.resource = resource
  50026. return c
  50027. }
  50028. // Fields allows partial responses to be retrieved. See
  50029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50030. // for more information.
  50031. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  50032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50033. return c
  50034. }
  50035. // IfNoneMatch sets the optional parameter which makes the operation
  50036. // fail if the object's ETag matches the given value. This is useful for
  50037. // getting updates only after the object has changed since the last
  50038. // request. Use googleapi.IsNotModified to check whether the response
  50039. // error from Do is the result of In-None-Match.
  50040. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  50041. c.ifNoneMatch_ = entityTag
  50042. return c
  50043. }
  50044. // Context sets the context to be used in this call's Do method. Any
  50045. // pending HTTP request will be aborted if the provided context is
  50046. // canceled.
  50047. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  50048. c.ctx_ = ctx
  50049. return c
  50050. }
  50051. // Header returns an http.Header that can be modified by the caller to
  50052. // add HTTP headers to the request.
  50053. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  50054. if c.header_ == nil {
  50055. c.header_ = make(http.Header)
  50056. }
  50057. return c.header_
  50058. }
  50059. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  50060. reqHeaders := make(http.Header)
  50061. for k, v := range c.header_ {
  50062. reqHeaders[k] = v
  50063. }
  50064. reqHeaders.Set("User-Agent", c.s.userAgent())
  50065. if c.ifNoneMatch_ != "" {
  50066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50067. }
  50068. var body io.Reader = nil
  50069. c.urlParams_.Set("alt", alt)
  50070. c.urlParams_.Set("prettyPrint", "false")
  50071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  50072. urls += "?" + c.urlParams_.Encode()
  50073. req, err := http.NewRequest("GET", urls, body)
  50074. if err != nil {
  50075. return nil, err
  50076. }
  50077. req.Header = reqHeaders
  50078. googleapi.Expand(req.URL, map[string]string{
  50079. "project": c.project,
  50080. "zone": c.zone,
  50081. "resource": c.resource,
  50082. })
  50083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50084. }
  50085. // Do executes the "compute.instances.getIamPolicy" call.
  50086. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  50087. // code is an error. Response headers are in either
  50088. // *Policy.ServerResponse.Header or (if a response was returned at all)
  50089. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  50090. // check whether the returned error was because http.StatusNotModified
  50091. // was returned.
  50092. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  50093. gensupport.SetOptions(c.urlParams_, opts...)
  50094. res, err := c.doRequest("json")
  50095. if res != nil && res.StatusCode == http.StatusNotModified {
  50096. if res.Body != nil {
  50097. res.Body.Close()
  50098. }
  50099. return nil, &googleapi.Error{
  50100. Code: res.StatusCode,
  50101. Header: res.Header,
  50102. }
  50103. }
  50104. if err != nil {
  50105. return nil, err
  50106. }
  50107. defer googleapi.CloseBody(res)
  50108. if err := googleapi.CheckResponse(res); err != nil {
  50109. return nil, err
  50110. }
  50111. ret := &Policy{
  50112. ServerResponse: googleapi.ServerResponse{
  50113. Header: res.Header,
  50114. HTTPStatusCode: res.StatusCode,
  50115. },
  50116. }
  50117. target := &ret
  50118. if err := gensupport.DecodeResponse(target, res); err != nil {
  50119. return nil, err
  50120. }
  50121. return ret, nil
  50122. // {
  50123. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  50124. // "httpMethod": "GET",
  50125. // "id": "compute.instances.getIamPolicy",
  50126. // "parameterOrder": [
  50127. // "project",
  50128. // "zone",
  50129. // "resource"
  50130. // ],
  50131. // "parameters": {
  50132. // "project": {
  50133. // "description": "Project ID for this request.",
  50134. // "location": "path",
  50135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50136. // "required": true,
  50137. // "type": "string"
  50138. // },
  50139. // "resource": {
  50140. // "description": "Name or id of the resource for this request.",
  50141. // "location": "path",
  50142. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50143. // "required": true,
  50144. // "type": "string"
  50145. // },
  50146. // "zone": {
  50147. // "description": "The name of the zone for this request.",
  50148. // "location": "path",
  50149. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50150. // "required": true,
  50151. // "type": "string"
  50152. // }
  50153. // },
  50154. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  50155. // "response": {
  50156. // "$ref": "Policy"
  50157. // },
  50158. // "scopes": [
  50159. // "https://www.googleapis.com/auth/cloud-platform",
  50160. // "https://www.googleapis.com/auth/compute",
  50161. // "https://www.googleapis.com/auth/compute.readonly"
  50162. // ]
  50163. // }
  50164. }
  50165. // method id "compute.instances.getSerialPortOutput":
  50166. type InstancesGetSerialPortOutputCall struct {
  50167. s *Service
  50168. project string
  50169. zone string
  50170. instance string
  50171. urlParams_ gensupport.URLParams
  50172. ifNoneMatch_ string
  50173. ctx_ context.Context
  50174. header_ http.Header
  50175. }
  50176. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  50177. // the specified instance.
  50178. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  50179. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  50180. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50181. c.project = project
  50182. c.zone = zone
  50183. c.instance = instance
  50184. return c
  50185. }
  50186. // Port sets the optional parameter "port": Specifies which COM or
  50187. // serial port to retrieve data from.
  50188. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  50189. c.urlParams_.Set("port", fmt.Sprint(port))
  50190. return c
  50191. }
  50192. // Start sets the optional parameter "start": Returns output starting
  50193. // from a specific byte position. Use this to page through output when
  50194. // the output is too large to return in a single request. For the
  50195. // initial request, leave this field unspecified. For subsequent calls,
  50196. // this field should be set to the next value returned in the previous
  50197. // call.
  50198. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  50199. c.urlParams_.Set("start", fmt.Sprint(start))
  50200. return c
  50201. }
  50202. // Fields allows partial responses to be retrieved. See
  50203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50204. // for more information.
  50205. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  50206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50207. return c
  50208. }
  50209. // IfNoneMatch sets the optional parameter which makes the operation
  50210. // fail if the object's ETag matches the given value. This is useful for
  50211. // getting updates only after the object has changed since the last
  50212. // request. Use googleapi.IsNotModified to check whether the response
  50213. // error from Do is the result of In-None-Match.
  50214. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  50215. c.ifNoneMatch_ = entityTag
  50216. return c
  50217. }
  50218. // Context sets the context to be used in this call's Do method. Any
  50219. // pending HTTP request will be aborted if the provided context is
  50220. // canceled.
  50221. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  50222. c.ctx_ = ctx
  50223. return c
  50224. }
  50225. // Header returns an http.Header that can be modified by the caller to
  50226. // add HTTP headers to the request.
  50227. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  50228. if c.header_ == nil {
  50229. c.header_ = make(http.Header)
  50230. }
  50231. return c.header_
  50232. }
  50233. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  50234. reqHeaders := make(http.Header)
  50235. for k, v := range c.header_ {
  50236. reqHeaders[k] = v
  50237. }
  50238. reqHeaders.Set("User-Agent", c.s.userAgent())
  50239. if c.ifNoneMatch_ != "" {
  50240. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50241. }
  50242. var body io.Reader = nil
  50243. c.urlParams_.Set("alt", alt)
  50244. c.urlParams_.Set("prettyPrint", "false")
  50245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  50246. urls += "?" + c.urlParams_.Encode()
  50247. req, err := http.NewRequest("GET", urls, body)
  50248. if err != nil {
  50249. return nil, err
  50250. }
  50251. req.Header = reqHeaders
  50252. googleapi.Expand(req.URL, map[string]string{
  50253. "project": c.project,
  50254. "zone": c.zone,
  50255. "instance": c.instance,
  50256. })
  50257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50258. }
  50259. // Do executes the "compute.instances.getSerialPortOutput" call.
  50260. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  50261. // non-2xx status code is an error. Response headers are in either
  50262. // *SerialPortOutput.ServerResponse.Header or (if a response was
  50263. // returned at all) in error.(*googleapi.Error).Header. Use
  50264. // googleapi.IsNotModified to check whether the returned error was
  50265. // because http.StatusNotModified was returned.
  50266. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  50267. gensupport.SetOptions(c.urlParams_, opts...)
  50268. res, err := c.doRequest("json")
  50269. if res != nil && res.StatusCode == http.StatusNotModified {
  50270. if res.Body != nil {
  50271. res.Body.Close()
  50272. }
  50273. return nil, &googleapi.Error{
  50274. Code: res.StatusCode,
  50275. Header: res.Header,
  50276. }
  50277. }
  50278. if err != nil {
  50279. return nil, err
  50280. }
  50281. defer googleapi.CloseBody(res)
  50282. if err := googleapi.CheckResponse(res); err != nil {
  50283. return nil, err
  50284. }
  50285. ret := &SerialPortOutput{
  50286. ServerResponse: googleapi.ServerResponse{
  50287. Header: res.Header,
  50288. HTTPStatusCode: res.StatusCode,
  50289. },
  50290. }
  50291. target := &ret
  50292. if err := gensupport.DecodeResponse(target, res); err != nil {
  50293. return nil, err
  50294. }
  50295. return ret, nil
  50296. // {
  50297. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  50298. // "httpMethod": "GET",
  50299. // "id": "compute.instances.getSerialPortOutput",
  50300. // "parameterOrder": [
  50301. // "project",
  50302. // "zone",
  50303. // "instance"
  50304. // ],
  50305. // "parameters": {
  50306. // "instance": {
  50307. // "description": "Name of the instance scoping this request.",
  50308. // "location": "path",
  50309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50310. // "required": true,
  50311. // "type": "string"
  50312. // },
  50313. // "port": {
  50314. // "default": "1",
  50315. // "description": "Specifies which COM or serial port to retrieve data from.",
  50316. // "format": "int32",
  50317. // "location": "query",
  50318. // "maximum": "4",
  50319. // "minimum": "1",
  50320. // "type": "integer"
  50321. // },
  50322. // "project": {
  50323. // "description": "Project ID for this request.",
  50324. // "location": "path",
  50325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50326. // "required": true,
  50327. // "type": "string"
  50328. // },
  50329. // "start": {
  50330. // "description": "Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.",
  50331. // "format": "int64",
  50332. // "location": "query",
  50333. // "type": "string"
  50334. // },
  50335. // "zone": {
  50336. // "description": "The name of the zone for this request.",
  50337. // "location": "path",
  50338. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50339. // "required": true,
  50340. // "type": "string"
  50341. // }
  50342. // },
  50343. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  50344. // "response": {
  50345. // "$ref": "SerialPortOutput"
  50346. // },
  50347. // "scopes": [
  50348. // "https://www.googleapis.com/auth/cloud-platform",
  50349. // "https://www.googleapis.com/auth/compute",
  50350. // "https://www.googleapis.com/auth/compute.readonly"
  50351. // ]
  50352. // }
  50353. }
  50354. // method id "compute.instances.insert":
  50355. type InstancesInsertCall struct {
  50356. s *Service
  50357. project string
  50358. zone string
  50359. instance *Instance
  50360. urlParams_ gensupport.URLParams
  50361. ctx_ context.Context
  50362. header_ http.Header
  50363. }
  50364. // Insert: Creates an instance resource in the specified project using
  50365. // the data included in the request.
  50366. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  50367. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  50368. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50369. c.project = project
  50370. c.zone = zone
  50371. c.instance = instance
  50372. return c
  50373. }
  50374. // RequestId sets the optional parameter "requestId": An optional
  50375. // request ID to identify requests. Specify a unique request ID so that
  50376. // if you must retry your request, the server will know to ignore the
  50377. // request if it has already been completed.
  50378. //
  50379. // For example, consider a situation where you make an initial request
  50380. // and the request times out. If you make the request again with the
  50381. // same request ID, the server can check if original operation with the
  50382. // same request ID was received, and if so, will ignore the second
  50383. // request. This prevents clients from accidentally creating duplicate
  50384. // commitments.
  50385. //
  50386. // The request ID must be a valid UUID with the exception that zero UUID
  50387. // is not supported (00000000-0000-0000-0000-000000000000).
  50388. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  50389. c.urlParams_.Set("requestId", requestId)
  50390. return c
  50391. }
  50392. // SourceInstanceTemplate sets the optional parameter
  50393. // "sourceInstanceTemplate": Specifies instance template to create the
  50394. // instance.
  50395. //
  50396. // This field is optional. It can be a full or partial URL. For example,
  50397. // the following are all valid URLs to an instance template:
  50398. // -
  50399. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  50400. // - projects/project/global/instanceTemplates/instanceTemplate
  50401. // - global/instanceTemplates/instanceTemplate
  50402. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  50403. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  50404. return c
  50405. }
  50406. // Fields allows partial responses to be retrieved. See
  50407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50408. // for more information.
  50409. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  50410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50411. return c
  50412. }
  50413. // Context sets the context to be used in this call's Do method. Any
  50414. // pending HTTP request will be aborted if the provided context is
  50415. // canceled.
  50416. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  50417. c.ctx_ = ctx
  50418. return c
  50419. }
  50420. // Header returns an http.Header that can be modified by the caller to
  50421. // add HTTP headers to the request.
  50422. func (c *InstancesInsertCall) Header() http.Header {
  50423. if c.header_ == nil {
  50424. c.header_ = make(http.Header)
  50425. }
  50426. return c.header_
  50427. }
  50428. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  50429. reqHeaders := make(http.Header)
  50430. for k, v := range c.header_ {
  50431. reqHeaders[k] = v
  50432. }
  50433. reqHeaders.Set("User-Agent", c.s.userAgent())
  50434. var body io.Reader = nil
  50435. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  50436. if err != nil {
  50437. return nil, err
  50438. }
  50439. reqHeaders.Set("Content-Type", "application/json")
  50440. c.urlParams_.Set("alt", alt)
  50441. c.urlParams_.Set("prettyPrint", "false")
  50442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  50443. urls += "?" + c.urlParams_.Encode()
  50444. req, err := http.NewRequest("POST", urls, body)
  50445. if err != nil {
  50446. return nil, err
  50447. }
  50448. req.Header = reqHeaders
  50449. googleapi.Expand(req.URL, map[string]string{
  50450. "project": c.project,
  50451. "zone": c.zone,
  50452. })
  50453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50454. }
  50455. // Do executes the "compute.instances.insert" call.
  50456. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50457. // status code is an error. Response headers are in either
  50458. // *Operation.ServerResponse.Header or (if a response was returned at
  50459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50460. // to check whether the returned error was because
  50461. // http.StatusNotModified was returned.
  50462. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50463. gensupport.SetOptions(c.urlParams_, opts...)
  50464. res, err := c.doRequest("json")
  50465. if res != nil && res.StatusCode == http.StatusNotModified {
  50466. if res.Body != nil {
  50467. res.Body.Close()
  50468. }
  50469. return nil, &googleapi.Error{
  50470. Code: res.StatusCode,
  50471. Header: res.Header,
  50472. }
  50473. }
  50474. if err != nil {
  50475. return nil, err
  50476. }
  50477. defer googleapi.CloseBody(res)
  50478. if err := googleapi.CheckResponse(res); err != nil {
  50479. return nil, err
  50480. }
  50481. ret := &Operation{
  50482. ServerResponse: googleapi.ServerResponse{
  50483. Header: res.Header,
  50484. HTTPStatusCode: res.StatusCode,
  50485. },
  50486. }
  50487. target := &ret
  50488. if err := gensupport.DecodeResponse(target, res); err != nil {
  50489. return nil, err
  50490. }
  50491. return ret, nil
  50492. // {
  50493. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  50494. // "httpMethod": "POST",
  50495. // "id": "compute.instances.insert",
  50496. // "parameterOrder": [
  50497. // "project",
  50498. // "zone"
  50499. // ],
  50500. // "parameters": {
  50501. // "project": {
  50502. // "description": "Project ID for this request.",
  50503. // "location": "path",
  50504. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50505. // "required": true,
  50506. // "type": "string"
  50507. // },
  50508. // "requestId": {
  50509. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50510. // "location": "query",
  50511. // "type": "string"
  50512. // },
  50513. // "sourceInstanceTemplate": {
  50514. // "description": "Specifies instance template to create the instance.\n\nThis field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: \n- https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate \n- projects/project/global/instanceTemplates/instanceTemplate \n- global/instanceTemplates/instanceTemplate",
  50515. // "location": "query",
  50516. // "type": "string"
  50517. // },
  50518. // "zone": {
  50519. // "description": "The name of the zone for this request.",
  50520. // "location": "path",
  50521. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50522. // "required": true,
  50523. // "type": "string"
  50524. // }
  50525. // },
  50526. // "path": "{project}/zones/{zone}/instances",
  50527. // "request": {
  50528. // "$ref": "Instance"
  50529. // },
  50530. // "response": {
  50531. // "$ref": "Operation"
  50532. // },
  50533. // "scopes": [
  50534. // "https://www.googleapis.com/auth/cloud-platform",
  50535. // "https://www.googleapis.com/auth/compute"
  50536. // ]
  50537. // }
  50538. }
  50539. // method id "compute.instances.list":
  50540. type InstancesListCall struct {
  50541. s *Service
  50542. project string
  50543. zone string
  50544. urlParams_ gensupport.URLParams
  50545. ifNoneMatch_ string
  50546. ctx_ context.Context
  50547. header_ http.Header
  50548. }
  50549. // List: Retrieves the list of instances contained within the specified
  50550. // zone.
  50551. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  50552. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  50553. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50554. c.project = project
  50555. c.zone = zone
  50556. return c
  50557. }
  50558. // Filter sets the optional parameter "filter": A filter expression that
  50559. // filters resources listed in the response. The expression must specify
  50560. // the field name, a comparison operator, and the value that you want to
  50561. // use for filtering. The value must be a string, a number, or a
  50562. // boolean. The comparison operator must be either =, !=, >, or <.
  50563. //
  50564. // For example, if you are filtering Compute Engine instances, you can
  50565. // exclude instances named example-instance by specifying name !=
  50566. // example-instance.
  50567. //
  50568. // You can also filter nested fields. For example, you could specify
  50569. // scheduling.automaticRestart = false to include instances only if they
  50570. // are not scheduled for automatic restarts. You can use filtering on
  50571. // nested fields to filter based on resource labels.
  50572. //
  50573. // To filter on multiple expressions, provide each separate expression
  50574. // within parentheses. For example, (scheduling.automaticRestart = true)
  50575. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50576. // AND expression. However, you can include AND and OR expressions
  50577. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50578. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50579. // true).
  50580. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  50581. c.urlParams_.Set("filter", filter)
  50582. return c
  50583. }
  50584. // MaxResults sets the optional parameter "maxResults": The maximum
  50585. // number of results per page that should be returned. If the number of
  50586. // available results is larger than maxResults, Compute Engine returns a
  50587. // nextPageToken that can be used to get the next page of results in
  50588. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50589. // (Default: 500)
  50590. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  50591. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50592. return c
  50593. }
  50594. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50595. // a certain order. By default, results are returned in alphanumerical
  50596. // order based on the resource name.
  50597. //
  50598. // You can also sort results in descending order based on the creation
  50599. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50600. // based on the creationTimestamp field in reverse chronological order
  50601. // (newest result first). Use this to sort resources like operations so
  50602. // that the newest operation is returned first.
  50603. //
  50604. // Currently, only sorting by name or creationTimestamp desc is
  50605. // supported.
  50606. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  50607. c.urlParams_.Set("orderBy", orderBy)
  50608. return c
  50609. }
  50610. // PageToken sets the optional parameter "pageToken": Specifies a page
  50611. // token to use. Set pageToken to the nextPageToken returned by a
  50612. // previous list request to get the next page of results.
  50613. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  50614. c.urlParams_.Set("pageToken", pageToken)
  50615. return c
  50616. }
  50617. // Fields allows partial responses to be retrieved. See
  50618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50619. // for more information.
  50620. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  50621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50622. return c
  50623. }
  50624. // IfNoneMatch sets the optional parameter which makes the operation
  50625. // fail if the object's ETag matches the given value. This is useful for
  50626. // getting updates only after the object has changed since the last
  50627. // request. Use googleapi.IsNotModified to check whether the response
  50628. // error from Do is the result of In-None-Match.
  50629. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  50630. c.ifNoneMatch_ = entityTag
  50631. return c
  50632. }
  50633. // Context sets the context to be used in this call's Do method. Any
  50634. // pending HTTP request will be aborted if the provided context is
  50635. // canceled.
  50636. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  50637. c.ctx_ = ctx
  50638. return c
  50639. }
  50640. // Header returns an http.Header that can be modified by the caller to
  50641. // add HTTP headers to the request.
  50642. func (c *InstancesListCall) Header() http.Header {
  50643. if c.header_ == nil {
  50644. c.header_ = make(http.Header)
  50645. }
  50646. return c.header_
  50647. }
  50648. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  50649. reqHeaders := make(http.Header)
  50650. for k, v := range c.header_ {
  50651. reqHeaders[k] = v
  50652. }
  50653. reqHeaders.Set("User-Agent", c.s.userAgent())
  50654. if c.ifNoneMatch_ != "" {
  50655. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50656. }
  50657. var body io.Reader = nil
  50658. c.urlParams_.Set("alt", alt)
  50659. c.urlParams_.Set("prettyPrint", "false")
  50660. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  50661. urls += "?" + c.urlParams_.Encode()
  50662. req, err := http.NewRequest("GET", urls, body)
  50663. if err != nil {
  50664. return nil, err
  50665. }
  50666. req.Header = reqHeaders
  50667. googleapi.Expand(req.URL, map[string]string{
  50668. "project": c.project,
  50669. "zone": c.zone,
  50670. })
  50671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50672. }
  50673. // Do executes the "compute.instances.list" call.
  50674. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  50675. // status code is an error. Response headers are in either
  50676. // *InstanceList.ServerResponse.Header or (if a response was returned at
  50677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50678. // to check whether the returned error was because
  50679. // http.StatusNotModified was returned.
  50680. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  50681. gensupport.SetOptions(c.urlParams_, opts...)
  50682. res, err := c.doRequest("json")
  50683. if res != nil && res.StatusCode == http.StatusNotModified {
  50684. if res.Body != nil {
  50685. res.Body.Close()
  50686. }
  50687. return nil, &googleapi.Error{
  50688. Code: res.StatusCode,
  50689. Header: res.Header,
  50690. }
  50691. }
  50692. if err != nil {
  50693. return nil, err
  50694. }
  50695. defer googleapi.CloseBody(res)
  50696. if err := googleapi.CheckResponse(res); err != nil {
  50697. return nil, err
  50698. }
  50699. ret := &InstanceList{
  50700. ServerResponse: googleapi.ServerResponse{
  50701. Header: res.Header,
  50702. HTTPStatusCode: res.StatusCode,
  50703. },
  50704. }
  50705. target := &ret
  50706. if err := gensupport.DecodeResponse(target, res); err != nil {
  50707. return nil, err
  50708. }
  50709. return ret, nil
  50710. // {
  50711. // "description": "Retrieves the list of instances contained within the specified zone.",
  50712. // "httpMethod": "GET",
  50713. // "id": "compute.instances.list",
  50714. // "parameterOrder": [
  50715. // "project",
  50716. // "zone"
  50717. // ],
  50718. // "parameters": {
  50719. // "filter": {
  50720. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50721. // "location": "query",
  50722. // "type": "string"
  50723. // },
  50724. // "maxResults": {
  50725. // "default": "500",
  50726. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50727. // "format": "uint32",
  50728. // "location": "query",
  50729. // "minimum": "0",
  50730. // "type": "integer"
  50731. // },
  50732. // "orderBy": {
  50733. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50734. // "location": "query",
  50735. // "type": "string"
  50736. // },
  50737. // "pageToken": {
  50738. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50739. // "location": "query",
  50740. // "type": "string"
  50741. // },
  50742. // "project": {
  50743. // "description": "Project ID for this request.",
  50744. // "location": "path",
  50745. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50746. // "required": true,
  50747. // "type": "string"
  50748. // },
  50749. // "zone": {
  50750. // "description": "The name of the zone for this request.",
  50751. // "location": "path",
  50752. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50753. // "required": true,
  50754. // "type": "string"
  50755. // }
  50756. // },
  50757. // "path": "{project}/zones/{zone}/instances",
  50758. // "response": {
  50759. // "$ref": "InstanceList"
  50760. // },
  50761. // "scopes": [
  50762. // "https://www.googleapis.com/auth/cloud-platform",
  50763. // "https://www.googleapis.com/auth/compute",
  50764. // "https://www.googleapis.com/auth/compute.readonly"
  50765. // ]
  50766. // }
  50767. }
  50768. // Pages invokes f for each page of results.
  50769. // A non-nil error returned from f will halt the iteration.
  50770. // The provided context supersedes any context provided to the Context method.
  50771. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  50772. c.ctx_ = ctx
  50773. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50774. for {
  50775. x, err := c.Do()
  50776. if err != nil {
  50777. return err
  50778. }
  50779. if err := f(x); err != nil {
  50780. return err
  50781. }
  50782. if x.NextPageToken == "" {
  50783. return nil
  50784. }
  50785. c.PageToken(x.NextPageToken)
  50786. }
  50787. }
  50788. // method id "compute.instances.listReferrers":
  50789. type InstancesListReferrersCall struct {
  50790. s *Service
  50791. project string
  50792. zone string
  50793. instance string
  50794. urlParams_ gensupport.URLParams
  50795. ifNoneMatch_ string
  50796. ctx_ context.Context
  50797. header_ http.Header
  50798. }
  50799. // ListReferrers: Retrieves the list of referrers to instances contained
  50800. // within the specified zone. For more information, read Viewing
  50801. // Referrers to VM Instances.
  50802. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  50803. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50804. c.project = project
  50805. c.zone = zone
  50806. c.instance = instance
  50807. return c
  50808. }
  50809. // Filter sets the optional parameter "filter": A filter expression that
  50810. // filters resources listed in the response. The expression must specify
  50811. // the field name, a comparison operator, and the value that you want to
  50812. // use for filtering. The value must be a string, a number, or a
  50813. // boolean. The comparison operator must be either =, !=, >, or <.
  50814. //
  50815. // For example, if you are filtering Compute Engine instances, you can
  50816. // exclude instances named example-instance by specifying name !=
  50817. // example-instance.
  50818. //
  50819. // You can also filter nested fields. For example, you could specify
  50820. // scheduling.automaticRestart = false to include instances only if they
  50821. // are not scheduled for automatic restarts. You can use filtering on
  50822. // nested fields to filter based on resource labels.
  50823. //
  50824. // To filter on multiple expressions, provide each separate expression
  50825. // within parentheses. For example, (scheduling.automaticRestart = true)
  50826. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50827. // AND expression. However, you can include AND and OR expressions
  50828. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50829. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50830. // true).
  50831. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  50832. c.urlParams_.Set("filter", filter)
  50833. return c
  50834. }
  50835. // MaxResults sets the optional parameter "maxResults": The maximum
  50836. // number of results per page that should be returned. If the number of
  50837. // available results is larger than maxResults, Compute Engine returns a
  50838. // nextPageToken that can be used to get the next page of results in
  50839. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50840. // (Default: 500)
  50841. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  50842. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50843. return c
  50844. }
  50845. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50846. // a certain order. By default, results are returned in alphanumerical
  50847. // order based on the resource name.
  50848. //
  50849. // You can also sort results in descending order based on the creation
  50850. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50851. // based on the creationTimestamp field in reverse chronological order
  50852. // (newest result first). Use this to sort resources like operations so
  50853. // that the newest operation is returned first.
  50854. //
  50855. // Currently, only sorting by name or creationTimestamp desc is
  50856. // supported.
  50857. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  50858. c.urlParams_.Set("orderBy", orderBy)
  50859. return c
  50860. }
  50861. // PageToken sets the optional parameter "pageToken": Specifies a page
  50862. // token to use. Set pageToken to the nextPageToken returned by a
  50863. // previous list request to get the next page of results.
  50864. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  50865. c.urlParams_.Set("pageToken", pageToken)
  50866. return c
  50867. }
  50868. // Fields allows partial responses to be retrieved. See
  50869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50870. // for more information.
  50871. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  50872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50873. return c
  50874. }
  50875. // IfNoneMatch sets the optional parameter which makes the operation
  50876. // fail if the object's ETag matches the given value. This is useful for
  50877. // getting updates only after the object has changed since the last
  50878. // request. Use googleapi.IsNotModified to check whether the response
  50879. // error from Do is the result of In-None-Match.
  50880. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  50881. c.ifNoneMatch_ = entityTag
  50882. return c
  50883. }
  50884. // Context sets the context to be used in this call's Do method. Any
  50885. // pending HTTP request will be aborted if the provided context is
  50886. // canceled.
  50887. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  50888. c.ctx_ = ctx
  50889. return c
  50890. }
  50891. // Header returns an http.Header that can be modified by the caller to
  50892. // add HTTP headers to the request.
  50893. func (c *InstancesListReferrersCall) Header() http.Header {
  50894. if c.header_ == nil {
  50895. c.header_ = make(http.Header)
  50896. }
  50897. return c.header_
  50898. }
  50899. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  50900. reqHeaders := make(http.Header)
  50901. for k, v := range c.header_ {
  50902. reqHeaders[k] = v
  50903. }
  50904. reqHeaders.Set("User-Agent", c.s.userAgent())
  50905. if c.ifNoneMatch_ != "" {
  50906. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50907. }
  50908. var body io.Reader = nil
  50909. c.urlParams_.Set("alt", alt)
  50910. c.urlParams_.Set("prettyPrint", "false")
  50911. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  50912. urls += "?" + c.urlParams_.Encode()
  50913. req, err := http.NewRequest("GET", urls, body)
  50914. if err != nil {
  50915. return nil, err
  50916. }
  50917. req.Header = reqHeaders
  50918. googleapi.Expand(req.URL, map[string]string{
  50919. "project": c.project,
  50920. "zone": c.zone,
  50921. "instance": c.instance,
  50922. })
  50923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50924. }
  50925. // Do executes the "compute.instances.listReferrers" call.
  50926. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  50927. // non-2xx status code is an error. Response headers are in either
  50928. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  50929. // returned at all) in error.(*googleapi.Error).Header. Use
  50930. // googleapi.IsNotModified to check whether the returned error was
  50931. // because http.StatusNotModified was returned.
  50932. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  50933. gensupport.SetOptions(c.urlParams_, opts...)
  50934. res, err := c.doRequest("json")
  50935. if res != nil && res.StatusCode == http.StatusNotModified {
  50936. if res.Body != nil {
  50937. res.Body.Close()
  50938. }
  50939. return nil, &googleapi.Error{
  50940. Code: res.StatusCode,
  50941. Header: res.Header,
  50942. }
  50943. }
  50944. if err != nil {
  50945. return nil, err
  50946. }
  50947. defer googleapi.CloseBody(res)
  50948. if err := googleapi.CheckResponse(res); err != nil {
  50949. return nil, err
  50950. }
  50951. ret := &InstanceListReferrers{
  50952. ServerResponse: googleapi.ServerResponse{
  50953. Header: res.Header,
  50954. HTTPStatusCode: res.StatusCode,
  50955. },
  50956. }
  50957. target := &ret
  50958. if err := gensupport.DecodeResponse(target, res); err != nil {
  50959. return nil, err
  50960. }
  50961. return ret, nil
  50962. // {
  50963. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  50964. // "httpMethod": "GET",
  50965. // "id": "compute.instances.listReferrers",
  50966. // "parameterOrder": [
  50967. // "project",
  50968. // "zone",
  50969. // "instance"
  50970. // ],
  50971. // "parameters": {
  50972. // "filter": {
  50973. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50974. // "location": "query",
  50975. // "type": "string"
  50976. // },
  50977. // "instance": {
  50978. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  50979. // "location": "path",
  50980. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50981. // "required": true,
  50982. // "type": "string"
  50983. // },
  50984. // "maxResults": {
  50985. // "default": "500",
  50986. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50987. // "format": "uint32",
  50988. // "location": "query",
  50989. // "minimum": "0",
  50990. // "type": "integer"
  50991. // },
  50992. // "orderBy": {
  50993. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50994. // "location": "query",
  50995. // "type": "string"
  50996. // },
  50997. // "pageToken": {
  50998. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50999. // "location": "query",
  51000. // "type": "string"
  51001. // },
  51002. // "project": {
  51003. // "description": "Project ID for this request.",
  51004. // "location": "path",
  51005. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51006. // "required": true,
  51007. // "type": "string"
  51008. // },
  51009. // "zone": {
  51010. // "description": "The name of the zone for this request.",
  51011. // "location": "path",
  51012. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51013. // "required": true,
  51014. // "type": "string"
  51015. // }
  51016. // },
  51017. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  51018. // "response": {
  51019. // "$ref": "InstanceListReferrers"
  51020. // },
  51021. // "scopes": [
  51022. // "https://www.googleapis.com/auth/cloud-platform",
  51023. // "https://www.googleapis.com/auth/compute",
  51024. // "https://www.googleapis.com/auth/compute.readonly"
  51025. // ]
  51026. // }
  51027. }
  51028. // Pages invokes f for each page of results.
  51029. // A non-nil error returned from f will halt the iteration.
  51030. // The provided context supersedes any context provided to the Context method.
  51031. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  51032. c.ctx_ = ctx
  51033. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51034. for {
  51035. x, err := c.Do()
  51036. if err != nil {
  51037. return err
  51038. }
  51039. if err := f(x); err != nil {
  51040. return err
  51041. }
  51042. if x.NextPageToken == "" {
  51043. return nil
  51044. }
  51045. c.PageToken(x.NextPageToken)
  51046. }
  51047. }
  51048. // method id "compute.instances.reset":
  51049. type InstancesResetCall struct {
  51050. s *Service
  51051. project string
  51052. zone string
  51053. instance string
  51054. urlParams_ gensupport.URLParams
  51055. ctx_ context.Context
  51056. header_ http.Header
  51057. }
  51058. // Reset: Performs a reset on the instance. For more information, see
  51059. // Resetting an instance.
  51060. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  51061. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  51062. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51063. c.project = project
  51064. c.zone = zone
  51065. c.instance = instance
  51066. return c
  51067. }
  51068. // RequestId sets the optional parameter "requestId": An optional
  51069. // request ID to identify requests. Specify a unique request ID so that
  51070. // if you must retry your request, the server will know to ignore the
  51071. // request if it has already been completed.
  51072. //
  51073. // For example, consider a situation where you make an initial request
  51074. // and the request times out. If you make the request again with the
  51075. // same request ID, the server can check if original operation with the
  51076. // same request ID was received, and if so, will ignore the second
  51077. // request. This prevents clients from accidentally creating duplicate
  51078. // commitments.
  51079. //
  51080. // The request ID must be a valid UUID with the exception that zero UUID
  51081. // is not supported (00000000-0000-0000-0000-000000000000).
  51082. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  51083. c.urlParams_.Set("requestId", requestId)
  51084. return c
  51085. }
  51086. // Fields allows partial responses to be retrieved. See
  51087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51088. // for more information.
  51089. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  51090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51091. return c
  51092. }
  51093. // Context sets the context to be used in this call's Do method. Any
  51094. // pending HTTP request will be aborted if the provided context is
  51095. // canceled.
  51096. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  51097. c.ctx_ = ctx
  51098. return c
  51099. }
  51100. // Header returns an http.Header that can be modified by the caller to
  51101. // add HTTP headers to the request.
  51102. func (c *InstancesResetCall) Header() http.Header {
  51103. if c.header_ == nil {
  51104. c.header_ = make(http.Header)
  51105. }
  51106. return c.header_
  51107. }
  51108. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  51109. reqHeaders := make(http.Header)
  51110. for k, v := range c.header_ {
  51111. reqHeaders[k] = v
  51112. }
  51113. reqHeaders.Set("User-Agent", c.s.userAgent())
  51114. var body io.Reader = nil
  51115. c.urlParams_.Set("alt", alt)
  51116. c.urlParams_.Set("prettyPrint", "false")
  51117. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  51118. urls += "?" + c.urlParams_.Encode()
  51119. req, err := http.NewRequest("POST", urls, body)
  51120. if err != nil {
  51121. return nil, err
  51122. }
  51123. req.Header = reqHeaders
  51124. googleapi.Expand(req.URL, map[string]string{
  51125. "project": c.project,
  51126. "zone": c.zone,
  51127. "instance": c.instance,
  51128. })
  51129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51130. }
  51131. // Do executes the "compute.instances.reset" call.
  51132. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51133. // status code is an error. Response headers are in either
  51134. // *Operation.ServerResponse.Header or (if a response was returned at
  51135. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51136. // to check whether the returned error was because
  51137. // http.StatusNotModified was returned.
  51138. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51139. gensupport.SetOptions(c.urlParams_, opts...)
  51140. res, err := c.doRequest("json")
  51141. if res != nil && res.StatusCode == http.StatusNotModified {
  51142. if res.Body != nil {
  51143. res.Body.Close()
  51144. }
  51145. return nil, &googleapi.Error{
  51146. Code: res.StatusCode,
  51147. Header: res.Header,
  51148. }
  51149. }
  51150. if err != nil {
  51151. return nil, err
  51152. }
  51153. defer googleapi.CloseBody(res)
  51154. if err := googleapi.CheckResponse(res); err != nil {
  51155. return nil, err
  51156. }
  51157. ret := &Operation{
  51158. ServerResponse: googleapi.ServerResponse{
  51159. Header: res.Header,
  51160. HTTPStatusCode: res.StatusCode,
  51161. },
  51162. }
  51163. target := &ret
  51164. if err := gensupport.DecodeResponse(target, res); err != nil {
  51165. return nil, err
  51166. }
  51167. return ret, nil
  51168. // {
  51169. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  51170. // "httpMethod": "POST",
  51171. // "id": "compute.instances.reset",
  51172. // "parameterOrder": [
  51173. // "project",
  51174. // "zone",
  51175. // "instance"
  51176. // ],
  51177. // "parameters": {
  51178. // "instance": {
  51179. // "description": "Name of the instance scoping this request.",
  51180. // "location": "path",
  51181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51182. // "required": true,
  51183. // "type": "string"
  51184. // },
  51185. // "project": {
  51186. // "description": "Project ID for this request.",
  51187. // "location": "path",
  51188. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51189. // "required": true,
  51190. // "type": "string"
  51191. // },
  51192. // "requestId": {
  51193. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51194. // "location": "query",
  51195. // "type": "string"
  51196. // },
  51197. // "zone": {
  51198. // "description": "The name of the zone for this request.",
  51199. // "location": "path",
  51200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51201. // "required": true,
  51202. // "type": "string"
  51203. // }
  51204. // },
  51205. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  51206. // "response": {
  51207. // "$ref": "Operation"
  51208. // },
  51209. // "scopes": [
  51210. // "https://www.googleapis.com/auth/cloud-platform",
  51211. // "https://www.googleapis.com/auth/compute"
  51212. // ]
  51213. // }
  51214. }
  51215. // method id "compute.instances.setDeletionProtection":
  51216. type InstancesSetDeletionProtectionCall struct {
  51217. s *Service
  51218. project string
  51219. zone string
  51220. resource string
  51221. urlParams_ gensupport.URLParams
  51222. ctx_ context.Context
  51223. header_ http.Header
  51224. }
  51225. // SetDeletionProtection: Sets deletion protection on the instance.
  51226. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  51227. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51228. c.project = project
  51229. c.zone = zone
  51230. c.resource = resource
  51231. return c
  51232. }
  51233. // DeletionProtection sets the optional parameter "deletionProtection":
  51234. // Whether the resource should be protected against deletion.
  51235. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  51236. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  51237. return c
  51238. }
  51239. // RequestId sets the optional parameter "requestId": An optional
  51240. // request ID to identify requests. Specify a unique request ID so that
  51241. // if you must retry your request, the server will know to ignore the
  51242. // request if it has already been completed.
  51243. //
  51244. // For example, consider a situation where you make an initial request
  51245. // and the request times out. If you make the request again with the
  51246. // same request ID, the server can check if original operation with the
  51247. // same request ID was received, and if so, will ignore the second
  51248. // request. This prevents clients from accidentally creating duplicate
  51249. // commitments.
  51250. //
  51251. // The request ID must be a valid UUID with the exception that zero UUID
  51252. // is not supported (00000000-0000-0000-0000-000000000000).
  51253. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  51254. c.urlParams_.Set("requestId", requestId)
  51255. return c
  51256. }
  51257. // Fields allows partial responses to be retrieved. See
  51258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51259. // for more information.
  51260. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  51261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51262. return c
  51263. }
  51264. // Context sets the context to be used in this call's Do method. Any
  51265. // pending HTTP request will be aborted if the provided context is
  51266. // canceled.
  51267. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  51268. c.ctx_ = ctx
  51269. return c
  51270. }
  51271. // Header returns an http.Header that can be modified by the caller to
  51272. // add HTTP headers to the request.
  51273. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  51274. if c.header_ == nil {
  51275. c.header_ = make(http.Header)
  51276. }
  51277. return c.header_
  51278. }
  51279. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  51280. reqHeaders := make(http.Header)
  51281. for k, v := range c.header_ {
  51282. reqHeaders[k] = v
  51283. }
  51284. reqHeaders.Set("User-Agent", c.s.userAgent())
  51285. var body io.Reader = nil
  51286. c.urlParams_.Set("alt", alt)
  51287. c.urlParams_.Set("prettyPrint", "false")
  51288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  51289. urls += "?" + c.urlParams_.Encode()
  51290. req, err := http.NewRequest("POST", urls, body)
  51291. if err != nil {
  51292. return nil, err
  51293. }
  51294. req.Header = reqHeaders
  51295. googleapi.Expand(req.URL, map[string]string{
  51296. "project": c.project,
  51297. "zone": c.zone,
  51298. "resource": c.resource,
  51299. })
  51300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51301. }
  51302. // Do executes the "compute.instances.setDeletionProtection" call.
  51303. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51304. // status code is an error. Response headers are in either
  51305. // *Operation.ServerResponse.Header or (if a response was returned at
  51306. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51307. // to check whether the returned error was because
  51308. // http.StatusNotModified was returned.
  51309. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51310. gensupport.SetOptions(c.urlParams_, opts...)
  51311. res, err := c.doRequest("json")
  51312. if res != nil && res.StatusCode == http.StatusNotModified {
  51313. if res.Body != nil {
  51314. res.Body.Close()
  51315. }
  51316. return nil, &googleapi.Error{
  51317. Code: res.StatusCode,
  51318. Header: res.Header,
  51319. }
  51320. }
  51321. if err != nil {
  51322. return nil, err
  51323. }
  51324. defer googleapi.CloseBody(res)
  51325. if err := googleapi.CheckResponse(res); err != nil {
  51326. return nil, err
  51327. }
  51328. ret := &Operation{
  51329. ServerResponse: googleapi.ServerResponse{
  51330. Header: res.Header,
  51331. HTTPStatusCode: res.StatusCode,
  51332. },
  51333. }
  51334. target := &ret
  51335. if err := gensupport.DecodeResponse(target, res); err != nil {
  51336. return nil, err
  51337. }
  51338. return ret, nil
  51339. // {
  51340. // "description": "Sets deletion protection on the instance.",
  51341. // "httpMethod": "POST",
  51342. // "id": "compute.instances.setDeletionProtection",
  51343. // "parameterOrder": [
  51344. // "project",
  51345. // "zone",
  51346. // "resource"
  51347. // ],
  51348. // "parameters": {
  51349. // "deletionProtection": {
  51350. // "default": "true",
  51351. // "description": "Whether the resource should be protected against deletion.",
  51352. // "location": "query",
  51353. // "type": "boolean"
  51354. // },
  51355. // "project": {
  51356. // "description": "Project ID for this request.",
  51357. // "location": "path",
  51358. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51359. // "required": true,
  51360. // "type": "string"
  51361. // },
  51362. // "requestId": {
  51363. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51364. // "location": "query",
  51365. // "type": "string"
  51366. // },
  51367. // "resource": {
  51368. // "description": "Name or id of the resource for this request.",
  51369. // "location": "path",
  51370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51371. // "required": true,
  51372. // "type": "string"
  51373. // },
  51374. // "zone": {
  51375. // "description": "The name of the zone for this request.",
  51376. // "location": "path",
  51377. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51378. // "required": true,
  51379. // "type": "string"
  51380. // }
  51381. // },
  51382. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  51383. // "response": {
  51384. // "$ref": "Operation"
  51385. // },
  51386. // "scopes": [
  51387. // "https://www.googleapis.com/auth/cloud-platform",
  51388. // "https://www.googleapis.com/auth/compute"
  51389. // ]
  51390. // }
  51391. }
  51392. // method id "compute.instances.setDiskAutoDelete":
  51393. type InstancesSetDiskAutoDeleteCall struct {
  51394. s *Service
  51395. project string
  51396. zone string
  51397. instance string
  51398. urlParams_ gensupport.URLParams
  51399. ctx_ context.Context
  51400. header_ http.Header
  51401. }
  51402. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  51403. // an instance.
  51404. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  51405. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  51406. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51407. c.project = project
  51408. c.zone = zone
  51409. c.instance = instance
  51410. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  51411. c.urlParams_.Set("deviceName", deviceName)
  51412. return c
  51413. }
  51414. // RequestId sets the optional parameter "requestId": An optional
  51415. // request ID to identify requests. Specify a unique request ID so that
  51416. // if you must retry your request, the server will know to ignore the
  51417. // request if it has already been completed.
  51418. //
  51419. // For example, consider a situation where you make an initial request
  51420. // and the request times out. If you make the request again with the
  51421. // same request ID, the server can check if original operation with the
  51422. // same request ID was received, and if so, will ignore the second
  51423. // request. This prevents clients from accidentally creating duplicate
  51424. // commitments.
  51425. //
  51426. // The request ID must be a valid UUID with the exception that zero UUID
  51427. // is not supported (00000000-0000-0000-0000-000000000000).
  51428. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  51429. c.urlParams_.Set("requestId", requestId)
  51430. return c
  51431. }
  51432. // Fields allows partial responses to be retrieved. See
  51433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51434. // for more information.
  51435. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  51436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51437. return c
  51438. }
  51439. // Context sets the context to be used in this call's Do method. Any
  51440. // pending HTTP request will be aborted if the provided context is
  51441. // canceled.
  51442. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  51443. c.ctx_ = ctx
  51444. return c
  51445. }
  51446. // Header returns an http.Header that can be modified by the caller to
  51447. // add HTTP headers to the request.
  51448. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  51449. if c.header_ == nil {
  51450. c.header_ = make(http.Header)
  51451. }
  51452. return c.header_
  51453. }
  51454. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  51455. reqHeaders := make(http.Header)
  51456. for k, v := range c.header_ {
  51457. reqHeaders[k] = v
  51458. }
  51459. reqHeaders.Set("User-Agent", c.s.userAgent())
  51460. var body io.Reader = nil
  51461. c.urlParams_.Set("alt", alt)
  51462. c.urlParams_.Set("prettyPrint", "false")
  51463. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  51464. urls += "?" + c.urlParams_.Encode()
  51465. req, err := http.NewRequest("POST", urls, body)
  51466. if err != nil {
  51467. return nil, err
  51468. }
  51469. req.Header = reqHeaders
  51470. googleapi.Expand(req.URL, map[string]string{
  51471. "project": c.project,
  51472. "zone": c.zone,
  51473. "instance": c.instance,
  51474. })
  51475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51476. }
  51477. // Do executes the "compute.instances.setDiskAutoDelete" call.
  51478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51479. // status code is an error. Response headers are in either
  51480. // *Operation.ServerResponse.Header or (if a response was returned at
  51481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51482. // to check whether the returned error was because
  51483. // http.StatusNotModified was returned.
  51484. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51485. gensupport.SetOptions(c.urlParams_, opts...)
  51486. res, err := c.doRequest("json")
  51487. if res != nil && res.StatusCode == http.StatusNotModified {
  51488. if res.Body != nil {
  51489. res.Body.Close()
  51490. }
  51491. return nil, &googleapi.Error{
  51492. Code: res.StatusCode,
  51493. Header: res.Header,
  51494. }
  51495. }
  51496. if err != nil {
  51497. return nil, err
  51498. }
  51499. defer googleapi.CloseBody(res)
  51500. if err := googleapi.CheckResponse(res); err != nil {
  51501. return nil, err
  51502. }
  51503. ret := &Operation{
  51504. ServerResponse: googleapi.ServerResponse{
  51505. Header: res.Header,
  51506. HTTPStatusCode: res.StatusCode,
  51507. },
  51508. }
  51509. target := &ret
  51510. if err := gensupport.DecodeResponse(target, res); err != nil {
  51511. return nil, err
  51512. }
  51513. return ret, nil
  51514. // {
  51515. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  51516. // "httpMethod": "POST",
  51517. // "id": "compute.instances.setDiskAutoDelete",
  51518. // "parameterOrder": [
  51519. // "project",
  51520. // "zone",
  51521. // "instance",
  51522. // "autoDelete",
  51523. // "deviceName"
  51524. // ],
  51525. // "parameters": {
  51526. // "autoDelete": {
  51527. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  51528. // "location": "query",
  51529. // "required": true,
  51530. // "type": "boolean"
  51531. // },
  51532. // "deviceName": {
  51533. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  51534. // "location": "query",
  51535. // "pattern": "\\w[\\w.-]{0,254}",
  51536. // "required": true,
  51537. // "type": "string"
  51538. // },
  51539. // "instance": {
  51540. // "description": "The instance name for this request.",
  51541. // "location": "path",
  51542. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51543. // "required": true,
  51544. // "type": "string"
  51545. // },
  51546. // "project": {
  51547. // "description": "Project ID for this request.",
  51548. // "location": "path",
  51549. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51550. // "required": true,
  51551. // "type": "string"
  51552. // },
  51553. // "requestId": {
  51554. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51555. // "location": "query",
  51556. // "type": "string"
  51557. // },
  51558. // "zone": {
  51559. // "description": "The name of the zone for this request.",
  51560. // "location": "path",
  51561. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51562. // "required": true,
  51563. // "type": "string"
  51564. // }
  51565. // },
  51566. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  51567. // "response": {
  51568. // "$ref": "Operation"
  51569. // },
  51570. // "scopes": [
  51571. // "https://www.googleapis.com/auth/cloud-platform",
  51572. // "https://www.googleapis.com/auth/compute"
  51573. // ]
  51574. // }
  51575. }
  51576. // method id "compute.instances.setIamPolicy":
  51577. type InstancesSetIamPolicyCall struct {
  51578. s *Service
  51579. project string
  51580. zone string
  51581. resource string
  51582. zonesetpolicyrequest *ZoneSetPolicyRequest
  51583. urlParams_ gensupport.URLParams
  51584. ctx_ context.Context
  51585. header_ http.Header
  51586. }
  51587. // SetIamPolicy: Sets the access control policy on the specified
  51588. // resource. Replaces any existing policy.
  51589. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  51590. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51591. c.project = project
  51592. c.zone = zone
  51593. c.resource = resource
  51594. c.zonesetpolicyrequest = zonesetpolicyrequest
  51595. return c
  51596. }
  51597. // Fields allows partial responses to be retrieved. See
  51598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51599. // for more information.
  51600. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  51601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51602. return c
  51603. }
  51604. // Context sets the context to be used in this call's Do method. Any
  51605. // pending HTTP request will be aborted if the provided context is
  51606. // canceled.
  51607. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  51608. c.ctx_ = ctx
  51609. return c
  51610. }
  51611. // Header returns an http.Header that can be modified by the caller to
  51612. // add HTTP headers to the request.
  51613. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  51614. if c.header_ == nil {
  51615. c.header_ = make(http.Header)
  51616. }
  51617. return c.header_
  51618. }
  51619. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  51620. reqHeaders := make(http.Header)
  51621. for k, v := range c.header_ {
  51622. reqHeaders[k] = v
  51623. }
  51624. reqHeaders.Set("User-Agent", c.s.userAgent())
  51625. var body io.Reader = nil
  51626. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  51627. if err != nil {
  51628. return nil, err
  51629. }
  51630. reqHeaders.Set("Content-Type", "application/json")
  51631. c.urlParams_.Set("alt", alt)
  51632. c.urlParams_.Set("prettyPrint", "false")
  51633. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  51634. urls += "?" + c.urlParams_.Encode()
  51635. req, err := http.NewRequest("POST", urls, body)
  51636. if err != nil {
  51637. return nil, err
  51638. }
  51639. req.Header = reqHeaders
  51640. googleapi.Expand(req.URL, map[string]string{
  51641. "project": c.project,
  51642. "zone": c.zone,
  51643. "resource": c.resource,
  51644. })
  51645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51646. }
  51647. // Do executes the "compute.instances.setIamPolicy" call.
  51648. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  51649. // code is an error. Response headers are in either
  51650. // *Policy.ServerResponse.Header or (if a response was returned at all)
  51651. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  51652. // check whether the returned error was because http.StatusNotModified
  51653. // was returned.
  51654. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  51655. gensupport.SetOptions(c.urlParams_, opts...)
  51656. res, err := c.doRequest("json")
  51657. if res != nil && res.StatusCode == http.StatusNotModified {
  51658. if res.Body != nil {
  51659. res.Body.Close()
  51660. }
  51661. return nil, &googleapi.Error{
  51662. Code: res.StatusCode,
  51663. Header: res.Header,
  51664. }
  51665. }
  51666. if err != nil {
  51667. return nil, err
  51668. }
  51669. defer googleapi.CloseBody(res)
  51670. if err := googleapi.CheckResponse(res); err != nil {
  51671. return nil, err
  51672. }
  51673. ret := &Policy{
  51674. ServerResponse: googleapi.ServerResponse{
  51675. Header: res.Header,
  51676. HTTPStatusCode: res.StatusCode,
  51677. },
  51678. }
  51679. target := &ret
  51680. if err := gensupport.DecodeResponse(target, res); err != nil {
  51681. return nil, err
  51682. }
  51683. return ret, nil
  51684. // {
  51685. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  51686. // "httpMethod": "POST",
  51687. // "id": "compute.instances.setIamPolicy",
  51688. // "parameterOrder": [
  51689. // "project",
  51690. // "zone",
  51691. // "resource"
  51692. // ],
  51693. // "parameters": {
  51694. // "project": {
  51695. // "description": "Project ID for this request.",
  51696. // "location": "path",
  51697. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51698. // "required": true,
  51699. // "type": "string"
  51700. // },
  51701. // "resource": {
  51702. // "description": "Name or id of the resource for this request.",
  51703. // "location": "path",
  51704. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51705. // "required": true,
  51706. // "type": "string"
  51707. // },
  51708. // "zone": {
  51709. // "description": "The name of the zone for this request.",
  51710. // "location": "path",
  51711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51712. // "required": true,
  51713. // "type": "string"
  51714. // }
  51715. // },
  51716. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  51717. // "request": {
  51718. // "$ref": "ZoneSetPolicyRequest"
  51719. // },
  51720. // "response": {
  51721. // "$ref": "Policy"
  51722. // },
  51723. // "scopes": [
  51724. // "https://www.googleapis.com/auth/cloud-platform",
  51725. // "https://www.googleapis.com/auth/compute"
  51726. // ]
  51727. // }
  51728. }
  51729. // method id "compute.instances.setLabels":
  51730. type InstancesSetLabelsCall struct {
  51731. s *Service
  51732. project string
  51733. zone string
  51734. instance string
  51735. instancessetlabelsrequest *InstancesSetLabelsRequest
  51736. urlParams_ gensupport.URLParams
  51737. ctx_ context.Context
  51738. header_ http.Header
  51739. }
  51740. // SetLabels: Sets labels on an instance. To learn more about labels,
  51741. // read the Labeling Resources documentation.
  51742. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  51743. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51744. c.project = project
  51745. c.zone = zone
  51746. c.instance = instance
  51747. c.instancessetlabelsrequest = instancessetlabelsrequest
  51748. return c
  51749. }
  51750. // RequestId sets the optional parameter "requestId": An optional
  51751. // request ID to identify requests. Specify a unique request ID so that
  51752. // if you must retry your request, the server will know to ignore the
  51753. // request if it has already been completed.
  51754. //
  51755. // For example, consider a situation where you make an initial request
  51756. // and the request times out. If you make the request again with the
  51757. // same request ID, the server can check if original operation with the
  51758. // same request ID was received, and if so, will ignore the second
  51759. // request. This prevents clients from accidentally creating duplicate
  51760. // commitments.
  51761. //
  51762. // The request ID must be a valid UUID with the exception that zero UUID
  51763. // is not supported (00000000-0000-0000-0000-000000000000).
  51764. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  51765. c.urlParams_.Set("requestId", requestId)
  51766. return c
  51767. }
  51768. // Fields allows partial responses to be retrieved. See
  51769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51770. // for more information.
  51771. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  51772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51773. return c
  51774. }
  51775. // Context sets the context to be used in this call's Do method. Any
  51776. // pending HTTP request will be aborted if the provided context is
  51777. // canceled.
  51778. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  51779. c.ctx_ = ctx
  51780. return c
  51781. }
  51782. // Header returns an http.Header that can be modified by the caller to
  51783. // add HTTP headers to the request.
  51784. func (c *InstancesSetLabelsCall) Header() http.Header {
  51785. if c.header_ == nil {
  51786. c.header_ = make(http.Header)
  51787. }
  51788. return c.header_
  51789. }
  51790. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  51791. reqHeaders := make(http.Header)
  51792. for k, v := range c.header_ {
  51793. reqHeaders[k] = v
  51794. }
  51795. reqHeaders.Set("User-Agent", c.s.userAgent())
  51796. var body io.Reader = nil
  51797. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  51798. if err != nil {
  51799. return nil, err
  51800. }
  51801. reqHeaders.Set("Content-Type", "application/json")
  51802. c.urlParams_.Set("alt", alt)
  51803. c.urlParams_.Set("prettyPrint", "false")
  51804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  51805. urls += "?" + c.urlParams_.Encode()
  51806. req, err := http.NewRequest("POST", urls, body)
  51807. if err != nil {
  51808. return nil, err
  51809. }
  51810. req.Header = reqHeaders
  51811. googleapi.Expand(req.URL, map[string]string{
  51812. "project": c.project,
  51813. "zone": c.zone,
  51814. "instance": c.instance,
  51815. })
  51816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51817. }
  51818. // Do executes the "compute.instances.setLabels" call.
  51819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51820. // status code is an error. Response headers are in either
  51821. // *Operation.ServerResponse.Header or (if a response was returned at
  51822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51823. // to check whether the returned error was because
  51824. // http.StatusNotModified was returned.
  51825. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51826. gensupport.SetOptions(c.urlParams_, opts...)
  51827. res, err := c.doRequest("json")
  51828. if res != nil && res.StatusCode == http.StatusNotModified {
  51829. if res.Body != nil {
  51830. res.Body.Close()
  51831. }
  51832. return nil, &googleapi.Error{
  51833. Code: res.StatusCode,
  51834. Header: res.Header,
  51835. }
  51836. }
  51837. if err != nil {
  51838. return nil, err
  51839. }
  51840. defer googleapi.CloseBody(res)
  51841. if err := googleapi.CheckResponse(res); err != nil {
  51842. return nil, err
  51843. }
  51844. ret := &Operation{
  51845. ServerResponse: googleapi.ServerResponse{
  51846. Header: res.Header,
  51847. HTTPStatusCode: res.StatusCode,
  51848. },
  51849. }
  51850. target := &ret
  51851. if err := gensupport.DecodeResponse(target, res); err != nil {
  51852. return nil, err
  51853. }
  51854. return ret, nil
  51855. // {
  51856. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  51857. // "httpMethod": "POST",
  51858. // "id": "compute.instances.setLabels",
  51859. // "parameterOrder": [
  51860. // "project",
  51861. // "zone",
  51862. // "instance"
  51863. // ],
  51864. // "parameters": {
  51865. // "instance": {
  51866. // "description": "Name of the instance scoping this request.",
  51867. // "location": "path",
  51868. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51869. // "required": true,
  51870. // "type": "string"
  51871. // },
  51872. // "project": {
  51873. // "description": "Project ID for this request.",
  51874. // "location": "path",
  51875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51876. // "required": true,
  51877. // "type": "string"
  51878. // },
  51879. // "requestId": {
  51880. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51881. // "location": "query",
  51882. // "type": "string"
  51883. // },
  51884. // "zone": {
  51885. // "description": "The name of the zone for this request.",
  51886. // "location": "path",
  51887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51888. // "required": true,
  51889. // "type": "string"
  51890. // }
  51891. // },
  51892. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  51893. // "request": {
  51894. // "$ref": "InstancesSetLabelsRequest"
  51895. // },
  51896. // "response": {
  51897. // "$ref": "Operation"
  51898. // },
  51899. // "scopes": [
  51900. // "https://www.googleapis.com/auth/cloud-platform",
  51901. // "https://www.googleapis.com/auth/compute"
  51902. // ]
  51903. // }
  51904. }
  51905. // method id "compute.instances.setMachineResources":
  51906. type InstancesSetMachineResourcesCall struct {
  51907. s *Service
  51908. project string
  51909. zone string
  51910. instance string
  51911. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  51912. urlParams_ gensupport.URLParams
  51913. ctx_ context.Context
  51914. header_ http.Header
  51915. }
  51916. // SetMachineResources: Changes the number and/or type of accelerator
  51917. // for a stopped instance to the values specified in the request.
  51918. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  51919. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51920. c.project = project
  51921. c.zone = zone
  51922. c.instance = instance
  51923. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  51924. return c
  51925. }
  51926. // RequestId sets the optional parameter "requestId": An optional
  51927. // request ID to identify requests. Specify a unique request ID so that
  51928. // if you must retry your request, the server will know to ignore the
  51929. // request if it has already been completed.
  51930. //
  51931. // For example, consider a situation where you make an initial request
  51932. // and the request times out. If you make the request again with the
  51933. // same request ID, the server can check if original operation with the
  51934. // same request ID was received, and if so, will ignore the second
  51935. // request. This prevents clients from accidentally creating duplicate
  51936. // commitments.
  51937. //
  51938. // The request ID must be a valid UUID with the exception that zero UUID
  51939. // is not supported (00000000-0000-0000-0000-000000000000).
  51940. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  51941. c.urlParams_.Set("requestId", requestId)
  51942. return c
  51943. }
  51944. // Fields allows partial responses to be retrieved. See
  51945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51946. // for more information.
  51947. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  51948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51949. return c
  51950. }
  51951. // Context sets the context to be used in this call's Do method. Any
  51952. // pending HTTP request will be aborted if the provided context is
  51953. // canceled.
  51954. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  51955. c.ctx_ = ctx
  51956. return c
  51957. }
  51958. // Header returns an http.Header that can be modified by the caller to
  51959. // add HTTP headers to the request.
  51960. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  51961. if c.header_ == nil {
  51962. c.header_ = make(http.Header)
  51963. }
  51964. return c.header_
  51965. }
  51966. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  51967. reqHeaders := make(http.Header)
  51968. for k, v := range c.header_ {
  51969. reqHeaders[k] = v
  51970. }
  51971. reqHeaders.Set("User-Agent", c.s.userAgent())
  51972. var body io.Reader = nil
  51973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  51974. if err != nil {
  51975. return nil, err
  51976. }
  51977. reqHeaders.Set("Content-Type", "application/json")
  51978. c.urlParams_.Set("alt", alt)
  51979. c.urlParams_.Set("prettyPrint", "false")
  51980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  51981. urls += "?" + c.urlParams_.Encode()
  51982. req, err := http.NewRequest("POST", urls, body)
  51983. if err != nil {
  51984. return nil, err
  51985. }
  51986. req.Header = reqHeaders
  51987. googleapi.Expand(req.URL, map[string]string{
  51988. "project": c.project,
  51989. "zone": c.zone,
  51990. "instance": c.instance,
  51991. })
  51992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51993. }
  51994. // Do executes the "compute.instances.setMachineResources" call.
  51995. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51996. // status code is an error. Response headers are in either
  51997. // *Operation.ServerResponse.Header or (if a response was returned at
  51998. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51999. // to check whether the returned error was because
  52000. // http.StatusNotModified was returned.
  52001. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52002. gensupport.SetOptions(c.urlParams_, opts...)
  52003. res, err := c.doRequest("json")
  52004. if res != nil && res.StatusCode == http.StatusNotModified {
  52005. if res.Body != nil {
  52006. res.Body.Close()
  52007. }
  52008. return nil, &googleapi.Error{
  52009. Code: res.StatusCode,
  52010. Header: res.Header,
  52011. }
  52012. }
  52013. if err != nil {
  52014. return nil, err
  52015. }
  52016. defer googleapi.CloseBody(res)
  52017. if err := googleapi.CheckResponse(res); err != nil {
  52018. return nil, err
  52019. }
  52020. ret := &Operation{
  52021. ServerResponse: googleapi.ServerResponse{
  52022. Header: res.Header,
  52023. HTTPStatusCode: res.StatusCode,
  52024. },
  52025. }
  52026. target := &ret
  52027. if err := gensupport.DecodeResponse(target, res); err != nil {
  52028. return nil, err
  52029. }
  52030. return ret, nil
  52031. // {
  52032. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  52033. // "httpMethod": "POST",
  52034. // "id": "compute.instances.setMachineResources",
  52035. // "parameterOrder": [
  52036. // "project",
  52037. // "zone",
  52038. // "instance"
  52039. // ],
  52040. // "parameters": {
  52041. // "instance": {
  52042. // "description": "Name of the instance scoping this request.",
  52043. // "location": "path",
  52044. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52045. // "required": true,
  52046. // "type": "string"
  52047. // },
  52048. // "project": {
  52049. // "description": "Project ID for this request.",
  52050. // "location": "path",
  52051. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52052. // "required": true,
  52053. // "type": "string"
  52054. // },
  52055. // "requestId": {
  52056. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52057. // "location": "query",
  52058. // "type": "string"
  52059. // },
  52060. // "zone": {
  52061. // "description": "The name of the zone for this request.",
  52062. // "location": "path",
  52063. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52064. // "required": true,
  52065. // "type": "string"
  52066. // }
  52067. // },
  52068. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  52069. // "request": {
  52070. // "$ref": "InstancesSetMachineResourcesRequest"
  52071. // },
  52072. // "response": {
  52073. // "$ref": "Operation"
  52074. // },
  52075. // "scopes": [
  52076. // "https://www.googleapis.com/auth/cloud-platform",
  52077. // "https://www.googleapis.com/auth/compute"
  52078. // ]
  52079. // }
  52080. }
  52081. // method id "compute.instances.setMachineType":
  52082. type InstancesSetMachineTypeCall struct {
  52083. s *Service
  52084. project string
  52085. zone string
  52086. instance string
  52087. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  52088. urlParams_ gensupport.URLParams
  52089. ctx_ context.Context
  52090. header_ http.Header
  52091. }
  52092. // SetMachineType: Changes the machine type for a stopped instance to
  52093. // the machine type specified in the request.
  52094. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  52095. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52096. c.project = project
  52097. c.zone = zone
  52098. c.instance = instance
  52099. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  52100. return c
  52101. }
  52102. // RequestId sets the optional parameter "requestId": An optional
  52103. // request ID to identify requests. Specify a unique request ID so that
  52104. // if you must retry your request, the server will know to ignore the
  52105. // request if it has already been completed.
  52106. //
  52107. // For example, consider a situation where you make an initial request
  52108. // and the request times out. If you make the request again with the
  52109. // same request ID, the server can check if original operation with the
  52110. // same request ID was received, and if so, will ignore the second
  52111. // request. This prevents clients from accidentally creating duplicate
  52112. // commitments.
  52113. //
  52114. // The request ID must be a valid UUID with the exception that zero UUID
  52115. // is not supported (00000000-0000-0000-0000-000000000000).
  52116. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  52117. c.urlParams_.Set("requestId", requestId)
  52118. return c
  52119. }
  52120. // Fields allows partial responses to be retrieved. See
  52121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52122. // for more information.
  52123. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  52124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52125. return c
  52126. }
  52127. // Context sets the context to be used in this call's Do method. Any
  52128. // pending HTTP request will be aborted if the provided context is
  52129. // canceled.
  52130. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  52131. c.ctx_ = ctx
  52132. return c
  52133. }
  52134. // Header returns an http.Header that can be modified by the caller to
  52135. // add HTTP headers to the request.
  52136. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  52137. if c.header_ == nil {
  52138. c.header_ = make(http.Header)
  52139. }
  52140. return c.header_
  52141. }
  52142. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  52143. reqHeaders := make(http.Header)
  52144. for k, v := range c.header_ {
  52145. reqHeaders[k] = v
  52146. }
  52147. reqHeaders.Set("User-Agent", c.s.userAgent())
  52148. var body io.Reader = nil
  52149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  52150. if err != nil {
  52151. return nil, err
  52152. }
  52153. reqHeaders.Set("Content-Type", "application/json")
  52154. c.urlParams_.Set("alt", alt)
  52155. c.urlParams_.Set("prettyPrint", "false")
  52156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  52157. urls += "?" + c.urlParams_.Encode()
  52158. req, err := http.NewRequest("POST", urls, body)
  52159. if err != nil {
  52160. return nil, err
  52161. }
  52162. req.Header = reqHeaders
  52163. googleapi.Expand(req.URL, map[string]string{
  52164. "project": c.project,
  52165. "zone": c.zone,
  52166. "instance": c.instance,
  52167. })
  52168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52169. }
  52170. // Do executes the "compute.instances.setMachineType" call.
  52171. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52172. // status code is an error. Response headers are in either
  52173. // *Operation.ServerResponse.Header or (if a response was returned at
  52174. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52175. // to check whether the returned error was because
  52176. // http.StatusNotModified was returned.
  52177. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52178. gensupport.SetOptions(c.urlParams_, opts...)
  52179. res, err := c.doRequest("json")
  52180. if res != nil && res.StatusCode == http.StatusNotModified {
  52181. if res.Body != nil {
  52182. res.Body.Close()
  52183. }
  52184. return nil, &googleapi.Error{
  52185. Code: res.StatusCode,
  52186. Header: res.Header,
  52187. }
  52188. }
  52189. if err != nil {
  52190. return nil, err
  52191. }
  52192. defer googleapi.CloseBody(res)
  52193. if err := googleapi.CheckResponse(res); err != nil {
  52194. return nil, err
  52195. }
  52196. ret := &Operation{
  52197. ServerResponse: googleapi.ServerResponse{
  52198. Header: res.Header,
  52199. HTTPStatusCode: res.StatusCode,
  52200. },
  52201. }
  52202. target := &ret
  52203. if err := gensupport.DecodeResponse(target, res); err != nil {
  52204. return nil, err
  52205. }
  52206. return ret, nil
  52207. // {
  52208. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  52209. // "httpMethod": "POST",
  52210. // "id": "compute.instances.setMachineType",
  52211. // "parameterOrder": [
  52212. // "project",
  52213. // "zone",
  52214. // "instance"
  52215. // ],
  52216. // "parameters": {
  52217. // "instance": {
  52218. // "description": "Name of the instance scoping this request.",
  52219. // "location": "path",
  52220. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52221. // "required": true,
  52222. // "type": "string"
  52223. // },
  52224. // "project": {
  52225. // "description": "Project ID for this request.",
  52226. // "location": "path",
  52227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52228. // "required": true,
  52229. // "type": "string"
  52230. // },
  52231. // "requestId": {
  52232. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52233. // "location": "query",
  52234. // "type": "string"
  52235. // },
  52236. // "zone": {
  52237. // "description": "The name of the zone for this request.",
  52238. // "location": "path",
  52239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52240. // "required": true,
  52241. // "type": "string"
  52242. // }
  52243. // },
  52244. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  52245. // "request": {
  52246. // "$ref": "InstancesSetMachineTypeRequest"
  52247. // },
  52248. // "response": {
  52249. // "$ref": "Operation"
  52250. // },
  52251. // "scopes": [
  52252. // "https://www.googleapis.com/auth/cloud-platform",
  52253. // "https://www.googleapis.com/auth/compute"
  52254. // ]
  52255. // }
  52256. }
  52257. // method id "compute.instances.setMetadata":
  52258. type InstancesSetMetadataCall struct {
  52259. s *Service
  52260. project string
  52261. zone string
  52262. instance string
  52263. metadata *Metadata
  52264. urlParams_ gensupport.URLParams
  52265. ctx_ context.Context
  52266. header_ http.Header
  52267. }
  52268. // SetMetadata: Sets metadata for the specified instance to the data
  52269. // included in the request.
  52270. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  52271. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  52272. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52273. c.project = project
  52274. c.zone = zone
  52275. c.instance = instance
  52276. c.metadata = metadata
  52277. return c
  52278. }
  52279. // RequestId sets the optional parameter "requestId": An optional
  52280. // request ID to identify requests. Specify a unique request ID so that
  52281. // if you must retry your request, the server will know to ignore the
  52282. // request if it has already been completed.
  52283. //
  52284. // For example, consider a situation where you make an initial request
  52285. // and the request times out. If you make the request again with the
  52286. // same request ID, the server can check if original operation with the
  52287. // same request ID was received, and if so, will ignore the second
  52288. // request. This prevents clients from accidentally creating duplicate
  52289. // commitments.
  52290. //
  52291. // The request ID must be a valid UUID with the exception that zero UUID
  52292. // is not supported (00000000-0000-0000-0000-000000000000).
  52293. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  52294. c.urlParams_.Set("requestId", requestId)
  52295. return c
  52296. }
  52297. // Fields allows partial responses to be retrieved. See
  52298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52299. // for more information.
  52300. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  52301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52302. return c
  52303. }
  52304. // Context sets the context to be used in this call's Do method. Any
  52305. // pending HTTP request will be aborted if the provided context is
  52306. // canceled.
  52307. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  52308. c.ctx_ = ctx
  52309. return c
  52310. }
  52311. // Header returns an http.Header that can be modified by the caller to
  52312. // add HTTP headers to the request.
  52313. func (c *InstancesSetMetadataCall) Header() http.Header {
  52314. if c.header_ == nil {
  52315. c.header_ = make(http.Header)
  52316. }
  52317. return c.header_
  52318. }
  52319. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  52320. reqHeaders := make(http.Header)
  52321. for k, v := range c.header_ {
  52322. reqHeaders[k] = v
  52323. }
  52324. reqHeaders.Set("User-Agent", c.s.userAgent())
  52325. var body io.Reader = nil
  52326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  52327. if err != nil {
  52328. return nil, err
  52329. }
  52330. reqHeaders.Set("Content-Type", "application/json")
  52331. c.urlParams_.Set("alt", alt)
  52332. c.urlParams_.Set("prettyPrint", "false")
  52333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  52334. urls += "?" + c.urlParams_.Encode()
  52335. req, err := http.NewRequest("POST", urls, body)
  52336. if err != nil {
  52337. return nil, err
  52338. }
  52339. req.Header = reqHeaders
  52340. googleapi.Expand(req.URL, map[string]string{
  52341. "project": c.project,
  52342. "zone": c.zone,
  52343. "instance": c.instance,
  52344. })
  52345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52346. }
  52347. // Do executes the "compute.instances.setMetadata" call.
  52348. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52349. // status code is an error. Response headers are in either
  52350. // *Operation.ServerResponse.Header or (if a response was returned at
  52351. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52352. // to check whether the returned error was because
  52353. // http.StatusNotModified was returned.
  52354. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52355. gensupport.SetOptions(c.urlParams_, opts...)
  52356. res, err := c.doRequest("json")
  52357. if res != nil && res.StatusCode == http.StatusNotModified {
  52358. if res.Body != nil {
  52359. res.Body.Close()
  52360. }
  52361. return nil, &googleapi.Error{
  52362. Code: res.StatusCode,
  52363. Header: res.Header,
  52364. }
  52365. }
  52366. if err != nil {
  52367. return nil, err
  52368. }
  52369. defer googleapi.CloseBody(res)
  52370. if err := googleapi.CheckResponse(res); err != nil {
  52371. return nil, err
  52372. }
  52373. ret := &Operation{
  52374. ServerResponse: googleapi.ServerResponse{
  52375. Header: res.Header,
  52376. HTTPStatusCode: res.StatusCode,
  52377. },
  52378. }
  52379. target := &ret
  52380. if err := gensupport.DecodeResponse(target, res); err != nil {
  52381. return nil, err
  52382. }
  52383. return ret, nil
  52384. // {
  52385. // "description": "Sets metadata for the specified instance to the data included in the request.",
  52386. // "httpMethod": "POST",
  52387. // "id": "compute.instances.setMetadata",
  52388. // "parameterOrder": [
  52389. // "project",
  52390. // "zone",
  52391. // "instance"
  52392. // ],
  52393. // "parameters": {
  52394. // "instance": {
  52395. // "description": "Name of the instance scoping this request.",
  52396. // "location": "path",
  52397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52398. // "required": true,
  52399. // "type": "string"
  52400. // },
  52401. // "project": {
  52402. // "description": "Project ID for this request.",
  52403. // "location": "path",
  52404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52405. // "required": true,
  52406. // "type": "string"
  52407. // },
  52408. // "requestId": {
  52409. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52410. // "location": "query",
  52411. // "type": "string"
  52412. // },
  52413. // "zone": {
  52414. // "description": "The name of the zone for this request.",
  52415. // "location": "path",
  52416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52417. // "required": true,
  52418. // "type": "string"
  52419. // }
  52420. // },
  52421. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  52422. // "request": {
  52423. // "$ref": "Metadata"
  52424. // },
  52425. // "response": {
  52426. // "$ref": "Operation"
  52427. // },
  52428. // "scopes": [
  52429. // "https://www.googleapis.com/auth/cloud-platform",
  52430. // "https://www.googleapis.com/auth/compute"
  52431. // ]
  52432. // }
  52433. }
  52434. // method id "compute.instances.setMinCpuPlatform":
  52435. type InstancesSetMinCpuPlatformCall struct {
  52436. s *Service
  52437. project string
  52438. zone string
  52439. instance string
  52440. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  52441. urlParams_ gensupport.URLParams
  52442. ctx_ context.Context
  52443. header_ http.Header
  52444. }
  52445. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  52446. // instance should use. This method can only be called on a stopped
  52447. // instance. For more information, read Specifying a Minimum CPU
  52448. // Platform.
  52449. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  52450. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52451. c.project = project
  52452. c.zone = zone
  52453. c.instance = instance
  52454. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  52455. return c
  52456. }
  52457. // RequestId sets the optional parameter "requestId": An optional
  52458. // request ID to identify requests. Specify a unique request ID so that
  52459. // if you must retry your request, the server will know to ignore the
  52460. // request if it has already been completed.
  52461. //
  52462. // For example, consider a situation where you make an initial request
  52463. // and the request times out. If you make the request again with the
  52464. // same request ID, the server can check if original operation with the
  52465. // same request ID was received, and if so, will ignore the second
  52466. // request. This prevents clients from accidentally creating duplicate
  52467. // commitments.
  52468. //
  52469. // The request ID must be a valid UUID with the exception that zero UUID
  52470. // is not supported (00000000-0000-0000-0000-000000000000).
  52471. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  52472. c.urlParams_.Set("requestId", requestId)
  52473. return c
  52474. }
  52475. // Fields allows partial responses to be retrieved. See
  52476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52477. // for more information.
  52478. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  52479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52480. return c
  52481. }
  52482. // Context sets the context to be used in this call's Do method. Any
  52483. // pending HTTP request will be aborted if the provided context is
  52484. // canceled.
  52485. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  52486. c.ctx_ = ctx
  52487. return c
  52488. }
  52489. // Header returns an http.Header that can be modified by the caller to
  52490. // add HTTP headers to the request.
  52491. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  52492. if c.header_ == nil {
  52493. c.header_ = make(http.Header)
  52494. }
  52495. return c.header_
  52496. }
  52497. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  52498. reqHeaders := make(http.Header)
  52499. for k, v := range c.header_ {
  52500. reqHeaders[k] = v
  52501. }
  52502. reqHeaders.Set("User-Agent", c.s.userAgent())
  52503. var body io.Reader = nil
  52504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  52505. if err != nil {
  52506. return nil, err
  52507. }
  52508. reqHeaders.Set("Content-Type", "application/json")
  52509. c.urlParams_.Set("alt", alt)
  52510. c.urlParams_.Set("prettyPrint", "false")
  52511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  52512. urls += "?" + c.urlParams_.Encode()
  52513. req, err := http.NewRequest("POST", urls, body)
  52514. if err != nil {
  52515. return nil, err
  52516. }
  52517. req.Header = reqHeaders
  52518. googleapi.Expand(req.URL, map[string]string{
  52519. "project": c.project,
  52520. "zone": c.zone,
  52521. "instance": c.instance,
  52522. })
  52523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52524. }
  52525. // Do executes the "compute.instances.setMinCpuPlatform" call.
  52526. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52527. // status code is an error. Response headers are in either
  52528. // *Operation.ServerResponse.Header or (if a response was returned at
  52529. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52530. // to check whether the returned error was because
  52531. // http.StatusNotModified was returned.
  52532. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52533. gensupport.SetOptions(c.urlParams_, opts...)
  52534. res, err := c.doRequest("json")
  52535. if res != nil && res.StatusCode == http.StatusNotModified {
  52536. if res.Body != nil {
  52537. res.Body.Close()
  52538. }
  52539. return nil, &googleapi.Error{
  52540. Code: res.StatusCode,
  52541. Header: res.Header,
  52542. }
  52543. }
  52544. if err != nil {
  52545. return nil, err
  52546. }
  52547. defer googleapi.CloseBody(res)
  52548. if err := googleapi.CheckResponse(res); err != nil {
  52549. return nil, err
  52550. }
  52551. ret := &Operation{
  52552. ServerResponse: googleapi.ServerResponse{
  52553. Header: res.Header,
  52554. HTTPStatusCode: res.StatusCode,
  52555. },
  52556. }
  52557. target := &ret
  52558. if err := gensupport.DecodeResponse(target, res); err != nil {
  52559. return nil, err
  52560. }
  52561. return ret, nil
  52562. // {
  52563. // "description": "Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.",
  52564. // "httpMethod": "POST",
  52565. // "id": "compute.instances.setMinCpuPlatform",
  52566. // "parameterOrder": [
  52567. // "project",
  52568. // "zone",
  52569. // "instance"
  52570. // ],
  52571. // "parameters": {
  52572. // "instance": {
  52573. // "description": "Name of the instance scoping this request.",
  52574. // "location": "path",
  52575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52576. // "required": true,
  52577. // "type": "string"
  52578. // },
  52579. // "project": {
  52580. // "description": "Project ID for this request.",
  52581. // "location": "path",
  52582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52583. // "required": true,
  52584. // "type": "string"
  52585. // },
  52586. // "requestId": {
  52587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52588. // "location": "query",
  52589. // "type": "string"
  52590. // },
  52591. // "zone": {
  52592. // "description": "The name of the zone for this request.",
  52593. // "location": "path",
  52594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52595. // "required": true,
  52596. // "type": "string"
  52597. // }
  52598. // },
  52599. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  52600. // "request": {
  52601. // "$ref": "InstancesSetMinCpuPlatformRequest"
  52602. // },
  52603. // "response": {
  52604. // "$ref": "Operation"
  52605. // },
  52606. // "scopes": [
  52607. // "https://www.googleapis.com/auth/cloud-platform",
  52608. // "https://www.googleapis.com/auth/compute"
  52609. // ]
  52610. // }
  52611. }
  52612. // method id "compute.instances.setScheduling":
  52613. type InstancesSetSchedulingCall struct {
  52614. s *Service
  52615. project string
  52616. zone string
  52617. instance string
  52618. scheduling *Scheduling
  52619. urlParams_ gensupport.URLParams
  52620. ctx_ context.Context
  52621. header_ http.Header
  52622. }
  52623. // SetScheduling: Sets an instance's scheduling options.
  52624. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  52625. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  52626. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52627. c.project = project
  52628. c.zone = zone
  52629. c.instance = instance
  52630. c.scheduling = scheduling
  52631. return c
  52632. }
  52633. // RequestId sets the optional parameter "requestId": An optional
  52634. // request ID to identify requests. Specify a unique request ID so that
  52635. // if you must retry your request, the server will know to ignore the
  52636. // request if it has already been completed.
  52637. //
  52638. // For example, consider a situation where you make an initial request
  52639. // and the request times out. If you make the request again with the
  52640. // same request ID, the server can check if original operation with the
  52641. // same request ID was received, and if so, will ignore the second
  52642. // request. This prevents clients from accidentally creating duplicate
  52643. // commitments.
  52644. //
  52645. // The request ID must be a valid UUID with the exception that zero UUID
  52646. // is not supported (00000000-0000-0000-0000-000000000000).
  52647. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  52648. c.urlParams_.Set("requestId", requestId)
  52649. return c
  52650. }
  52651. // Fields allows partial responses to be retrieved. See
  52652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52653. // for more information.
  52654. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  52655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52656. return c
  52657. }
  52658. // Context sets the context to be used in this call's Do method. Any
  52659. // pending HTTP request will be aborted if the provided context is
  52660. // canceled.
  52661. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  52662. c.ctx_ = ctx
  52663. return c
  52664. }
  52665. // Header returns an http.Header that can be modified by the caller to
  52666. // add HTTP headers to the request.
  52667. func (c *InstancesSetSchedulingCall) Header() http.Header {
  52668. if c.header_ == nil {
  52669. c.header_ = make(http.Header)
  52670. }
  52671. return c.header_
  52672. }
  52673. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  52674. reqHeaders := make(http.Header)
  52675. for k, v := range c.header_ {
  52676. reqHeaders[k] = v
  52677. }
  52678. reqHeaders.Set("User-Agent", c.s.userAgent())
  52679. var body io.Reader = nil
  52680. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  52681. if err != nil {
  52682. return nil, err
  52683. }
  52684. reqHeaders.Set("Content-Type", "application/json")
  52685. c.urlParams_.Set("alt", alt)
  52686. c.urlParams_.Set("prettyPrint", "false")
  52687. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  52688. urls += "?" + c.urlParams_.Encode()
  52689. req, err := http.NewRequest("POST", urls, body)
  52690. if err != nil {
  52691. return nil, err
  52692. }
  52693. req.Header = reqHeaders
  52694. googleapi.Expand(req.URL, map[string]string{
  52695. "project": c.project,
  52696. "zone": c.zone,
  52697. "instance": c.instance,
  52698. })
  52699. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52700. }
  52701. // Do executes the "compute.instances.setScheduling" call.
  52702. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52703. // status code is an error. Response headers are in either
  52704. // *Operation.ServerResponse.Header or (if a response was returned at
  52705. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52706. // to check whether the returned error was because
  52707. // http.StatusNotModified was returned.
  52708. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52709. gensupport.SetOptions(c.urlParams_, opts...)
  52710. res, err := c.doRequest("json")
  52711. if res != nil && res.StatusCode == http.StatusNotModified {
  52712. if res.Body != nil {
  52713. res.Body.Close()
  52714. }
  52715. return nil, &googleapi.Error{
  52716. Code: res.StatusCode,
  52717. Header: res.Header,
  52718. }
  52719. }
  52720. if err != nil {
  52721. return nil, err
  52722. }
  52723. defer googleapi.CloseBody(res)
  52724. if err := googleapi.CheckResponse(res); err != nil {
  52725. return nil, err
  52726. }
  52727. ret := &Operation{
  52728. ServerResponse: googleapi.ServerResponse{
  52729. Header: res.Header,
  52730. HTTPStatusCode: res.StatusCode,
  52731. },
  52732. }
  52733. target := &ret
  52734. if err := gensupport.DecodeResponse(target, res); err != nil {
  52735. return nil, err
  52736. }
  52737. return ret, nil
  52738. // {
  52739. // "description": "Sets an instance's scheduling options.",
  52740. // "httpMethod": "POST",
  52741. // "id": "compute.instances.setScheduling",
  52742. // "parameterOrder": [
  52743. // "project",
  52744. // "zone",
  52745. // "instance"
  52746. // ],
  52747. // "parameters": {
  52748. // "instance": {
  52749. // "description": "Instance name for this request.",
  52750. // "location": "path",
  52751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52752. // "required": true,
  52753. // "type": "string"
  52754. // },
  52755. // "project": {
  52756. // "description": "Project ID for this request.",
  52757. // "location": "path",
  52758. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52759. // "required": true,
  52760. // "type": "string"
  52761. // },
  52762. // "requestId": {
  52763. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52764. // "location": "query",
  52765. // "type": "string"
  52766. // },
  52767. // "zone": {
  52768. // "description": "The name of the zone for this request.",
  52769. // "location": "path",
  52770. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52771. // "required": true,
  52772. // "type": "string"
  52773. // }
  52774. // },
  52775. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  52776. // "request": {
  52777. // "$ref": "Scheduling"
  52778. // },
  52779. // "response": {
  52780. // "$ref": "Operation"
  52781. // },
  52782. // "scopes": [
  52783. // "https://www.googleapis.com/auth/cloud-platform",
  52784. // "https://www.googleapis.com/auth/compute"
  52785. // ]
  52786. // }
  52787. }
  52788. // method id "compute.instances.setServiceAccount":
  52789. type InstancesSetServiceAccountCall struct {
  52790. s *Service
  52791. project string
  52792. zone string
  52793. instance string
  52794. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  52795. urlParams_ gensupport.URLParams
  52796. ctx_ context.Context
  52797. header_ http.Header
  52798. }
  52799. // SetServiceAccount: Sets the service account on the instance. For more
  52800. // information, read Changing the service account and access scopes for
  52801. // an instance.
  52802. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  52803. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52804. c.project = project
  52805. c.zone = zone
  52806. c.instance = instance
  52807. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  52808. return c
  52809. }
  52810. // RequestId sets the optional parameter "requestId": An optional
  52811. // request ID to identify requests. Specify a unique request ID so that
  52812. // if you must retry your request, the server will know to ignore the
  52813. // request if it has already been completed.
  52814. //
  52815. // For example, consider a situation where you make an initial request
  52816. // and the request times out. If you make the request again with the
  52817. // same request ID, the server can check if original operation with the
  52818. // same request ID was received, and if so, will ignore the second
  52819. // request. This prevents clients from accidentally creating duplicate
  52820. // commitments.
  52821. //
  52822. // The request ID must be a valid UUID with the exception that zero UUID
  52823. // is not supported (00000000-0000-0000-0000-000000000000).
  52824. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  52825. c.urlParams_.Set("requestId", requestId)
  52826. return c
  52827. }
  52828. // Fields allows partial responses to be retrieved. See
  52829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52830. // for more information.
  52831. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  52832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52833. return c
  52834. }
  52835. // Context sets the context to be used in this call's Do method. Any
  52836. // pending HTTP request will be aborted if the provided context is
  52837. // canceled.
  52838. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  52839. c.ctx_ = ctx
  52840. return c
  52841. }
  52842. // Header returns an http.Header that can be modified by the caller to
  52843. // add HTTP headers to the request.
  52844. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  52845. if c.header_ == nil {
  52846. c.header_ = make(http.Header)
  52847. }
  52848. return c.header_
  52849. }
  52850. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  52851. reqHeaders := make(http.Header)
  52852. for k, v := range c.header_ {
  52853. reqHeaders[k] = v
  52854. }
  52855. reqHeaders.Set("User-Agent", c.s.userAgent())
  52856. var body io.Reader = nil
  52857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  52858. if err != nil {
  52859. return nil, err
  52860. }
  52861. reqHeaders.Set("Content-Type", "application/json")
  52862. c.urlParams_.Set("alt", alt)
  52863. c.urlParams_.Set("prettyPrint", "false")
  52864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  52865. urls += "?" + c.urlParams_.Encode()
  52866. req, err := http.NewRequest("POST", urls, body)
  52867. if err != nil {
  52868. return nil, err
  52869. }
  52870. req.Header = reqHeaders
  52871. googleapi.Expand(req.URL, map[string]string{
  52872. "project": c.project,
  52873. "zone": c.zone,
  52874. "instance": c.instance,
  52875. })
  52876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52877. }
  52878. // Do executes the "compute.instances.setServiceAccount" call.
  52879. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52880. // status code is an error. Response headers are in either
  52881. // *Operation.ServerResponse.Header or (if a response was returned at
  52882. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52883. // to check whether the returned error was because
  52884. // http.StatusNotModified was returned.
  52885. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52886. gensupport.SetOptions(c.urlParams_, opts...)
  52887. res, err := c.doRequest("json")
  52888. if res != nil && res.StatusCode == http.StatusNotModified {
  52889. if res.Body != nil {
  52890. res.Body.Close()
  52891. }
  52892. return nil, &googleapi.Error{
  52893. Code: res.StatusCode,
  52894. Header: res.Header,
  52895. }
  52896. }
  52897. if err != nil {
  52898. return nil, err
  52899. }
  52900. defer googleapi.CloseBody(res)
  52901. if err := googleapi.CheckResponse(res); err != nil {
  52902. return nil, err
  52903. }
  52904. ret := &Operation{
  52905. ServerResponse: googleapi.ServerResponse{
  52906. Header: res.Header,
  52907. HTTPStatusCode: res.StatusCode,
  52908. },
  52909. }
  52910. target := &ret
  52911. if err := gensupport.DecodeResponse(target, res); err != nil {
  52912. return nil, err
  52913. }
  52914. return ret, nil
  52915. // {
  52916. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  52917. // "httpMethod": "POST",
  52918. // "id": "compute.instances.setServiceAccount",
  52919. // "parameterOrder": [
  52920. // "project",
  52921. // "zone",
  52922. // "instance"
  52923. // ],
  52924. // "parameters": {
  52925. // "instance": {
  52926. // "description": "Name of the instance resource to start.",
  52927. // "location": "path",
  52928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52929. // "required": true,
  52930. // "type": "string"
  52931. // },
  52932. // "project": {
  52933. // "description": "Project ID for this request.",
  52934. // "location": "path",
  52935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52936. // "required": true,
  52937. // "type": "string"
  52938. // },
  52939. // "requestId": {
  52940. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52941. // "location": "query",
  52942. // "type": "string"
  52943. // },
  52944. // "zone": {
  52945. // "description": "The name of the zone for this request.",
  52946. // "location": "path",
  52947. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52948. // "required": true,
  52949. // "type": "string"
  52950. // }
  52951. // },
  52952. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  52953. // "request": {
  52954. // "$ref": "InstancesSetServiceAccountRequest"
  52955. // },
  52956. // "response": {
  52957. // "$ref": "Operation"
  52958. // },
  52959. // "scopes": [
  52960. // "https://www.googleapis.com/auth/cloud-platform",
  52961. // "https://www.googleapis.com/auth/compute"
  52962. // ]
  52963. // }
  52964. }
  52965. // method id "compute.instances.setTags":
  52966. type InstancesSetTagsCall struct {
  52967. s *Service
  52968. project string
  52969. zone string
  52970. instance string
  52971. tags *Tags
  52972. urlParams_ gensupport.URLParams
  52973. ctx_ context.Context
  52974. header_ http.Header
  52975. }
  52976. // SetTags: Sets network tags for the specified instance to the data
  52977. // included in the request.
  52978. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  52979. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  52980. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52981. c.project = project
  52982. c.zone = zone
  52983. c.instance = instance
  52984. c.tags = tags
  52985. return c
  52986. }
  52987. // RequestId sets the optional parameter "requestId": An optional
  52988. // request ID to identify requests. Specify a unique request ID so that
  52989. // if you must retry your request, the server will know to ignore the
  52990. // request if it has already been completed.
  52991. //
  52992. // For example, consider a situation where you make an initial request
  52993. // and the request times out. If you make the request again with the
  52994. // same request ID, the server can check if original operation with the
  52995. // same request ID was received, and if so, will ignore the second
  52996. // request. This prevents clients from accidentally creating duplicate
  52997. // commitments.
  52998. //
  52999. // The request ID must be a valid UUID with the exception that zero UUID
  53000. // is not supported (00000000-0000-0000-0000-000000000000).
  53001. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  53002. c.urlParams_.Set("requestId", requestId)
  53003. return c
  53004. }
  53005. // Fields allows partial responses to be retrieved. See
  53006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53007. // for more information.
  53008. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  53009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53010. return c
  53011. }
  53012. // Context sets the context to be used in this call's Do method. Any
  53013. // pending HTTP request will be aborted if the provided context is
  53014. // canceled.
  53015. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  53016. c.ctx_ = ctx
  53017. return c
  53018. }
  53019. // Header returns an http.Header that can be modified by the caller to
  53020. // add HTTP headers to the request.
  53021. func (c *InstancesSetTagsCall) Header() http.Header {
  53022. if c.header_ == nil {
  53023. c.header_ = make(http.Header)
  53024. }
  53025. return c.header_
  53026. }
  53027. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  53028. reqHeaders := make(http.Header)
  53029. for k, v := range c.header_ {
  53030. reqHeaders[k] = v
  53031. }
  53032. reqHeaders.Set("User-Agent", c.s.userAgent())
  53033. var body io.Reader = nil
  53034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  53035. if err != nil {
  53036. return nil, err
  53037. }
  53038. reqHeaders.Set("Content-Type", "application/json")
  53039. c.urlParams_.Set("alt", alt)
  53040. c.urlParams_.Set("prettyPrint", "false")
  53041. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  53042. urls += "?" + c.urlParams_.Encode()
  53043. req, err := http.NewRequest("POST", urls, body)
  53044. if err != nil {
  53045. return nil, err
  53046. }
  53047. req.Header = reqHeaders
  53048. googleapi.Expand(req.URL, map[string]string{
  53049. "project": c.project,
  53050. "zone": c.zone,
  53051. "instance": c.instance,
  53052. })
  53053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53054. }
  53055. // Do executes the "compute.instances.setTags" call.
  53056. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53057. // status code is an error. Response headers are in either
  53058. // *Operation.ServerResponse.Header or (if a response was returned at
  53059. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53060. // to check whether the returned error was because
  53061. // http.StatusNotModified was returned.
  53062. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53063. gensupport.SetOptions(c.urlParams_, opts...)
  53064. res, err := c.doRequest("json")
  53065. if res != nil && res.StatusCode == http.StatusNotModified {
  53066. if res.Body != nil {
  53067. res.Body.Close()
  53068. }
  53069. return nil, &googleapi.Error{
  53070. Code: res.StatusCode,
  53071. Header: res.Header,
  53072. }
  53073. }
  53074. if err != nil {
  53075. return nil, err
  53076. }
  53077. defer googleapi.CloseBody(res)
  53078. if err := googleapi.CheckResponse(res); err != nil {
  53079. return nil, err
  53080. }
  53081. ret := &Operation{
  53082. ServerResponse: googleapi.ServerResponse{
  53083. Header: res.Header,
  53084. HTTPStatusCode: res.StatusCode,
  53085. },
  53086. }
  53087. target := &ret
  53088. if err := gensupport.DecodeResponse(target, res); err != nil {
  53089. return nil, err
  53090. }
  53091. return ret, nil
  53092. // {
  53093. // "description": "Sets network tags for the specified instance to the data included in the request.",
  53094. // "httpMethod": "POST",
  53095. // "id": "compute.instances.setTags",
  53096. // "parameterOrder": [
  53097. // "project",
  53098. // "zone",
  53099. // "instance"
  53100. // ],
  53101. // "parameters": {
  53102. // "instance": {
  53103. // "description": "Name of the instance scoping this request.",
  53104. // "location": "path",
  53105. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53106. // "required": true,
  53107. // "type": "string"
  53108. // },
  53109. // "project": {
  53110. // "description": "Project ID for this request.",
  53111. // "location": "path",
  53112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53113. // "required": true,
  53114. // "type": "string"
  53115. // },
  53116. // "requestId": {
  53117. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53118. // "location": "query",
  53119. // "type": "string"
  53120. // },
  53121. // "zone": {
  53122. // "description": "The name of the zone for this request.",
  53123. // "location": "path",
  53124. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53125. // "required": true,
  53126. // "type": "string"
  53127. // }
  53128. // },
  53129. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  53130. // "request": {
  53131. // "$ref": "Tags"
  53132. // },
  53133. // "response": {
  53134. // "$ref": "Operation"
  53135. // },
  53136. // "scopes": [
  53137. // "https://www.googleapis.com/auth/cloud-platform",
  53138. // "https://www.googleapis.com/auth/compute"
  53139. // ]
  53140. // }
  53141. }
  53142. // method id "compute.instances.simulateMaintenanceEvent":
  53143. type InstancesSimulateMaintenanceEventCall struct {
  53144. s *Service
  53145. project string
  53146. zone string
  53147. instance string
  53148. urlParams_ gensupport.URLParams
  53149. ctx_ context.Context
  53150. header_ http.Header
  53151. }
  53152. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  53153. // instance.
  53154. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  53155. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53156. c.project = project
  53157. c.zone = zone
  53158. c.instance = instance
  53159. return c
  53160. }
  53161. // Fields allows partial responses to be retrieved. See
  53162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53163. // for more information.
  53164. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  53165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53166. return c
  53167. }
  53168. // Context sets the context to be used in this call's Do method. Any
  53169. // pending HTTP request will be aborted if the provided context is
  53170. // canceled.
  53171. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  53172. c.ctx_ = ctx
  53173. return c
  53174. }
  53175. // Header returns an http.Header that can be modified by the caller to
  53176. // add HTTP headers to the request.
  53177. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  53178. if c.header_ == nil {
  53179. c.header_ = make(http.Header)
  53180. }
  53181. return c.header_
  53182. }
  53183. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  53184. reqHeaders := make(http.Header)
  53185. for k, v := range c.header_ {
  53186. reqHeaders[k] = v
  53187. }
  53188. reqHeaders.Set("User-Agent", c.s.userAgent())
  53189. var body io.Reader = nil
  53190. c.urlParams_.Set("alt", alt)
  53191. c.urlParams_.Set("prettyPrint", "false")
  53192. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  53193. urls += "?" + c.urlParams_.Encode()
  53194. req, err := http.NewRequest("POST", urls, body)
  53195. if err != nil {
  53196. return nil, err
  53197. }
  53198. req.Header = reqHeaders
  53199. googleapi.Expand(req.URL, map[string]string{
  53200. "project": c.project,
  53201. "zone": c.zone,
  53202. "instance": c.instance,
  53203. })
  53204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53205. }
  53206. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  53207. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53208. // status code is an error. Response headers are in either
  53209. // *Operation.ServerResponse.Header or (if a response was returned at
  53210. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53211. // to check whether the returned error was because
  53212. // http.StatusNotModified was returned.
  53213. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53214. gensupport.SetOptions(c.urlParams_, opts...)
  53215. res, err := c.doRequest("json")
  53216. if res != nil && res.StatusCode == http.StatusNotModified {
  53217. if res.Body != nil {
  53218. res.Body.Close()
  53219. }
  53220. return nil, &googleapi.Error{
  53221. Code: res.StatusCode,
  53222. Header: res.Header,
  53223. }
  53224. }
  53225. if err != nil {
  53226. return nil, err
  53227. }
  53228. defer googleapi.CloseBody(res)
  53229. if err := googleapi.CheckResponse(res); err != nil {
  53230. return nil, err
  53231. }
  53232. ret := &Operation{
  53233. ServerResponse: googleapi.ServerResponse{
  53234. Header: res.Header,
  53235. HTTPStatusCode: res.StatusCode,
  53236. },
  53237. }
  53238. target := &ret
  53239. if err := gensupport.DecodeResponse(target, res); err != nil {
  53240. return nil, err
  53241. }
  53242. return ret, nil
  53243. // {
  53244. // "description": "Simulates a maintenance event on the instance.",
  53245. // "httpMethod": "POST",
  53246. // "id": "compute.instances.simulateMaintenanceEvent",
  53247. // "parameterOrder": [
  53248. // "project",
  53249. // "zone",
  53250. // "instance"
  53251. // ],
  53252. // "parameters": {
  53253. // "instance": {
  53254. // "description": "Name of the instance scoping this request.",
  53255. // "location": "path",
  53256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53257. // "required": true,
  53258. // "type": "string"
  53259. // },
  53260. // "project": {
  53261. // "description": "Project ID for this request.",
  53262. // "location": "path",
  53263. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53264. // "required": true,
  53265. // "type": "string"
  53266. // },
  53267. // "zone": {
  53268. // "description": "The name of the zone for this request.",
  53269. // "location": "path",
  53270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53271. // "required": true,
  53272. // "type": "string"
  53273. // }
  53274. // },
  53275. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  53276. // "response": {
  53277. // "$ref": "Operation"
  53278. // },
  53279. // "scopes": [
  53280. // "https://www.googleapis.com/auth/cloud-platform",
  53281. // "https://www.googleapis.com/auth/compute"
  53282. // ]
  53283. // }
  53284. }
  53285. // method id "compute.instances.start":
  53286. type InstancesStartCall struct {
  53287. s *Service
  53288. project string
  53289. zone string
  53290. instance string
  53291. urlParams_ gensupport.URLParams
  53292. ctx_ context.Context
  53293. header_ http.Header
  53294. }
  53295. // Start: Starts an instance that was stopped using the instances().stop
  53296. // method. For more information, see Restart an instance.
  53297. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  53298. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  53299. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53300. c.project = project
  53301. c.zone = zone
  53302. c.instance = instance
  53303. return c
  53304. }
  53305. // RequestId sets the optional parameter "requestId": An optional
  53306. // request ID to identify requests. Specify a unique request ID so that
  53307. // if you must retry your request, the server will know to ignore the
  53308. // request if it has already been completed.
  53309. //
  53310. // For example, consider a situation where you make an initial request
  53311. // and the request times out. If you make the request again with the
  53312. // same request ID, the server can check if original operation with the
  53313. // same request ID was received, and if so, will ignore the second
  53314. // request. This prevents clients from accidentally creating duplicate
  53315. // commitments.
  53316. //
  53317. // The request ID must be a valid UUID with the exception that zero UUID
  53318. // is not supported (00000000-0000-0000-0000-000000000000).
  53319. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  53320. c.urlParams_.Set("requestId", requestId)
  53321. return c
  53322. }
  53323. // Fields allows partial responses to be retrieved. See
  53324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53325. // for more information.
  53326. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  53327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53328. return c
  53329. }
  53330. // Context sets the context to be used in this call's Do method. Any
  53331. // pending HTTP request will be aborted if the provided context is
  53332. // canceled.
  53333. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  53334. c.ctx_ = ctx
  53335. return c
  53336. }
  53337. // Header returns an http.Header that can be modified by the caller to
  53338. // add HTTP headers to the request.
  53339. func (c *InstancesStartCall) Header() http.Header {
  53340. if c.header_ == nil {
  53341. c.header_ = make(http.Header)
  53342. }
  53343. return c.header_
  53344. }
  53345. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  53346. reqHeaders := make(http.Header)
  53347. for k, v := range c.header_ {
  53348. reqHeaders[k] = v
  53349. }
  53350. reqHeaders.Set("User-Agent", c.s.userAgent())
  53351. var body io.Reader = nil
  53352. c.urlParams_.Set("alt", alt)
  53353. c.urlParams_.Set("prettyPrint", "false")
  53354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  53355. urls += "?" + c.urlParams_.Encode()
  53356. req, err := http.NewRequest("POST", urls, body)
  53357. if err != nil {
  53358. return nil, err
  53359. }
  53360. req.Header = reqHeaders
  53361. googleapi.Expand(req.URL, map[string]string{
  53362. "project": c.project,
  53363. "zone": c.zone,
  53364. "instance": c.instance,
  53365. })
  53366. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53367. }
  53368. // Do executes the "compute.instances.start" call.
  53369. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53370. // status code is an error. Response headers are in either
  53371. // *Operation.ServerResponse.Header or (if a response was returned at
  53372. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53373. // to check whether the returned error was because
  53374. // http.StatusNotModified was returned.
  53375. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53376. gensupport.SetOptions(c.urlParams_, opts...)
  53377. res, err := c.doRequest("json")
  53378. if res != nil && res.StatusCode == http.StatusNotModified {
  53379. if res.Body != nil {
  53380. res.Body.Close()
  53381. }
  53382. return nil, &googleapi.Error{
  53383. Code: res.StatusCode,
  53384. Header: res.Header,
  53385. }
  53386. }
  53387. if err != nil {
  53388. return nil, err
  53389. }
  53390. defer googleapi.CloseBody(res)
  53391. if err := googleapi.CheckResponse(res); err != nil {
  53392. return nil, err
  53393. }
  53394. ret := &Operation{
  53395. ServerResponse: googleapi.ServerResponse{
  53396. Header: res.Header,
  53397. HTTPStatusCode: res.StatusCode,
  53398. },
  53399. }
  53400. target := &ret
  53401. if err := gensupport.DecodeResponse(target, res); err != nil {
  53402. return nil, err
  53403. }
  53404. return ret, nil
  53405. // {
  53406. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  53407. // "httpMethod": "POST",
  53408. // "id": "compute.instances.start",
  53409. // "parameterOrder": [
  53410. // "project",
  53411. // "zone",
  53412. // "instance"
  53413. // ],
  53414. // "parameters": {
  53415. // "instance": {
  53416. // "description": "Name of the instance resource to start.",
  53417. // "location": "path",
  53418. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53419. // "required": true,
  53420. // "type": "string"
  53421. // },
  53422. // "project": {
  53423. // "description": "Project ID for this request.",
  53424. // "location": "path",
  53425. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53426. // "required": true,
  53427. // "type": "string"
  53428. // },
  53429. // "requestId": {
  53430. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53431. // "location": "query",
  53432. // "type": "string"
  53433. // },
  53434. // "zone": {
  53435. // "description": "The name of the zone for this request.",
  53436. // "location": "path",
  53437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53438. // "required": true,
  53439. // "type": "string"
  53440. // }
  53441. // },
  53442. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  53443. // "response": {
  53444. // "$ref": "Operation"
  53445. // },
  53446. // "scopes": [
  53447. // "https://www.googleapis.com/auth/cloud-platform",
  53448. // "https://www.googleapis.com/auth/compute"
  53449. // ]
  53450. // }
  53451. }
  53452. // method id "compute.instances.startWithEncryptionKey":
  53453. type InstancesStartWithEncryptionKeyCall struct {
  53454. s *Service
  53455. project string
  53456. zone string
  53457. instance string
  53458. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  53459. urlParams_ gensupport.URLParams
  53460. ctx_ context.Context
  53461. header_ http.Header
  53462. }
  53463. // StartWithEncryptionKey: Starts an instance that was stopped using the
  53464. // instances().stop method. For more information, see Restart an
  53465. // instance.
  53466. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  53467. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53468. c.project = project
  53469. c.zone = zone
  53470. c.instance = instance
  53471. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  53472. return c
  53473. }
  53474. // RequestId sets the optional parameter "requestId": An optional
  53475. // request ID to identify requests. Specify a unique request ID so that
  53476. // if you must retry your request, the server will know to ignore the
  53477. // request if it has already been completed.
  53478. //
  53479. // For example, consider a situation where you make an initial request
  53480. // and the request times out. If you make the request again with the
  53481. // same request ID, the server can check if original operation with the
  53482. // same request ID was received, and if so, will ignore the second
  53483. // request. This prevents clients from accidentally creating duplicate
  53484. // commitments.
  53485. //
  53486. // The request ID must be a valid UUID with the exception that zero UUID
  53487. // is not supported (00000000-0000-0000-0000-000000000000).
  53488. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  53489. c.urlParams_.Set("requestId", requestId)
  53490. return c
  53491. }
  53492. // Fields allows partial responses to be retrieved. See
  53493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53494. // for more information.
  53495. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  53496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53497. return c
  53498. }
  53499. // Context sets the context to be used in this call's Do method. Any
  53500. // pending HTTP request will be aborted if the provided context is
  53501. // canceled.
  53502. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  53503. c.ctx_ = ctx
  53504. return c
  53505. }
  53506. // Header returns an http.Header that can be modified by the caller to
  53507. // add HTTP headers to the request.
  53508. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  53509. if c.header_ == nil {
  53510. c.header_ = make(http.Header)
  53511. }
  53512. return c.header_
  53513. }
  53514. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  53515. reqHeaders := make(http.Header)
  53516. for k, v := range c.header_ {
  53517. reqHeaders[k] = v
  53518. }
  53519. reqHeaders.Set("User-Agent", c.s.userAgent())
  53520. var body io.Reader = nil
  53521. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  53522. if err != nil {
  53523. return nil, err
  53524. }
  53525. reqHeaders.Set("Content-Type", "application/json")
  53526. c.urlParams_.Set("alt", alt)
  53527. c.urlParams_.Set("prettyPrint", "false")
  53528. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  53529. urls += "?" + c.urlParams_.Encode()
  53530. req, err := http.NewRequest("POST", urls, body)
  53531. if err != nil {
  53532. return nil, err
  53533. }
  53534. req.Header = reqHeaders
  53535. googleapi.Expand(req.URL, map[string]string{
  53536. "project": c.project,
  53537. "zone": c.zone,
  53538. "instance": c.instance,
  53539. })
  53540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53541. }
  53542. // Do executes the "compute.instances.startWithEncryptionKey" call.
  53543. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53544. // status code is an error. Response headers are in either
  53545. // *Operation.ServerResponse.Header or (if a response was returned at
  53546. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53547. // to check whether the returned error was because
  53548. // http.StatusNotModified was returned.
  53549. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53550. gensupport.SetOptions(c.urlParams_, opts...)
  53551. res, err := c.doRequest("json")
  53552. if res != nil && res.StatusCode == http.StatusNotModified {
  53553. if res.Body != nil {
  53554. res.Body.Close()
  53555. }
  53556. return nil, &googleapi.Error{
  53557. Code: res.StatusCode,
  53558. Header: res.Header,
  53559. }
  53560. }
  53561. if err != nil {
  53562. return nil, err
  53563. }
  53564. defer googleapi.CloseBody(res)
  53565. if err := googleapi.CheckResponse(res); err != nil {
  53566. return nil, err
  53567. }
  53568. ret := &Operation{
  53569. ServerResponse: googleapi.ServerResponse{
  53570. Header: res.Header,
  53571. HTTPStatusCode: res.StatusCode,
  53572. },
  53573. }
  53574. target := &ret
  53575. if err := gensupport.DecodeResponse(target, res); err != nil {
  53576. return nil, err
  53577. }
  53578. return ret, nil
  53579. // {
  53580. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  53581. // "httpMethod": "POST",
  53582. // "id": "compute.instances.startWithEncryptionKey",
  53583. // "parameterOrder": [
  53584. // "project",
  53585. // "zone",
  53586. // "instance"
  53587. // ],
  53588. // "parameters": {
  53589. // "instance": {
  53590. // "description": "Name of the instance resource to start.",
  53591. // "location": "path",
  53592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53593. // "required": true,
  53594. // "type": "string"
  53595. // },
  53596. // "project": {
  53597. // "description": "Project ID for this request.",
  53598. // "location": "path",
  53599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53600. // "required": true,
  53601. // "type": "string"
  53602. // },
  53603. // "requestId": {
  53604. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53605. // "location": "query",
  53606. // "type": "string"
  53607. // },
  53608. // "zone": {
  53609. // "description": "The name of the zone for this request.",
  53610. // "location": "path",
  53611. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53612. // "required": true,
  53613. // "type": "string"
  53614. // }
  53615. // },
  53616. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  53617. // "request": {
  53618. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  53619. // },
  53620. // "response": {
  53621. // "$ref": "Operation"
  53622. // },
  53623. // "scopes": [
  53624. // "https://www.googleapis.com/auth/cloud-platform",
  53625. // "https://www.googleapis.com/auth/compute"
  53626. // ]
  53627. // }
  53628. }
  53629. // method id "compute.instances.stop":
  53630. type InstancesStopCall struct {
  53631. s *Service
  53632. project string
  53633. zone string
  53634. instance string
  53635. urlParams_ gensupport.URLParams
  53636. ctx_ context.Context
  53637. header_ http.Header
  53638. }
  53639. // Stop: Stops a running instance, shutting it down cleanly, and allows
  53640. // you to restart the instance at a later time. Stopped instances do not
  53641. // incur VM usage charges while they are stopped. However, resources
  53642. // that the VM is using, such as persistent disks and static IP
  53643. // addresses, will continue to be charged until they are deleted. For
  53644. // more information, see Stopping an instance.
  53645. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  53646. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  53647. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53648. c.project = project
  53649. c.zone = zone
  53650. c.instance = instance
  53651. return c
  53652. }
  53653. // RequestId sets the optional parameter "requestId": An optional
  53654. // request ID to identify requests. Specify a unique request ID so that
  53655. // if you must retry your request, the server will know to ignore the
  53656. // request if it has already been completed.
  53657. //
  53658. // For example, consider a situation where you make an initial request
  53659. // and the request times out. If you make the request again with the
  53660. // same request ID, the server can check if original operation with the
  53661. // same request ID was received, and if so, will ignore the second
  53662. // request. This prevents clients from accidentally creating duplicate
  53663. // commitments.
  53664. //
  53665. // The request ID must be a valid UUID with the exception that zero UUID
  53666. // is not supported (00000000-0000-0000-0000-000000000000).
  53667. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  53668. c.urlParams_.Set("requestId", requestId)
  53669. return c
  53670. }
  53671. // Fields allows partial responses to be retrieved. See
  53672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53673. // for more information.
  53674. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  53675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53676. return c
  53677. }
  53678. // Context sets the context to be used in this call's Do method. Any
  53679. // pending HTTP request will be aborted if the provided context is
  53680. // canceled.
  53681. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  53682. c.ctx_ = ctx
  53683. return c
  53684. }
  53685. // Header returns an http.Header that can be modified by the caller to
  53686. // add HTTP headers to the request.
  53687. func (c *InstancesStopCall) Header() http.Header {
  53688. if c.header_ == nil {
  53689. c.header_ = make(http.Header)
  53690. }
  53691. return c.header_
  53692. }
  53693. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  53694. reqHeaders := make(http.Header)
  53695. for k, v := range c.header_ {
  53696. reqHeaders[k] = v
  53697. }
  53698. reqHeaders.Set("User-Agent", c.s.userAgent())
  53699. var body io.Reader = nil
  53700. c.urlParams_.Set("alt", alt)
  53701. c.urlParams_.Set("prettyPrint", "false")
  53702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  53703. urls += "?" + c.urlParams_.Encode()
  53704. req, err := http.NewRequest("POST", urls, body)
  53705. if err != nil {
  53706. return nil, err
  53707. }
  53708. req.Header = reqHeaders
  53709. googleapi.Expand(req.URL, map[string]string{
  53710. "project": c.project,
  53711. "zone": c.zone,
  53712. "instance": c.instance,
  53713. })
  53714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53715. }
  53716. // Do executes the "compute.instances.stop" call.
  53717. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53718. // status code is an error. Response headers are in either
  53719. // *Operation.ServerResponse.Header or (if a response was returned at
  53720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53721. // to check whether the returned error was because
  53722. // http.StatusNotModified was returned.
  53723. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53724. gensupport.SetOptions(c.urlParams_, opts...)
  53725. res, err := c.doRequest("json")
  53726. if res != nil && res.StatusCode == http.StatusNotModified {
  53727. if res.Body != nil {
  53728. res.Body.Close()
  53729. }
  53730. return nil, &googleapi.Error{
  53731. Code: res.StatusCode,
  53732. Header: res.Header,
  53733. }
  53734. }
  53735. if err != nil {
  53736. return nil, err
  53737. }
  53738. defer googleapi.CloseBody(res)
  53739. if err := googleapi.CheckResponse(res); err != nil {
  53740. return nil, err
  53741. }
  53742. ret := &Operation{
  53743. ServerResponse: googleapi.ServerResponse{
  53744. Header: res.Header,
  53745. HTTPStatusCode: res.StatusCode,
  53746. },
  53747. }
  53748. target := &ret
  53749. if err := gensupport.DecodeResponse(target, res); err != nil {
  53750. return nil, err
  53751. }
  53752. return ret, nil
  53753. // {
  53754. // "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.",
  53755. // "httpMethod": "POST",
  53756. // "id": "compute.instances.stop",
  53757. // "parameterOrder": [
  53758. // "project",
  53759. // "zone",
  53760. // "instance"
  53761. // ],
  53762. // "parameters": {
  53763. // "instance": {
  53764. // "description": "Name of the instance resource to stop.",
  53765. // "location": "path",
  53766. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53767. // "required": true,
  53768. // "type": "string"
  53769. // },
  53770. // "project": {
  53771. // "description": "Project ID for this request.",
  53772. // "location": "path",
  53773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53774. // "required": true,
  53775. // "type": "string"
  53776. // },
  53777. // "requestId": {
  53778. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53779. // "location": "query",
  53780. // "type": "string"
  53781. // },
  53782. // "zone": {
  53783. // "description": "The name of the zone for this request.",
  53784. // "location": "path",
  53785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53786. // "required": true,
  53787. // "type": "string"
  53788. // }
  53789. // },
  53790. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  53791. // "response": {
  53792. // "$ref": "Operation"
  53793. // },
  53794. // "scopes": [
  53795. // "https://www.googleapis.com/auth/cloud-platform",
  53796. // "https://www.googleapis.com/auth/compute"
  53797. // ]
  53798. // }
  53799. }
  53800. // method id "compute.instances.testIamPermissions":
  53801. type InstancesTestIamPermissionsCall struct {
  53802. s *Service
  53803. project string
  53804. zone string
  53805. resource string
  53806. testpermissionsrequest *TestPermissionsRequest
  53807. urlParams_ gensupport.URLParams
  53808. ctx_ context.Context
  53809. header_ http.Header
  53810. }
  53811. // TestIamPermissions: Returns permissions that a caller has on the
  53812. // specified resource.
  53813. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  53814. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53815. c.project = project
  53816. c.zone = zone
  53817. c.resource = resource
  53818. c.testpermissionsrequest = testpermissionsrequest
  53819. return c
  53820. }
  53821. // Fields allows partial responses to be retrieved. See
  53822. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53823. // for more information.
  53824. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  53825. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53826. return c
  53827. }
  53828. // Context sets the context to be used in this call's Do method. Any
  53829. // pending HTTP request will be aborted if the provided context is
  53830. // canceled.
  53831. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  53832. c.ctx_ = ctx
  53833. return c
  53834. }
  53835. // Header returns an http.Header that can be modified by the caller to
  53836. // add HTTP headers to the request.
  53837. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  53838. if c.header_ == nil {
  53839. c.header_ = make(http.Header)
  53840. }
  53841. return c.header_
  53842. }
  53843. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53844. reqHeaders := make(http.Header)
  53845. for k, v := range c.header_ {
  53846. reqHeaders[k] = v
  53847. }
  53848. reqHeaders.Set("User-Agent", c.s.userAgent())
  53849. var body io.Reader = nil
  53850. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53851. if err != nil {
  53852. return nil, err
  53853. }
  53854. reqHeaders.Set("Content-Type", "application/json")
  53855. c.urlParams_.Set("alt", alt)
  53856. c.urlParams_.Set("prettyPrint", "false")
  53857. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  53858. urls += "?" + c.urlParams_.Encode()
  53859. req, err := http.NewRequest("POST", urls, body)
  53860. if err != nil {
  53861. return nil, err
  53862. }
  53863. req.Header = reqHeaders
  53864. googleapi.Expand(req.URL, map[string]string{
  53865. "project": c.project,
  53866. "zone": c.zone,
  53867. "resource": c.resource,
  53868. })
  53869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53870. }
  53871. // Do executes the "compute.instances.testIamPermissions" call.
  53872. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53873. // non-2xx status code is an error. Response headers are in either
  53874. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  53875. // returned at all) in error.(*googleapi.Error).Header. Use
  53876. // googleapi.IsNotModified to check whether the returned error was
  53877. // because http.StatusNotModified was returned.
  53878. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  53879. gensupport.SetOptions(c.urlParams_, opts...)
  53880. res, err := c.doRequest("json")
  53881. if res != nil && res.StatusCode == http.StatusNotModified {
  53882. if res.Body != nil {
  53883. res.Body.Close()
  53884. }
  53885. return nil, &googleapi.Error{
  53886. Code: res.StatusCode,
  53887. Header: res.Header,
  53888. }
  53889. }
  53890. if err != nil {
  53891. return nil, err
  53892. }
  53893. defer googleapi.CloseBody(res)
  53894. if err := googleapi.CheckResponse(res); err != nil {
  53895. return nil, err
  53896. }
  53897. ret := &TestPermissionsResponse{
  53898. ServerResponse: googleapi.ServerResponse{
  53899. Header: res.Header,
  53900. HTTPStatusCode: res.StatusCode,
  53901. },
  53902. }
  53903. target := &ret
  53904. if err := gensupport.DecodeResponse(target, res); err != nil {
  53905. return nil, err
  53906. }
  53907. return ret, nil
  53908. // {
  53909. // "description": "Returns permissions that a caller has on the specified resource.",
  53910. // "httpMethod": "POST",
  53911. // "id": "compute.instances.testIamPermissions",
  53912. // "parameterOrder": [
  53913. // "project",
  53914. // "zone",
  53915. // "resource"
  53916. // ],
  53917. // "parameters": {
  53918. // "project": {
  53919. // "description": "Project ID for this request.",
  53920. // "location": "path",
  53921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53922. // "required": true,
  53923. // "type": "string"
  53924. // },
  53925. // "resource": {
  53926. // "description": "Name or id of the resource for this request.",
  53927. // "location": "path",
  53928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53929. // "required": true,
  53930. // "type": "string"
  53931. // },
  53932. // "zone": {
  53933. // "description": "The name of the zone for this request.",
  53934. // "location": "path",
  53935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53936. // "required": true,
  53937. // "type": "string"
  53938. // }
  53939. // },
  53940. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  53941. // "request": {
  53942. // "$ref": "TestPermissionsRequest"
  53943. // },
  53944. // "response": {
  53945. // "$ref": "TestPermissionsResponse"
  53946. // },
  53947. // "scopes": [
  53948. // "https://www.googleapis.com/auth/cloud-platform",
  53949. // "https://www.googleapis.com/auth/compute",
  53950. // "https://www.googleapis.com/auth/compute.readonly"
  53951. // ]
  53952. // }
  53953. }
  53954. // method id "compute.instances.updateAccessConfig":
  53955. type InstancesUpdateAccessConfigCall struct {
  53956. s *Service
  53957. project string
  53958. zone string
  53959. instance string
  53960. accessconfig *AccessConfig
  53961. urlParams_ gensupport.URLParams
  53962. ctx_ context.Context
  53963. header_ http.Header
  53964. }
  53965. // UpdateAccessConfig: Updates the specified access config from an
  53966. // instance's network interface with the data included in the request.
  53967. // This method supports PATCH semantics and uses the JSON merge patch
  53968. // format and processing rules.
  53969. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  53970. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53971. c.project = project
  53972. c.zone = zone
  53973. c.instance = instance
  53974. c.urlParams_.Set("networkInterface", networkInterface)
  53975. c.accessconfig = accessconfig
  53976. return c
  53977. }
  53978. // RequestId sets the optional parameter "requestId": An optional
  53979. // request ID to identify requests. Specify a unique request ID so that
  53980. // if you must retry your request, the server will know to ignore the
  53981. // request if it has already been completed.
  53982. //
  53983. // For example, consider a situation where you make an initial request
  53984. // and the request times out. If you make the request again with the
  53985. // same request ID, the server can check if original operation with the
  53986. // same request ID was received, and if so, will ignore the second
  53987. // request. This prevents clients from accidentally creating duplicate
  53988. // commitments.
  53989. //
  53990. // The request ID must be a valid UUID with the exception that zero UUID
  53991. // is not supported (00000000-0000-0000-0000-000000000000).
  53992. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  53993. c.urlParams_.Set("requestId", requestId)
  53994. return c
  53995. }
  53996. // Fields allows partial responses to be retrieved. See
  53997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53998. // for more information.
  53999. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  54000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54001. return c
  54002. }
  54003. // Context sets the context to be used in this call's Do method. Any
  54004. // pending HTTP request will be aborted if the provided context is
  54005. // canceled.
  54006. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  54007. c.ctx_ = ctx
  54008. return c
  54009. }
  54010. // Header returns an http.Header that can be modified by the caller to
  54011. // add HTTP headers to the request.
  54012. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  54013. if c.header_ == nil {
  54014. c.header_ = make(http.Header)
  54015. }
  54016. return c.header_
  54017. }
  54018. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  54019. reqHeaders := make(http.Header)
  54020. for k, v := range c.header_ {
  54021. reqHeaders[k] = v
  54022. }
  54023. reqHeaders.Set("User-Agent", c.s.userAgent())
  54024. var body io.Reader = nil
  54025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  54026. if err != nil {
  54027. return nil, err
  54028. }
  54029. reqHeaders.Set("Content-Type", "application/json")
  54030. c.urlParams_.Set("alt", alt)
  54031. c.urlParams_.Set("prettyPrint", "false")
  54032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  54033. urls += "?" + c.urlParams_.Encode()
  54034. req, err := http.NewRequest("POST", urls, body)
  54035. if err != nil {
  54036. return nil, err
  54037. }
  54038. req.Header = reqHeaders
  54039. googleapi.Expand(req.URL, map[string]string{
  54040. "project": c.project,
  54041. "zone": c.zone,
  54042. "instance": c.instance,
  54043. })
  54044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54045. }
  54046. // Do executes the "compute.instances.updateAccessConfig" call.
  54047. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54048. // status code is an error. Response headers are in either
  54049. // *Operation.ServerResponse.Header or (if a response was returned at
  54050. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54051. // to check whether the returned error was because
  54052. // http.StatusNotModified was returned.
  54053. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54054. gensupport.SetOptions(c.urlParams_, opts...)
  54055. res, err := c.doRequest("json")
  54056. if res != nil && res.StatusCode == http.StatusNotModified {
  54057. if res.Body != nil {
  54058. res.Body.Close()
  54059. }
  54060. return nil, &googleapi.Error{
  54061. Code: res.StatusCode,
  54062. Header: res.Header,
  54063. }
  54064. }
  54065. if err != nil {
  54066. return nil, err
  54067. }
  54068. defer googleapi.CloseBody(res)
  54069. if err := googleapi.CheckResponse(res); err != nil {
  54070. return nil, err
  54071. }
  54072. ret := &Operation{
  54073. ServerResponse: googleapi.ServerResponse{
  54074. Header: res.Header,
  54075. HTTPStatusCode: res.StatusCode,
  54076. },
  54077. }
  54078. target := &ret
  54079. if err := gensupport.DecodeResponse(target, res); err != nil {
  54080. return nil, err
  54081. }
  54082. return ret, nil
  54083. // {
  54084. // "description": "Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  54085. // "httpMethod": "POST",
  54086. // "id": "compute.instances.updateAccessConfig",
  54087. // "parameterOrder": [
  54088. // "project",
  54089. // "zone",
  54090. // "instance",
  54091. // "networkInterface"
  54092. // ],
  54093. // "parameters": {
  54094. // "instance": {
  54095. // "description": "The instance name for this request.",
  54096. // "location": "path",
  54097. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54098. // "required": true,
  54099. // "type": "string"
  54100. // },
  54101. // "networkInterface": {
  54102. // "description": "The name of the network interface where the access config is attached.",
  54103. // "location": "query",
  54104. // "required": true,
  54105. // "type": "string"
  54106. // },
  54107. // "project": {
  54108. // "description": "Project ID for this request.",
  54109. // "location": "path",
  54110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54111. // "required": true,
  54112. // "type": "string"
  54113. // },
  54114. // "requestId": {
  54115. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54116. // "location": "query",
  54117. // "type": "string"
  54118. // },
  54119. // "zone": {
  54120. // "description": "The name of the zone for this request.",
  54121. // "location": "path",
  54122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54123. // "required": true,
  54124. // "type": "string"
  54125. // }
  54126. // },
  54127. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  54128. // "request": {
  54129. // "$ref": "AccessConfig"
  54130. // },
  54131. // "response": {
  54132. // "$ref": "Operation"
  54133. // },
  54134. // "scopes": [
  54135. // "https://www.googleapis.com/auth/cloud-platform",
  54136. // "https://www.googleapis.com/auth/compute"
  54137. // ]
  54138. // }
  54139. }
  54140. // method id "compute.instances.updateNetworkInterface":
  54141. type InstancesUpdateNetworkInterfaceCall struct {
  54142. s *Service
  54143. project string
  54144. zone string
  54145. instance string
  54146. networkinterface *NetworkInterface
  54147. urlParams_ gensupport.URLParams
  54148. ctx_ context.Context
  54149. header_ http.Header
  54150. }
  54151. // UpdateNetworkInterface: Updates an instance's network interface. This
  54152. // method follows PATCH semantics.
  54153. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  54154. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54155. c.project = project
  54156. c.zone = zone
  54157. c.instance = instance
  54158. c.urlParams_.Set("networkInterface", networkInterface)
  54159. c.networkinterface = networkinterface
  54160. return c
  54161. }
  54162. // RequestId sets the optional parameter "requestId": An optional
  54163. // request ID to identify requests. Specify a unique request ID so that
  54164. // if you must retry your request, the server will know to ignore the
  54165. // request if it has already been completed.
  54166. //
  54167. // For example, consider a situation where you make an initial request
  54168. // and the request times out. If you make the request again with the
  54169. // same request ID, the server can check if original operation with the
  54170. // same request ID was received, and if so, will ignore the second
  54171. // request. This prevents clients from accidentally creating duplicate
  54172. // commitments.
  54173. //
  54174. // The request ID must be a valid UUID with the exception that zero UUID
  54175. // is not supported (00000000-0000-0000-0000-000000000000).
  54176. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  54177. c.urlParams_.Set("requestId", requestId)
  54178. return c
  54179. }
  54180. // Fields allows partial responses to be retrieved. See
  54181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54182. // for more information.
  54183. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  54184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54185. return c
  54186. }
  54187. // Context sets the context to be used in this call's Do method. Any
  54188. // pending HTTP request will be aborted if the provided context is
  54189. // canceled.
  54190. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  54191. c.ctx_ = ctx
  54192. return c
  54193. }
  54194. // Header returns an http.Header that can be modified by the caller to
  54195. // add HTTP headers to the request.
  54196. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  54197. if c.header_ == nil {
  54198. c.header_ = make(http.Header)
  54199. }
  54200. return c.header_
  54201. }
  54202. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  54203. reqHeaders := make(http.Header)
  54204. for k, v := range c.header_ {
  54205. reqHeaders[k] = v
  54206. }
  54207. reqHeaders.Set("User-Agent", c.s.userAgent())
  54208. var body io.Reader = nil
  54209. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  54210. if err != nil {
  54211. return nil, err
  54212. }
  54213. reqHeaders.Set("Content-Type", "application/json")
  54214. c.urlParams_.Set("alt", alt)
  54215. c.urlParams_.Set("prettyPrint", "false")
  54216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  54217. urls += "?" + c.urlParams_.Encode()
  54218. req, err := http.NewRequest("PATCH", urls, body)
  54219. if err != nil {
  54220. return nil, err
  54221. }
  54222. req.Header = reqHeaders
  54223. googleapi.Expand(req.URL, map[string]string{
  54224. "project": c.project,
  54225. "zone": c.zone,
  54226. "instance": c.instance,
  54227. })
  54228. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54229. }
  54230. // Do executes the "compute.instances.updateNetworkInterface" call.
  54231. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54232. // status code is an error. Response headers are in either
  54233. // *Operation.ServerResponse.Header or (if a response was returned at
  54234. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54235. // to check whether the returned error was because
  54236. // http.StatusNotModified was returned.
  54237. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54238. gensupport.SetOptions(c.urlParams_, opts...)
  54239. res, err := c.doRequest("json")
  54240. if res != nil && res.StatusCode == http.StatusNotModified {
  54241. if res.Body != nil {
  54242. res.Body.Close()
  54243. }
  54244. return nil, &googleapi.Error{
  54245. Code: res.StatusCode,
  54246. Header: res.Header,
  54247. }
  54248. }
  54249. if err != nil {
  54250. return nil, err
  54251. }
  54252. defer googleapi.CloseBody(res)
  54253. if err := googleapi.CheckResponse(res); err != nil {
  54254. return nil, err
  54255. }
  54256. ret := &Operation{
  54257. ServerResponse: googleapi.ServerResponse{
  54258. Header: res.Header,
  54259. HTTPStatusCode: res.StatusCode,
  54260. },
  54261. }
  54262. target := &ret
  54263. if err := gensupport.DecodeResponse(target, res); err != nil {
  54264. return nil, err
  54265. }
  54266. return ret, nil
  54267. // {
  54268. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  54269. // "httpMethod": "PATCH",
  54270. // "id": "compute.instances.updateNetworkInterface",
  54271. // "parameterOrder": [
  54272. // "project",
  54273. // "zone",
  54274. // "instance",
  54275. // "networkInterface"
  54276. // ],
  54277. // "parameters": {
  54278. // "instance": {
  54279. // "description": "The instance name for this request.",
  54280. // "location": "path",
  54281. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54282. // "required": true,
  54283. // "type": "string"
  54284. // },
  54285. // "networkInterface": {
  54286. // "description": "The name of the network interface to update.",
  54287. // "location": "query",
  54288. // "required": true,
  54289. // "type": "string"
  54290. // },
  54291. // "project": {
  54292. // "description": "Project ID for this request.",
  54293. // "location": "path",
  54294. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54295. // "required": true,
  54296. // "type": "string"
  54297. // },
  54298. // "requestId": {
  54299. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54300. // "location": "query",
  54301. // "type": "string"
  54302. // },
  54303. // "zone": {
  54304. // "description": "The name of the zone for this request.",
  54305. // "location": "path",
  54306. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54307. // "required": true,
  54308. // "type": "string"
  54309. // }
  54310. // },
  54311. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  54312. // "request": {
  54313. // "$ref": "NetworkInterface"
  54314. // },
  54315. // "response": {
  54316. // "$ref": "Operation"
  54317. // },
  54318. // "scopes": [
  54319. // "https://www.googleapis.com/auth/cloud-platform",
  54320. // "https://www.googleapis.com/auth/compute"
  54321. // ]
  54322. // }
  54323. }
  54324. // method id "compute.interconnectAttachments.aggregatedList":
  54325. type InterconnectAttachmentsAggregatedListCall struct {
  54326. s *Service
  54327. project string
  54328. urlParams_ gensupport.URLParams
  54329. ifNoneMatch_ string
  54330. ctx_ context.Context
  54331. header_ http.Header
  54332. }
  54333. // AggregatedList: Retrieves an aggregated list of interconnect
  54334. // attachments.
  54335. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  54336. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54337. c.project = project
  54338. return c
  54339. }
  54340. // Filter sets the optional parameter "filter": A filter expression that
  54341. // filters resources listed in the response. The expression must specify
  54342. // the field name, a comparison operator, and the value that you want to
  54343. // use for filtering. The value must be a string, a number, or a
  54344. // boolean. The comparison operator must be either =, !=, >, or <.
  54345. //
  54346. // For example, if you are filtering Compute Engine instances, you can
  54347. // exclude instances named example-instance by specifying name !=
  54348. // example-instance.
  54349. //
  54350. // You can also filter nested fields. For example, you could specify
  54351. // scheduling.automaticRestart = false to include instances only if they
  54352. // are not scheduled for automatic restarts. You can use filtering on
  54353. // nested fields to filter based on resource labels.
  54354. //
  54355. // To filter on multiple expressions, provide each separate expression
  54356. // within parentheses. For example, (scheduling.automaticRestart = true)
  54357. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54358. // AND expression. However, you can include AND and OR expressions
  54359. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54360. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54361. // true).
  54362. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  54363. c.urlParams_.Set("filter", filter)
  54364. return c
  54365. }
  54366. // MaxResults sets the optional parameter "maxResults": The maximum
  54367. // number of results per page that should be returned. If the number of
  54368. // available results is larger than maxResults, Compute Engine returns a
  54369. // nextPageToken that can be used to get the next page of results in
  54370. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54371. // (Default: 500)
  54372. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  54373. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54374. return c
  54375. }
  54376. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54377. // a certain order. By default, results are returned in alphanumerical
  54378. // order based on the resource name.
  54379. //
  54380. // You can also sort results in descending order based on the creation
  54381. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54382. // based on the creationTimestamp field in reverse chronological order
  54383. // (newest result first). Use this to sort resources like operations so
  54384. // that the newest operation is returned first.
  54385. //
  54386. // Currently, only sorting by name or creationTimestamp desc is
  54387. // supported.
  54388. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  54389. c.urlParams_.Set("orderBy", orderBy)
  54390. return c
  54391. }
  54392. // PageToken sets the optional parameter "pageToken": Specifies a page
  54393. // token to use. Set pageToken to the nextPageToken returned by a
  54394. // previous list request to get the next page of results.
  54395. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  54396. c.urlParams_.Set("pageToken", pageToken)
  54397. return c
  54398. }
  54399. // Fields allows partial responses to be retrieved. See
  54400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54401. // for more information.
  54402. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  54403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54404. return c
  54405. }
  54406. // IfNoneMatch sets the optional parameter which makes the operation
  54407. // fail if the object's ETag matches the given value. This is useful for
  54408. // getting updates only after the object has changed since the last
  54409. // request. Use googleapi.IsNotModified to check whether the response
  54410. // error from Do is the result of In-None-Match.
  54411. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  54412. c.ifNoneMatch_ = entityTag
  54413. return c
  54414. }
  54415. // Context sets the context to be used in this call's Do method. Any
  54416. // pending HTTP request will be aborted if the provided context is
  54417. // canceled.
  54418. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  54419. c.ctx_ = ctx
  54420. return c
  54421. }
  54422. // Header returns an http.Header that can be modified by the caller to
  54423. // add HTTP headers to the request.
  54424. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  54425. if c.header_ == nil {
  54426. c.header_ = make(http.Header)
  54427. }
  54428. return c.header_
  54429. }
  54430. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  54431. reqHeaders := make(http.Header)
  54432. for k, v := range c.header_ {
  54433. reqHeaders[k] = v
  54434. }
  54435. reqHeaders.Set("User-Agent", c.s.userAgent())
  54436. if c.ifNoneMatch_ != "" {
  54437. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54438. }
  54439. var body io.Reader = nil
  54440. c.urlParams_.Set("alt", alt)
  54441. c.urlParams_.Set("prettyPrint", "false")
  54442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  54443. urls += "?" + c.urlParams_.Encode()
  54444. req, err := http.NewRequest("GET", urls, body)
  54445. if err != nil {
  54446. return nil, err
  54447. }
  54448. req.Header = reqHeaders
  54449. googleapi.Expand(req.URL, map[string]string{
  54450. "project": c.project,
  54451. })
  54452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54453. }
  54454. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  54455. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  54456. // non-nil. Any non-2xx status code is an error. Response headers are in
  54457. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  54458. // (if a response was returned at all) in
  54459. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  54460. // whether the returned error was because http.StatusNotModified was
  54461. // returned.
  54462. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  54463. gensupport.SetOptions(c.urlParams_, opts...)
  54464. res, err := c.doRequest("json")
  54465. if res != nil && res.StatusCode == http.StatusNotModified {
  54466. if res.Body != nil {
  54467. res.Body.Close()
  54468. }
  54469. return nil, &googleapi.Error{
  54470. Code: res.StatusCode,
  54471. Header: res.Header,
  54472. }
  54473. }
  54474. if err != nil {
  54475. return nil, err
  54476. }
  54477. defer googleapi.CloseBody(res)
  54478. if err := googleapi.CheckResponse(res); err != nil {
  54479. return nil, err
  54480. }
  54481. ret := &InterconnectAttachmentAggregatedList{
  54482. ServerResponse: googleapi.ServerResponse{
  54483. Header: res.Header,
  54484. HTTPStatusCode: res.StatusCode,
  54485. },
  54486. }
  54487. target := &ret
  54488. if err := gensupport.DecodeResponse(target, res); err != nil {
  54489. return nil, err
  54490. }
  54491. return ret, nil
  54492. // {
  54493. // "description": "Retrieves an aggregated list of interconnect attachments.",
  54494. // "httpMethod": "GET",
  54495. // "id": "compute.interconnectAttachments.aggregatedList",
  54496. // "parameterOrder": [
  54497. // "project"
  54498. // ],
  54499. // "parameters": {
  54500. // "filter": {
  54501. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  54502. // "location": "query",
  54503. // "type": "string"
  54504. // },
  54505. // "maxResults": {
  54506. // "default": "500",
  54507. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  54508. // "format": "uint32",
  54509. // "location": "query",
  54510. // "minimum": "0",
  54511. // "type": "integer"
  54512. // },
  54513. // "orderBy": {
  54514. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  54515. // "location": "query",
  54516. // "type": "string"
  54517. // },
  54518. // "pageToken": {
  54519. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  54520. // "location": "query",
  54521. // "type": "string"
  54522. // },
  54523. // "project": {
  54524. // "description": "Project ID for this request.",
  54525. // "location": "path",
  54526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54527. // "required": true,
  54528. // "type": "string"
  54529. // }
  54530. // },
  54531. // "path": "{project}/aggregated/interconnectAttachments",
  54532. // "response": {
  54533. // "$ref": "InterconnectAttachmentAggregatedList"
  54534. // },
  54535. // "scopes": [
  54536. // "https://www.googleapis.com/auth/cloud-platform",
  54537. // "https://www.googleapis.com/auth/compute",
  54538. // "https://www.googleapis.com/auth/compute.readonly"
  54539. // ]
  54540. // }
  54541. }
  54542. // Pages invokes f for each page of results.
  54543. // A non-nil error returned from f will halt the iteration.
  54544. // The provided context supersedes any context provided to the Context method.
  54545. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  54546. c.ctx_ = ctx
  54547. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54548. for {
  54549. x, err := c.Do()
  54550. if err != nil {
  54551. return err
  54552. }
  54553. if err := f(x); err != nil {
  54554. return err
  54555. }
  54556. if x.NextPageToken == "" {
  54557. return nil
  54558. }
  54559. c.PageToken(x.NextPageToken)
  54560. }
  54561. }
  54562. // method id "compute.interconnectAttachments.delete":
  54563. type InterconnectAttachmentsDeleteCall struct {
  54564. s *Service
  54565. project string
  54566. region string
  54567. interconnectAttachment string
  54568. urlParams_ gensupport.URLParams
  54569. ctx_ context.Context
  54570. header_ http.Header
  54571. }
  54572. // Delete: Deletes the specified interconnect attachment.
  54573. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  54574. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54575. c.project = project
  54576. c.region = region
  54577. c.interconnectAttachment = interconnectAttachment
  54578. return c
  54579. }
  54580. // RequestId sets the optional parameter "requestId": An optional
  54581. // request ID to identify requests. Specify a unique request ID so that
  54582. // if you must retry your request, the server will know to ignore the
  54583. // request if it has already been completed.
  54584. //
  54585. // For example, consider a situation where you make an initial request
  54586. // and the request times out. If you make the request again with the
  54587. // same request ID, the server can check if original operation with the
  54588. // same request ID was received, and if so, will ignore the second
  54589. // request. This prevents clients from accidentally creating duplicate
  54590. // commitments.
  54591. //
  54592. // The request ID must be a valid UUID with the exception that zero UUID
  54593. // is not supported (00000000-0000-0000-0000-000000000000).
  54594. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  54595. c.urlParams_.Set("requestId", requestId)
  54596. return c
  54597. }
  54598. // Fields allows partial responses to be retrieved. See
  54599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54600. // for more information.
  54601. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  54602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54603. return c
  54604. }
  54605. // Context sets the context to be used in this call's Do method. Any
  54606. // pending HTTP request will be aborted if the provided context is
  54607. // canceled.
  54608. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  54609. c.ctx_ = ctx
  54610. return c
  54611. }
  54612. // Header returns an http.Header that can be modified by the caller to
  54613. // add HTTP headers to the request.
  54614. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  54615. if c.header_ == nil {
  54616. c.header_ = make(http.Header)
  54617. }
  54618. return c.header_
  54619. }
  54620. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  54621. reqHeaders := make(http.Header)
  54622. for k, v := range c.header_ {
  54623. reqHeaders[k] = v
  54624. }
  54625. reqHeaders.Set("User-Agent", c.s.userAgent())
  54626. var body io.Reader = nil
  54627. c.urlParams_.Set("alt", alt)
  54628. c.urlParams_.Set("prettyPrint", "false")
  54629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  54630. urls += "?" + c.urlParams_.Encode()
  54631. req, err := http.NewRequest("DELETE", urls, body)
  54632. if err != nil {
  54633. return nil, err
  54634. }
  54635. req.Header = reqHeaders
  54636. googleapi.Expand(req.URL, map[string]string{
  54637. "project": c.project,
  54638. "region": c.region,
  54639. "interconnectAttachment": c.interconnectAttachment,
  54640. })
  54641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54642. }
  54643. // Do executes the "compute.interconnectAttachments.delete" call.
  54644. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54645. // status code is an error. Response headers are in either
  54646. // *Operation.ServerResponse.Header or (if a response was returned at
  54647. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54648. // to check whether the returned error was because
  54649. // http.StatusNotModified was returned.
  54650. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54651. gensupport.SetOptions(c.urlParams_, opts...)
  54652. res, err := c.doRequest("json")
  54653. if res != nil && res.StatusCode == http.StatusNotModified {
  54654. if res.Body != nil {
  54655. res.Body.Close()
  54656. }
  54657. return nil, &googleapi.Error{
  54658. Code: res.StatusCode,
  54659. Header: res.Header,
  54660. }
  54661. }
  54662. if err != nil {
  54663. return nil, err
  54664. }
  54665. defer googleapi.CloseBody(res)
  54666. if err := googleapi.CheckResponse(res); err != nil {
  54667. return nil, err
  54668. }
  54669. ret := &Operation{
  54670. ServerResponse: googleapi.ServerResponse{
  54671. Header: res.Header,
  54672. HTTPStatusCode: res.StatusCode,
  54673. },
  54674. }
  54675. target := &ret
  54676. if err := gensupport.DecodeResponse(target, res); err != nil {
  54677. return nil, err
  54678. }
  54679. return ret, nil
  54680. // {
  54681. // "description": "Deletes the specified interconnect attachment.",
  54682. // "httpMethod": "DELETE",
  54683. // "id": "compute.interconnectAttachments.delete",
  54684. // "parameterOrder": [
  54685. // "project",
  54686. // "region",
  54687. // "interconnectAttachment"
  54688. // ],
  54689. // "parameters": {
  54690. // "interconnectAttachment": {
  54691. // "description": "Name of the interconnect attachment to delete.",
  54692. // "location": "path",
  54693. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54694. // "required": true,
  54695. // "type": "string"
  54696. // },
  54697. // "project": {
  54698. // "description": "Project ID for this request.",
  54699. // "location": "path",
  54700. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54701. // "required": true,
  54702. // "type": "string"
  54703. // },
  54704. // "region": {
  54705. // "description": "Name of the region for this request.",
  54706. // "location": "path",
  54707. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54708. // "required": true,
  54709. // "type": "string"
  54710. // },
  54711. // "requestId": {
  54712. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54713. // "location": "query",
  54714. // "type": "string"
  54715. // }
  54716. // },
  54717. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  54718. // "response": {
  54719. // "$ref": "Operation"
  54720. // },
  54721. // "scopes": [
  54722. // "https://www.googleapis.com/auth/cloud-platform",
  54723. // "https://www.googleapis.com/auth/compute"
  54724. // ]
  54725. // }
  54726. }
  54727. // method id "compute.interconnectAttachments.get":
  54728. type InterconnectAttachmentsGetCall struct {
  54729. s *Service
  54730. project string
  54731. region string
  54732. interconnectAttachment string
  54733. urlParams_ gensupport.URLParams
  54734. ifNoneMatch_ string
  54735. ctx_ context.Context
  54736. header_ http.Header
  54737. }
  54738. // Get: Returns the specified interconnect attachment.
  54739. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  54740. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54741. c.project = project
  54742. c.region = region
  54743. c.interconnectAttachment = interconnectAttachment
  54744. return c
  54745. }
  54746. // Fields allows partial responses to be retrieved. See
  54747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54748. // for more information.
  54749. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  54750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54751. return c
  54752. }
  54753. // IfNoneMatch sets the optional parameter which makes the operation
  54754. // fail if the object's ETag matches the given value. This is useful for
  54755. // getting updates only after the object has changed since the last
  54756. // request. Use googleapi.IsNotModified to check whether the response
  54757. // error from Do is the result of In-None-Match.
  54758. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  54759. c.ifNoneMatch_ = entityTag
  54760. return c
  54761. }
  54762. // Context sets the context to be used in this call's Do method. Any
  54763. // pending HTTP request will be aborted if the provided context is
  54764. // canceled.
  54765. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  54766. c.ctx_ = ctx
  54767. return c
  54768. }
  54769. // Header returns an http.Header that can be modified by the caller to
  54770. // add HTTP headers to the request.
  54771. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  54772. if c.header_ == nil {
  54773. c.header_ = make(http.Header)
  54774. }
  54775. return c.header_
  54776. }
  54777. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  54778. reqHeaders := make(http.Header)
  54779. for k, v := range c.header_ {
  54780. reqHeaders[k] = v
  54781. }
  54782. reqHeaders.Set("User-Agent", c.s.userAgent())
  54783. if c.ifNoneMatch_ != "" {
  54784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54785. }
  54786. var body io.Reader = nil
  54787. c.urlParams_.Set("alt", alt)
  54788. c.urlParams_.Set("prettyPrint", "false")
  54789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  54790. urls += "?" + c.urlParams_.Encode()
  54791. req, err := http.NewRequest("GET", urls, body)
  54792. if err != nil {
  54793. return nil, err
  54794. }
  54795. req.Header = reqHeaders
  54796. googleapi.Expand(req.URL, map[string]string{
  54797. "project": c.project,
  54798. "region": c.region,
  54799. "interconnectAttachment": c.interconnectAttachment,
  54800. })
  54801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54802. }
  54803. // Do executes the "compute.interconnectAttachments.get" call.
  54804. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  54805. // non-2xx status code is an error. Response headers are in either
  54806. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  54807. // returned at all) in error.(*googleapi.Error).Header. Use
  54808. // googleapi.IsNotModified to check whether the returned error was
  54809. // because http.StatusNotModified was returned.
  54810. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  54811. gensupport.SetOptions(c.urlParams_, opts...)
  54812. res, err := c.doRequest("json")
  54813. if res != nil && res.StatusCode == http.StatusNotModified {
  54814. if res.Body != nil {
  54815. res.Body.Close()
  54816. }
  54817. return nil, &googleapi.Error{
  54818. Code: res.StatusCode,
  54819. Header: res.Header,
  54820. }
  54821. }
  54822. if err != nil {
  54823. return nil, err
  54824. }
  54825. defer googleapi.CloseBody(res)
  54826. if err := googleapi.CheckResponse(res); err != nil {
  54827. return nil, err
  54828. }
  54829. ret := &InterconnectAttachment{
  54830. ServerResponse: googleapi.ServerResponse{
  54831. Header: res.Header,
  54832. HTTPStatusCode: res.StatusCode,
  54833. },
  54834. }
  54835. target := &ret
  54836. if err := gensupport.DecodeResponse(target, res); err != nil {
  54837. return nil, err
  54838. }
  54839. return ret, nil
  54840. // {
  54841. // "description": "Returns the specified interconnect attachment.",
  54842. // "httpMethod": "GET",
  54843. // "id": "compute.interconnectAttachments.get",
  54844. // "parameterOrder": [
  54845. // "project",
  54846. // "region",
  54847. // "interconnectAttachment"
  54848. // ],
  54849. // "parameters": {
  54850. // "interconnectAttachment": {
  54851. // "description": "Name of the interconnect attachment to return.",
  54852. // "location": "path",
  54853. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54854. // "required": true,
  54855. // "type": "string"
  54856. // },
  54857. // "project": {
  54858. // "description": "Project ID for this request.",
  54859. // "location": "path",
  54860. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54861. // "required": true,
  54862. // "type": "string"
  54863. // },
  54864. // "region": {
  54865. // "description": "Name of the region for this request.",
  54866. // "location": "path",
  54867. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54868. // "required": true,
  54869. // "type": "string"
  54870. // }
  54871. // },
  54872. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  54873. // "response": {
  54874. // "$ref": "InterconnectAttachment"
  54875. // },
  54876. // "scopes": [
  54877. // "https://www.googleapis.com/auth/cloud-platform",
  54878. // "https://www.googleapis.com/auth/compute",
  54879. // "https://www.googleapis.com/auth/compute.readonly"
  54880. // ]
  54881. // }
  54882. }
  54883. // method id "compute.interconnectAttachments.insert":
  54884. type InterconnectAttachmentsInsertCall struct {
  54885. s *Service
  54886. project string
  54887. region string
  54888. interconnectattachment *InterconnectAttachment
  54889. urlParams_ gensupport.URLParams
  54890. ctx_ context.Context
  54891. header_ http.Header
  54892. }
  54893. // Insert: Creates an InterconnectAttachment in the specified project
  54894. // using the data included in the request.
  54895. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  54896. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54897. c.project = project
  54898. c.region = region
  54899. c.interconnectattachment = interconnectattachment
  54900. return c
  54901. }
  54902. // RequestId sets the optional parameter "requestId": An optional
  54903. // request ID to identify requests. Specify a unique request ID so that
  54904. // if you must retry your request, the server will know to ignore the
  54905. // request if it has already been completed.
  54906. //
  54907. // For example, consider a situation where you make an initial request
  54908. // and the request times out. If you make the request again with the
  54909. // same request ID, the server can check if original operation with the
  54910. // same request ID was received, and if so, will ignore the second
  54911. // request. This prevents clients from accidentally creating duplicate
  54912. // commitments.
  54913. //
  54914. // The request ID must be a valid UUID with the exception that zero UUID
  54915. // is not supported (00000000-0000-0000-0000-000000000000).
  54916. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  54917. c.urlParams_.Set("requestId", requestId)
  54918. return c
  54919. }
  54920. // Fields allows partial responses to be retrieved. See
  54921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54922. // for more information.
  54923. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  54924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54925. return c
  54926. }
  54927. // Context sets the context to be used in this call's Do method. Any
  54928. // pending HTTP request will be aborted if the provided context is
  54929. // canceled.
  54930. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  54931. c.ctx_ = ctx
  54932. return c
  54933. }
  54934. // Header returns an http.Header that can be modified by the caller to
  54935. // add HTTP headers to the request.
  54936. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  54937. if c.header_ == nil {
  54938. c.header_ = make(http.Header)
  54939. }
  54940. return c.header_
  54941. }
  54942. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  54943. reqHeaders := make(http.Header)
  54944. for k, v := range c.header_ {
  54945. reqHeaders[k] = v
  54946. }
  54947. reqHeaders.Set("User-Agent", c.s.userAgent())
  54948. var body io.Reader = nil
  54949. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  54950. if err != nil {
  54951. return nil, err
  54952. }
  54953. reqHeaders.Set("Content-Type", "application/json")
  54954. c.urlParams_.Set("alt", alt)
  54955. c.urlParams_.Set("prettyPrint", "false")
  54956. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  54957. urls += "?" + c.urlParams_.Encode()
  54958. req, err := http.NewRequest("POST", urls, body)
  54959. if err != nil {
  54960. return nil, err
  54961. }
  54962. req.Header = reqHeaders
  54963. googleapi.Expand(req.URL, map[string]string{
  54964. "project": c.project,
  54965. "region": c.region,
  54966. })
  54967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54968. }
  54969. // Do executes the "compute.interconnectAttachments.insert" call.
  54970. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54971. // status code is an error. Response headers are in either
  54972. // *Operation.ServerResponse.Header or (if a response was returned at
  54973. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54974. // to check whether the returned error was because
  54975. // http.StatusNotModified was returned.
  54976. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54977. gensupport.SetOptions(c.urlParams_, opts...)
  54978. res, err := c.doRequest("json")
  54979. if res != nil && res.StatusCode == http.StatusNotModified {
  54980. if res.Body != nil {
  54981. res.Body.Close()
  54982. }
  54983. return nil, &googleapi.Error{
  54984. Code: res.StatusCode,
  54985. Header: res.Header,
  54986. }
  54987. }
  54988. if err != nil {
  54989. return nil, err
  54990. }
  54991. defer googleapi.CloseBody(res)
  54992. if err := googleapi.CheckResponse(res); err != nil {
  54993. return nil, err
  54994. }
  54995. ret := &Operation{
  54996. ServerResponse: googleapi.ServerResponse{
  54997. Header: res.Header,
  54998. HTTPStatusCode: res.StatusCode,
  54999. },
  55000. }
  55001. target := &ret
  55002. if err := gensupport.DecodeResponse(target, res); err != nil {
  55003. return nil, err
  55004. }
  55005. return ret, nil
  55006. // {
  55007. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  55008. // "httpMethod": "POST",
  55009. // "id": "compute.interconnectAttachments.insert",
  55010. // "parameterOrder": [
  55011. // "project",
  55012. // "region"
  55013. // ],
  55014. // "parameters": {
  55015. // "project": {
  55016. // "description": "Project ID for this request.",
  55017. // "location": "path",
  55018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55019. // "required": true,
  55020. // "type": "string"
  55021. // },
  55022. // "region": {
  55023. // "description": "Name of the region for this request.",
  55024. // "location": "path",
  55025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55026. // "required": true,
  55027. // "type": "string"
  55028. // },
  55029. // "requestId": {
  55030. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55031. // "location": "query",
  55032. // "type": "string"
  55033. // }
  55034. // },
  55035. // "path": "{project}/regions/{region}/interconnectAttachments",
  55036. // "request": {
  55037. // "$ref": "InterconnectAttachment"
  55038. // },
  55039. // "response": {
  55040. // "$ref": "Operation"
  55041. // },
  55042. // "scopes": [
  55043. // "https://www.googleapis.com/auth/cloud-platform",
  55044. // "https://www.googleapis.com/auth/compute"
  55045. // ]
  55046. // }
  55047. }
  55048. // method id "compute.interconnectAttachments.list":
  55049. type InterconnectAttachmentsListCall struct {
  55050. s *Service
  55051. project string
  55052. region string
  55053. urlParams_ gensupport.URLParams
  55054. ifNoneMatch_ string
  55055. ctx_ context.Context
  55056. header_ http.Header
  55057. }
  55058. // List: Retrieves the list of interconnect attachments contained within
  55059. // the specified region.
  55060. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  55061. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55062. c.project = project
  55063. c.region = region
  55064. return c
  55065. }
  55066. // Filter sets the optional parameter "filter": A filter expression that
  55067. // filters resources listed in the response. The expression must specify
  55068. // the field name, a comparison operator, and the value that you want to
  55069. // use for filtering. The value must be a string, a number, or a
  55070. // boolean. The comparison operator must be either =, !=, >, or <.
  55071. //
  55072. // For example, if you are filtering Compute Engine instances, you can
  55073. // exclude instances named example-instance by specifying name !=
  55074. // example-instance.
  55075. //
  55076. // You can also filter nested fields. For example, you could specify
  55077. // scheduling.automaticRestart = false to include instances only if they
  55078. // are not scheduled for automatic restarts. You can use filtering on
  55079. // nested fields to filter based on resource labels.
  55080. //
  55081. // To filter on multiple expressions, provide each separate expression
  55082. // within parentheses. For example, (scheduling.automaticRestart = true)
  55083. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55084. // AND expression. However, you can include AND and OR expressions
  55085. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55086. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55087. // true).
  55088. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  55089. c.urlParams_.Set("filter", filter)
  55090. return c
  55091. }
  55092. // MaxResults sets the optional parameter "maxResults": The maximum
  55093. // number of results per page that should be returned. If the number of
  55094. // available results is larger than maxResults, Compute Engine returns a
  55095. // nextPageToken that can be used to get the next page of results in
  55096. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55097. // (Default: 500)
  55098. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  55099. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55100. return c
  55101. }
  55102. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55103. // a certain order. By default, results are returned in alphanumerical
  55104. // order based on the resource name.
  55105. //
  55106. // You can also sort results in descending order based on the creation
  55107. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55108. // based on the creationTimestamp field in reverse chronological order
  55109. // (newest result first). Use this to sort resources like operations so
  55110. // that the newest operation is returned first.
  55111. //
  55112. // Currently, only sorting by name or creationTimestamp desc is
  55113. // supported.
  55114. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  55115. c.urlParams_.Set("orderBy", orderBy)
  55116. return c
  55117. }
  55118. // PageToken sets the optional parameter "pageToken": Specifies a page
  55119. // token to use. Set pageToken to the nextPageToken returned by a
  55120. // previous list request to get the next page of results.
  55121. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  55122. c.urlParams_.Set("pageToken", pageToken)
  55123. return c
  55124. }
  55125. // Fields allows partial responses to be retrieved. See
  55126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55127. // for more information.
  55128. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  55129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55130. return c
  55131. }
  55132. // IfNoneMatch sets the optional parameter which makes the operation
  55133. // fail if the object's ETag matches the given value. This is useful for
  55134. // getting updates only after the object has changed since the last
  55135. // request. Use googleapi.IsNotModified to check whether the response
  55136. // error from Do is the result of In-None-Match.
  55137. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  55138. c.ifNoneMatch_ = entityTag
  55139. return c
  55140. }
  55141. // Context sets the context to be used in this call's Do method. Any
  55142. // pending HTTP request will be aborted if the provided context is
  55143. // canceled.
  55144. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  55145. c.ctx_ = ctx
  55146. return c
  55147. }
  55148. // Header returns an http.Header that can be modified by the caller to
  55149. // add HTTP headers to the request.
  55150. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  55151. if c.header_ == nil {
  55152. c.header_ = make(http.Header)
  55153. }
  55154. return c.header_
  55155. }
  55156. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  55157. reqHeaders := make(http.Header)
  55158. for k, v := range c.header_ {
  55159. reqHeaders[k] = v
  55160. }
  55161. reqHeaders.Set("User-Agent", c.s.userAgent())
  55162. if c.ifNoneMatch_ != "" {
  55163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55164. }
  55165. var body io.Reader = nil
  55166. c.urlParams_.Set("alt", alt)
  55167. c.urlParams_.Set("prettyPrint", "false")
  55168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  55169. urls += "?" + c.urlParams_.Encode()
  55170. req, err := http.NewRequest("GET", urls, body)
  55171. if err != nil {
  55172. return nil, err
  55173. }
  55174. req.Header = reqHeaders
  55175. googleapi.Expand(req.URL, map[string]string{
  55176. "project": c.project,
  55177. "region": c.region,
  55178. })
  55179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55180. }
  55181. // Do executes the "compute.interconnectAttachments.list" call.
  55182. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  55183. // Any non-2xx status code is an error. Response headers are in either
  55184. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  55185. // was returned at all) in error.(*googleapi.Error).Header. Use
  55186. // googleapi.IsNotModified to check whether the returned error was
  55187. // because http.StatusNotModified was returned.
  55188. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  55189. gensupport.SetOptions(c.urlParams_, opts...)
  55190. res, err := c.doRequest("json")
  55191. if res != nil && res.StatusCode == http.StatusNotModified {
  55192. if res.Body != nil {
  55193. res.Body.Close()
  55194. }
  55195. return nil, &googleapi.Error{
  55196. Code: res.StatusCode,
  55197. Header: res.Header,
  55198. }
  55199. }
  55200. if err != nil {
  55201. return nil, err
  55202. }
  55203. defer googleapi.CloseBody(res)
  55204. if err := googleapi.CheckResponse(res); err != nil {
  55205. return nil, err
  55206. }
  55207. ret := &InterconnectAttachmentList{
  55208. ServerResponse: googleapi.ServerResponse{
  55209. Header: res.Header,
  55210. HTTPStatusCode: res.StatusCode,
  55211. },
  55212. }
  55213. target := &ret
  55214. if err := gensupport.DecodeResponse(target, res); err != nil {
  55215. return nil, err
  55216. }
  55217. return ret, nil
  55218. // {
  55219. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  55220. // "httpMethod": "GET",
  55221. // "id": "compute.interconnectAttachments.list",
  55222. // "parameterOrder": [
  55223. // "project",
  55224. // "region"
  55225. // ],
  55226. // "parameters": {
  55227. // "filter": {
  55228. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55229. // "location": "query",
  55230. // "type": "string"
  55231. // },
  55232. // "maxResults": {
  55233. // "default": "500",
  55234. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55235. // "format": "uint32",
  55236. // "location": "query",
  55237. // "minimum": "0",
  55238. // "type": "integer"
  55239. // },
  55240. // "orderBy": {
  55241. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55242. // "location": "query",
  55243. // "type": "string"
  55244. // },
  55245. // "pageToken": {
  55246. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55247. // "location": "query",
  55248. // "type": "string"
  55249. // },
  55250. // "project": {
  55251. // "description": "Project ID for this request.",
  55252. // "location": "path",
  55253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55254. // "required": true,
  55255. // "type": "string"
  55256. // },
  55257. // "region": {
  55258. // "description": "Name of the region for this request.",
  55259. // "location": "path",
  55260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55261. // "required": true,
  55262. // "type": "string"
  55263. // }
  55264. // },
  55265. // "path": "{project}/regions/{region}/interconnectAttachments",
  55266. // "response": {
  55267. // "$ref": "InterconnectAttachmentList"
  55268. // },
  55269. // "scopes": [
  55270. // "https://www.googleapis.com/auth/cloud-platform",
  55271. // "https://www.googleapis.com/auth/compute",
  55272. // "https://www.googleapis.com/auth/compute.readonly"
  55273. // ]
  55274. // }
  55275. }
  55276. // Pages invokes f for each page of results.
  55277. // A non-nil error returned from f will halt the iteration.
  55278. // The provided context supersedes any context provided to the Context method.
  55279. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  55280. c.ctx_ = ctx
  55281. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55282. for {
  55283. x, err := c.Do()
  55284. if err != nil {
  55285. return err
  55286. }
  55287. if err := f(x); err != nil {
  55288. return err
  55289. }
  55290. if x.NextPageToken == "" {
  55291. return nil
  55292. }
  55293. c.PageToken(x.NextPageToken)
  55294. }
  55295. }
  55296. // method id "compute.interconnectAttachments.patch":
  55297. type InterconnectAttachmentsPatchCall struct {
  55298. s *Service
  55299. project string
  55300. region string
  55301. interconnectAttachment string
  55302. interconnectattachment *InterconnectAttachment
  55303. urlParams_ gensupport.URLParams
  55304. ctx_ context.Context
  55305. header_ http.Header
  55306. }
  55307. // Patch: Updates the specified interconnect attachment with the data
  55308. // included in the request. This method supports PATCH semantics and
  55309. // uses the JSON merge patch format and processing rules.
  55310. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  55311. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55312. c.project = project
  55313. c.region = region
  55314. c.interconnectAttachment = interconnectAttachment
  55315. c.interconnectattachment = interconnectattachment
  55316. return c
  55317. }
  55318. // RequestId sets the optional parameter "requestId": An optional
  55319. // request ID to identify requests. Specify a unique request ID so that
  55320. // if you must retry your request, the server will know to ignore the
  55321. // request if it has already been completed.
  55322. //
  55323. // For example, consider a situation where you make an initial request
  55324. // and the request times out. If you make the request again with the
  55325. // same request ID, the server can check if original operation with the
  55326. // same request ID was received, and if so, will ignore the second
  55327. // request. This prevents clients from accidentally creating duplicate
  55328. // commitments.
  55329. //
  55330. // The request ID must be a valid UUID with the exception that zero UUID
  55331. // is not supported (00000000-0000-0000-0000-000000000000).
  55332. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  55333. c.urlParams_.Set("requestId", requestId)
  55334. return c
  55335. }
  55336. // Fields allows partial responses to be retrieved. See
  55337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55338. // for more information.
  55339. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  55340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55341. return c
  55342. }
  55343. // Context sets the context to be used in this call's Do method. Any
  55344. // pending HTTP request will be aborted if the provided context is
  55345. // canceled.
  55346. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  55347. c.ctx_ = ctx
  55348. return c
  55349. }
  55350. // Header returns an http.Header that can be modified by the caller to
  55351. // add HTTP headers to the request.
  55352. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  55353. if c.header_ == nil {
  55354. c.header_ = make(http.Header)
  55355. }
  55356. return c.header_
  55357. }
  55358. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  55359. reqHeaders := make(http.Header)
  55360. for k, v := range c.header_ {
  55361. reqHeaders[k] = v
  55362. }
  55363. reqHeaders.Set("User-Agent", c.s.userAgent())
  55364. var body io.Reader = nil
  55365. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  55366. if err != nil {
  55367. return nil, err
  55368. }
  55369. reqHeaders.Set("Content-Type", "application/json")
  55370. c.urlParams_.Set("alt", alt)
  55371. c.urlParams_.Set("prettyPrint", "false")
  55372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  55373. urls += "?" + c.urlParams_.Encode()
  55374. req, err := http.NewRequest("PATCH", urls, body)
  55375. if err != nil {
  55376. return nil, err
  55377. }
  55378. req.Header = reqHeaders
  55379. googleapi.Expand(req.URL, map[string]string{
  55380. "project": c.project,
  55381. "region": c.region,
  55382. "interconnectAttachment": c.interconnectAttachment,
  55383. })
  55384. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55385. }
  55386. // Do executes the "compute.interconnectAttachments.patch" call.
  55387. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55388. // status code is an error. Response headers are in either
  55389. // *Operation.ServerResponse.Header or (if a response was returned at
  55390. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55391. // to check whether the returned error was because
  55392. // http.StatusNotModified was returned.
  55393. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55394. gensupport.SetOptions(c.urlParams_, opts...)
  55395. res, err := c.doRequest("json")
  55396. if res != nil && res.StatusCode == http.StatusNotModified {
  55397. if res.Body != nil {
  55398. res.Body.Close()
  55399. }
  55400. return nil, &googleapi.Error{
  55401. Code: res.StatusCode,
  55402. Header: res.Header,
  55403. }
  55404. }
  55405. if err != nil {
  55406. return nil, err
  55407. }
  55408. defer googleapi.CloseBody(res)
  55409. if err := googleapi.CheckResponse(res); err != nil {
  55410. return nil, err
  55411. }
  55412. ret := &Operation{
  55413. ServerResponse: googleapi.ServerResponse{
  55414. Header: res.Header,
  55415. HTTPStatusCode: res.StatusCode,
  55416. },
  55417. }
  55418. target := &ret
  55419. if err := gensupport.DecodeResponse(target, res); err != nil {
  55420. return nil, err
  55421. }
  55422. return ret, nil
  55423. // {
  55424. // "description": "Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  55425. // "httpMethod": "PATCH",
  55426. // "id": "compute.interconnectAttachments.patch",
  55427. // "parameterOrder": [
  55428. // "project",
  55429. // "region",
  55430. // "interconnectAttachment"
  55431. // ],
  55432. // "parameters": {
  55433. // "interconnectAttachment": {
  55434. // "description": "Name of the interconnect attachment to patch.",
  55435. // "location": "path",
  55436. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55437. // "required": true,
  55438. // "type": "string"
  55439. // },
  55440. // "project": {
  55441. // "description": "Project ID for this request.",
  55442. // "location": "path",
  55443. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55444. // "required": true,
  55445. // "type": "string"
  55446. // },
  55447. // "region": {
  55448. // "description": "Name of the region scoping this request.",
  55449. // "location": "path",
  55450. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55451. // "required": true,
  55452. // "type": "string"
  55453. // },
  55454. // "requestId": {
  55455. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55456. // "location": "query",
  55457. // "type": "string"
  55458. // }
  55459. // },
  55460. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  55461. // "request": {
  55462. // "$ref": "InterconnectAttachment"
  55463. // },
  55464. // "response": {
  55465. // "$ref": "Operation"
  55466. // },
  55467. // "scopes": [
  55468. // "https://www.googleapis.com/auth/cloud-platform",
  55469. // "https://www.googleapis.com/auth/compute"
  55470. // ]
  55471. // }
  55472. }
  55473. // method id "compute.interconnectLocations.get":
  55474. type InterconnectLocationsGetCall struct {
  55475. s *Service
  55476. project string
  55477. interconnectLocation string
  55478. urlParams_ gensupport.URLParams
  55479. ifNoneMatch_ string
  55480. ctx_ context.Context
  55481. header_ http.Header
  55482. }
  55483. // Get: Returns the details for the specified interconnect location.
  55484. // Gets a list of available interconnect locations by making a list()
  55485. // request.
  55486. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  55487. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55488. c.project = project
  55489. c.interconnectLocation = interconnectLocation
  55490. return c
  55491. }
  55492. // Fields allows partial responses to be retrieved. See
  55493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55494. // for more information.
  55495. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  55496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55497. return c
  55498. }
  55499. // IfNoneMatch sets the optional parameter which makes the operation
  55500. // fail if the object's ETag matches the given value. This is useful for
  55501. // getting updates only after the object has changed since the last
  55502. // request. Use googleapi.IsNotModified to check whether the response
  55503. // error from Do is the result of In-None-Match.
  55504. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  55505. c.ifNoneMatch_ = entityTag
  55506. return c
  55507. }
  55508. // Context sets the context to be used in this call's Do method. Any
  55509. // pending HTTP request will be aborted if the provided context is
  55510. // canceled.
  55511. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  55512. c.ctx_ = ctx
  55513. return c
  55514. }
  55515. // Header returns an http.Header that can be modified by the caller to
  55516. // add HTTP headers to the request.
  55517. func (c *InterconnectLocationsGetCall) Header() http.Header {
  55518. if c.header_ == nil {
  55519. c.header_ = make(http.Header)
  55520. }
  55521. return c.header_
  55522. }
  55523. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  55524. reqHeaders := make(http.Header)
  55525. for k, v := range c.header_ {
  55526. reqHeaders[k] = v
  55527. }
  55528. reqHeaders.Set("User-Agent", c.s.userAgent())
  55529. if c.ifNoneMatch_ != "" {
  55530. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55531. }
  55532. var body io.Reader = nil
  55533. c.urlParams_.Set("alt", alt)
  55534. c.urlParams_.Set("prettyPrint", "false")
  55535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  55536. urls += "?" + c.urlParams_.Encode()
  55537. req, err := http.NewRequest("GET", urls, body)
  55538. if err != nil {
  55539. return nil, err
  55540. }
  55541. req.Header = reqHeaders
  55542. googleapi.Expand(req.URL, map[string]string{
  55543. "project": c.project,
  55544. "interconnectLocation": c.interconnectLocation,
  55545. })
  55546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55547. }
  55548. // Do executes the "compute.interconnectLocations.get" call.
  55549. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  55550. // non-2xx status code is an error. Response headers are in either
  55551. // *InterconnectLocation.ServerResponse.Header or (if a response was
  55552. // returned at all) in error.(*googleapi.Error).Header. Use
  55553. // googleapi.IsNotModified to check whether the returned error was
  55554. // because http.StatusNotModified was returned.
  55555. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  55556. gensupport.SetOptions(c.urlParams_, opts...)
  55557. res, err := c.doRequest("json")
  55558. if res != nil && res.StatusCode == http.StatusNotModified {
  55559. if res.Body != nil {
  55560. res.Body.Close()
  55561. }
  55562. return nil, &googleapi.Error{
  55563. Code: res.StatusCode,
  55564. Header: res.Header,
  55565. }
  55566. }
  55567. if err != nil {
  55568. return nil, err
  55569. }
  55570. defer googleapi.CloseBody(res)
  55571. if err := googleapi.CheckResponse(res); err != nil {
  55572. return nil, err
  55573. }
  55574. ret := &InterconnectLocation{
  55575. ServerResponse: googleapi.ServerResponse{
  55576. Header: res.Header,
  55577. HTTPStatusCode: res.StatusCode,
  55578. },
  55579. }
  55580. target := &ret
  55581. if err := gensupport.DecodeResponse(target, res); err != nil {
  55582. return nil, err
  55583. }
  55584. return ret, nil
  55585. // {
  55586. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  55587. // "httpMethod": "GET",
  55588. // "id": "compute.interconnectLocations.get",
  55589. // "parameterOrder": [
  55590. // "project",
  55591. // "interconnectLocation"
  55592. // ],
  55593. // "parameters": {
  55594. // "interconnectLocation": {
  55595. // "description": "Name of the interconnect location to return.",
  55596. // "location": "path",
  55597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55598. // "required": true,
  55599. // "type": "string"
  55600. // },
  55601. // "project": {
  55602. // "description": "Project ID for this request.",
  55603. // "location": "path",
  55604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55605. // "required": true,
  55606. // "type": "string"
  55607. // }
  55608. // },
  55609. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  55610. // "response": {
  55611. // "$ref": "InterconnectLocation"
  55612. // },
  55613. // "scopes": [
  55614. // "https://www.googleapis.com/auth/cloud-platform",
  55615. // "https://www.googleapis.com/auth/compute",
  55616. // "https://www.googleapis.com/auth/compute.readonly"
  55617. // ]
  55618. // }
  55619. }
  55620. // method id "compute.interconnectLocations.list":
  55621. type InterconnectLocationsListCall struct {
  55622. s *Service
  55623. project string
  55624. urlParams_ gensupport.URLParams
  55625. ifNoneMatch_ string
  55626. ctx_ context.Context
  55627. header_ http.Header
  55628. }
  55629. // List: Retrieves the list of interconnect locations available to the
  55630. // specified project.
  55631. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  55632. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55633. c.project = project
  55634. return c
  55635. }
  55636. // Filter sets the optional parameter "filter": A filter expression that
  55637. // filters resources listed in the response. The expression must specify
  55638. // the field name, a comparison operator, and the value that you want to
  55639. // use for filtering. The value must be a string, a number, or a
  55640. // boolean. The comparison operator must be either =, !=, >, or <.
  55641. //
  55642. // For example, if you are filtering Compute Engine instances, you can
  55643. // exclude instances named example-instance by specifying name !=
  55644. // example-instance.
  55645. //
  55646. // You can also filter nested fields. For example, you could specify
  55647. // scheduling.automaticRestart = false to include instances only if they
  55648. // are not scheduled for automatic restarts. You can use filtering on
  55649. // nested fields to filter based on resource labels.
  55650. //
  55651. // To filter on multiple expressions, provide each separate expression
  55652. // within parentheses. For example, (scheduling.automaticRestart = true)
  55653. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55654. // AND expression. However, you can include AND and OR expressions
  55655. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55656. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55657. // true).
  55658. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  55659. c.urlParams_.Set("filter", filter)
  55660. return c
  55661. }
  55662. // MaxResults sets the optional parameter "maxResults": The maximum
  55663. // number of results per page that should be returned. If the number of
  55664. // available results is larger than maxResults, Compute Engine returns a
  55665. // nextPageToken that can be used to get the next page of results in
  55666. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55667. // (Default: 500)
  55668. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  55669. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55670. return c
  55671. }
  55672. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55673. // a certain order. By default, results are returned in alphanumerical
  55674. // order based on the resource name.
  55675. //
  55676. // You can also sort results in descending order based on the creation
  55677. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55678. // based on the creationTimestamp field in reverse chronological order
  55679. // (newest result first). Use this to sort resources like operations so
  55680. // that the newest operation is returned first.
  55681. //
  55682. // Currently, only sorting by name or creationTimestamp desc is
  55683. // supported.
  55684. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  55685. c.urlParams_.Set("orderBy", orderBy)
  55686. return c
  55687. }
  55688. // PageToken sets the optional parameter "pageToken": Specifies a page
  55689. // token to use. Set pageToken to the nextPageToken returned by a
  55690. // previous list request to get the next page of results.
  55691. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  55692. c.urlParams_.Set("pageToken", pageToken)
  55693. return c
  55694. }
  55695. // Fields allows partial responses to be retrieved. See
  55696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55697. // for more information.
  55698. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  55699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55700. return c
  55701. }
  55702. // IfNoneMatch sets the optional parameter which makes the operation
  55703. // fail if the object's ETag matches the given value. This is useful for
  55704. // getting updates only after the object has changed since the last
  55705. // request. Use googleapi.IsNotModified to check whether the response
  55706. // error from Do is the result of In-None-Match.
  55707. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  55708. c.ifNoneMatch_ = entityTag
  55709. return c
  55710. }
  55711. // Context sets the context to be used in this call's Do method. Any
  55712. // pending HTTP request will be aborted if the provided context is
  55713. // canceled.
  55714. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  55715. c.ctx_ = ctx
  55716. return c
  55717. }
  55718. // Header returns an http.Header that can be modified by the caller to
  55719. // add HTTP headers to the request.
  55720. func (c *InterconnectLocationsListCall) Header() http.Header {
  55721. if c.header_ == nil {
  55722. c.header_ = make(http.Header)
  55723. }
  55724. return c.header_
  55725. }
  55726. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  55727. reqHeaders := make(http.Header)
  55728. for k, v := range c.header_ {
  55729. reqHeaders[k] = v
  55730. }
  55731. reqHeaders.Set("User-Agent", c.s.userAgent())
  55732. if c.ifNoneMatch_ != "" {
  55733. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55734. }
  55735. var body io.Reader = nil
  55736. c.urlParams_.Set("alt", alt)
  55737. c.urlParams_.Set("prettyPrint", "false")
  55738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  55739. urls += "?" + c.urlParams_.Encode()
  55740. req, err := http.NewRequest("GET", urls, body)
  55741. if err != nil {
  55742. return nil, err
  55743. }
  55744. req.Header = reqHeaders
  55745. googleapi.Expand(req.URL, map[string]string{
  55746. "project": c.project,
  55747. })
  55748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55749. }
  55750. // Do executes the "compute.interconnectLocations.list" call.
  55751. // Exactly one of *InterconnectLocationList or error will be non-nil.
  55752. // Any non-2xx status code is an error. Response headers are in either
  55753. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  55754. // returned at all) in error.(*googleapi.Error).Header. Use
  55755. // googleapi.IsNotModified to check whether the returned error was
  55756. // because http.StatusNotModified was returned.
  55757. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  55758. gensupport.SetOptions(c.urlParams_, opts...)
  55759. res, err := c.doRequest("json")
  55760. if res != nil && res.StatusCode == http.StatusNotModified {
  55761. if res.Body != nil {
  55762. res.Body.Close()
  55763. }
  55764. return nil, &googleapi.Error{
  55765. Code: res.StatusCode,
  55766. Header: res.Header,
  55767. }
  55768. }
  55769. if err != nil {
  55770. return nil, err
  55771. }
  55772. defer googleapi.CloseBody(res)
  55773. if err := googleapi.CheckResponse(res); err != nil {
  55774. return nil, err
  55775. }
  55776. ret := &InterconnectLocationList{
  55777. ServerResponse: googleapi.ServerResponse{
  55778. Header: res.Header,
  55779. HTTPStatusCode: res.StatusCode,
  55780. },
  55781. }
  55782. target := &ret
  55783. if err := gensupport.DecodeResponse(target, res); err != nil {
  55784. return nil, err
  55785. }
  55786. return ret, nil
  55787. // {
  55788. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  55789. // "httpMethod": "GET",
  55790. // "id": "compute.interconnectLocations.list",
  55791. // "parameterOrder": [
  55792. // "project"
  55793. // ],
  55794. // "parameters": {
  55795. // "filter": {
  55796. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55797. // "location": "query",
  55798. // "type": "string"
  55799. // },
  55800. // "maxResults": {
  55801. // "default": "500",
  55802. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55803. // "format": "uint32",
  55804. // "location": "query",
  55805. // "minimum": "0",
  55806. // "type": "integer"
  55807. // },
  55808. // "orderBy": {
  55809. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55810. // "location": "query",
  55811. // "type": "string"
  55812. // },
  55813. // "pageToken": {
  55814. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55815. // "location": "query",
  55816. // "type": "string"
  55817. // },
  55818. // "project": {
  55819. // "description": "Project ID for this request.",
  55820. // "location": "path",
  55821. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55822. // "required": true,
  55823. // "type": "string"
  55824. // }
  55825. // },
  55826. // "path": "{project}/global/interconnectLocations",
  55827. // "response": {
  55828. // "$ref": "InterconnectLocationList"
  55829. // },
  55830. // "scopes": [
  55831. // "https://www.googleapis.com/auth/cloud-platform",
  55832. // "https://www.googleapis.com/auth/compute",
  55833. // "https://www.googleapis.com/auth/compute.readonly"
  55834. // ]
  55835. // }
  55836. }
  55837. // Pages invokes f for each page of results.
  55838. // A non-nil error returned from f will halt the iteration.
  55839. // The provided context supersedes any context provided to the Context method.
  55840. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  55841. c.ctx_ = ctx
  55842. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55843. for {
  55844. x, err := c.Do()
  55845. if err != nil {
  55846. return err
  55847. }
  55848. if err := f(x); err != nil {
  55849. return err
  55850. }
  55851. if x.NextPageToken == "" {
  55852. return nil
  55853. }
  55854. c.PageToken(x.NextPageToken)
  55855. }
  55856. }
  55857. // method id "compute.interconnects.delete":
  55858. type InterconnectsDeleteCall struct {
  55859. s *Service
  55860. project string
  55861. interconnect string
  55862. urlParams_ gensupport.URLParams
  55863. ctx_ context.Context
  55864. header_ http.Header
  55865. }
  55866. // Delete: Deletes the specified interconnect.
  55867. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  55868. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55869. c.project = project
  55870. c.interconnect = interconnect
  55871. return c
  55872. }
  55873. // RequestId sets the optional parameter "requestId": An optional
  55874. // request ID to identify requests. Specify a unique request ID so that
  55875. // if you must retry your request, the server will know to ignore the
  55876. // request if it has already been completed.
  55877. //
  55878. // For example, consider a situation where you make an initial request
  55879. // and the request times out. If you make the request again with the
  55880. // same request ID, the server can check if original operation with the
  55881. // same request ID was received, and if so, will ignore the second
  55882. // request. This prevents clients from accidentally creating duplicate
  55883. // commitments.
  55884. //
  55885. // The request ID must be a valid UUID with the exception that zero UUID
  55886. // is not supported (00000000-0000-0000-0000-000000000000).
  55887. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  55888. c.urlParams_.Set("requestId", requestId)
  55889. return c
  55890. }
  55891. // Fields allows partial responses to be retrieved. See
  55892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55893. // for more information.
  55894. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  55895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55896. return c
  55897. }
  55898. // Context sets the context to be used in this call's Do method. Any
  55899. // pending HTTP request will be aborted if the provided context is
  55900. // canceled.
  55901. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  55902. c.ctx_ = ctx
  55903. return c
  55904. }
  55905. // Header returns an http.Header that can be modified by the caller to
  55906. // add HTTP headers to the request.
  55907. func (c *InterconnectsDeleteCall) Header() http.Header {
  55908. if c.header_ == nil {
  55909. c.header_ = make(http.Header)
  55910. }
  55911. return c.header_
  55912. }
  55913. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  55914. reqHeaders := make(http.Header)
  55915. for k, v := range c.header_ {
  55916. reqHeaders[k] = v
  55917. }
  55918. reqHeaders.Set("User-Agent", c.s.userAgent())
  55919. var body io.Reader = nil
  55920. c.urlParams_.Set("alt", alt)
  55921. c.urlParams_.Set("prettyPrint", "false")
  55922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  55923. urls += "?" + c.urlParams_.Encode()
  55924. req, err := http.NewRequest("DELETE", urls, body)
  55925. if err != nil {
  55926. return nil, err
  55927. }
  55928. req.Header = reqHeaders
  55929. googleapi.Expand(req.URL, map[string]string{
  55930. "project": c.project,
  55931. "interconnect": c.interconnect,
  55932. })
  55933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55934. }
  55935. // Do executes the "compute.interconnects.delete" call.
  55936. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55937. // status code is an error. Response headers are in either
  55938. // *Operation.ServerResponse.Header or (if a response was returned at
  55939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55940. // to check whether the returned error was because
  55941. // http.StatusNotModified was returned.
  55942. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55943. gensupport.SetOptions(c.urlParams_, opts...)
  55944. res, err := c.doRequest("json")
  55945. if res != nil && res.StatusCode == http.StatusNotModified {
  55946. if res.Body != nil {
  55947. res.Body.Close()
  55948. }
  55949. return nil, &googleapi.Error{
  55950. Code: res.StatusCode,
  55951. Header: res.Header,
  55952. }
  55953. }
  55954. if err != nil {
  55955. return nil, err
  55956. }
  55957. defer googleapi.CloseBody(res)
  55958. if err := googleapi.CheckResponse(res); err != nil {
  55959. return nil, err
  55960. }
  55961. ret := &Operation{
  55962. ServerResponse: googleapi.ServerResponse{
  55963. Header: res.Header,
  55964. HTTPStatusCode: res.StatusCode,
  55965. },
  55966. }
  55967. target := &ret
  55968. if err := gensupport.DecodeResponse(target, res); err != nil {
  55969. return nil, err
  55970. }
  55971. return ret, nil
  55972. // {
  55973. // "description": "Deletes the specified interconnect.",
  55974. // "httpMethod": "DELETE",
  55975. // "id": "compute.interconnects.delete",
  55976. // "parameterOrder": [
  55977. // "project",
  55978. // "interconnect"
  55979. // ],
  55980. // "parameters": {
  55981. // "interconnect": {
  55982. // "description": "Name of the interconnect to delete.",
  55983. // "location": "path",
  55984. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55985. // "required": true,
  55986. // "type": "string"
  55987. // },
  55988. // "project": {
  55989. // "description": "Project ID for this request.",
  55990. // "location": "path",
  55991. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55992. // "required": true,
  55993. // "type": "string"
  55994. // },
  55995. // "requestId": {
  55996. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55997. // "location": "query",
  55998. // "type": "string"
  55999. // }
  56000. // },
  56001. // "path": "{project}/global/interconnects/{interconnect}",
  56002. // "response": {
  56003. // "$ref": "Operation"
  56004. // },
  56005. // "scopes": [
  56006. // "https://www.googleapis.com/auth/cloud-platform",
  56007. // "https://www.googleapis.com/auth/compute"
  56008. // ]
  56009. // }
  56010. }
  56011. // method id "compute.interconnects.get":
  56012. type InterconnectsGetCall struct {
  56013. s *Service
  56014. project string
  56015. interconnect string
  56016. urlParams_ gensupport.URLParams
  56017. ifNoneMatch_ string
  56018. ctx_ context.Context
  56019. header_ http.Header
  56020. }
  56021. // Get: Returns the specified interconnect. Get a list of available
  56022. // interconnects by making a list() request.
  56023. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  56024. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56025. c.project = project
  56026. c.interconnect = interconnect
  56027. return c
  56028. }
  56029. // Fields allows partial responses to be retrieved. See
  56030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56031. // for more information.
  56032. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  56033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56034. return c
  56035. }
  56036. // IfNoneMatch sets the optional parameter which makes the operation
  56037. // fail if the object's ETag matches the given value. This is useful for
  56038. // getting updates only after the object has changed since the last
  56039. // request. Use googleapi.IsNotModified to check whether the response
  56040. // error from Do is the result of In-None-Match.
  56041. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  56042. c.ifNoneMatch_ = entityTag
  56043. return c
  56044. }
  56045. // Context sets the context to be used in this call's Do method. Any
  56046. // pending HTTP request will be aborted if the provided context is
  56047. // canceled.
  56048. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  56049. c.ctx_ = ctx
  56050. return c
  56051. }
  56052. // Header returns an http.Header that can be modified by the caller to
  56053. // add HTTP headers to the request.
  56054. func (c *InterconnectsGetCall) Header() http.Header {
  56055. if c.header_ == nil {
  56056. c.header_ = make(http.Header)
  56057. }
  56058. return c.header_
  56059. }
  56060. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  56061. reqHeaders := make(http.Header)
  56062. for k, v := range c.header_ {
  56063. reqHeaders[k] = v
  56064. }
  56065. reqHeaders.Set("User-Agent", c.s.userAgent())
  56066. if c.ifNoneMatch_ != "" {
  56067. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56068. }
  56069. var body io.Reader = nil
  56070. c.urlParams_.Set("alt", alt)
  56071. c.urlParams_.Set("prettyPrint", "false")
  56072. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  56073. urls += "?" + c.urlParams_.Encode()
  56074. req, err := http.NewRequest("GET", urls, body)
  56075. if err != nil {
  56076. return nil, err
  56077. }
  56078. req.Header = reqHeaders
  56079. googleapi.Expand(req.URL, map[string]string{
  56080. "project": c.project,
  56081. "interconnect": c.interconnect,
  56082. })
  56083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56084. }
  56085. // Do executes the "compute.interconnects.get" call.
  56086. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  56087. // status code is an error. Response headers are in either
  56088. // *Interconnect.ServerResponse.Header or (if a response was returned at
  56089. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56090. // to check whether the returned error was because
  56091. // http.StatusNotModified was returned.
  56092. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  56093. gensupport.SetOptions(c.urlParams_, opts...)
  56094. res, err := c.doRequest("json")
  56095. if res != nil && res.StatusCode == http.StatusNotModified {
  56096. if res.Body != nil {
  56097. res.Body.Close()
  56098. }
  56099. return nil, &googleapi.Error{
  56100. Code: res.StatusCode,
  56101. Header: res.Header,
  56102. }
  56103. }
  56104. if err != nil {
  56105. return nil, err
  56106. }
  56107. defer googleapi.CloseBody(res)
  56108. if err := googleapi.CheckResponse(res); err != nil {
  56109. return nil, err
  56110. }
  56111. ret := &Interconnect{
  56112. ServerResponse: googleapi.ServerResponse{
  56113. Header: res.Header,
  56114. HTTPStatusCode: res.StatusCode,
  56115. },
  56116. }
  56117. target := &ret
  56118. if err := gensupport.DecodeResponse(target, res); err != nil {
  56119. return nil, err
  56120. }
  56121. return ret, nil
  56122. // {
  56123. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  56124. // "httpMethod": "GET",
  56125. // "id": "compute.interconnects.get",
  56126. // "parameterOrder": [
  56127. // "project",
  56128. // "interconnect"
  56129. // ],
  56130. // "parameters": {
  56131. // "interconnect": {
  56132. // "description": "Name of the interconnect to return.",
  56133. // "location": "path",
  56134. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56135. // "required": true,
  56136. // "type": "string"
  56137. // },
  56138. // "project": {
  56139. // "description": "Project ID for this request.",
  56140. // "location": "path",
  56141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56142. // "required": true,
  56143. // "type": "string"
  56144. // }
  56145. // },
  56146. // "path": "{project}/global/interconnects/{interconnect}",
  56147. // "response": {
  56148. // "$ref": "Interconnect"
  56149. // },
  56150. // "scopes": [
  56151. // "https://www.googleapis.com/auth/cloud-platform",
  56152. // "https://www.googleapis.com/auth/compute",
  56153. // "https://www.googleapis.com/auth/compute.readonly"
  56154. // ]
  56155. // }
  56156. }
  56157. // method id "compute.interconnects.getDiagnostics":
  56158. type InterconnectsGetDiagnosticsCall struct {
  56159. s *Service
  56160. project string
  56161. interconnect string
  56162. urlParams_ gensupport.URLParams
  56163. ifNoneMatch_ string
  56164. ctx_ context.Context
  56165. header_ http.Header
  56166. }
  56167. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  56168. // interconnect.
  56169. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  56170. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56171. c.project = project
  56172. c.interconnect = interconnect
  56173. return c
  56174. }
  56175. // Fields allows partial responses to be retrieved. See
  56176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56177. // for more information.
  56178. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  56179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56180. return c
  56181. }
  56182. // IfNoneMatch sets the optional parameter which makes the operation
  56183. // fail if the object's ETag matches the given value. This is useful for
  56184. // getting updates only after the object has changed since the last
  56185. // request. Use googleapi.IsNotModified to check whether the response
  56186. // error from Do is the result of In-None-Match.
  56187. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  56188. c.ifNoneMatch_ = entityTag
  56189. return c
  56190. }
  56191. // Context sets the context to be used in this call's Do method. Any
  56192. // pending HTTP request will be aborted if the provided context is
  56193. // canceled.
  56194. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  56195. c.ctx_ = ctx
  56196. return c
  56197. }
  56198. // Header returns an http.Header that can be modified by the caller to
  56199. // add HTTP headers to the request.
  56200. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  56201. if c.header_ == nil {
  56202. c.header_ = make(http.Header)
  56203. }
  56204. return c.header_
  56205. }
  56206. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  56207. reqHeaders := make(http.Header)
  56208. for k, v := range c.header_ {
  56209. reqHeaders[k] = v
  56210. }
  56211. reqHeaders.Set("User-Agent", c.s.userAgent())
  56212. if c.ifNoneMatch_ != "" {
  56213. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56214. }
  56215. var body io.Reader = nil
  56216. c.urlParams_.Set("alt", alt)
  56217. c.urlParams_.Set("prettyPrint", "false")
  56218. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  56219. urls += "?" + c.urlParams_.Encode()
  56220. req, err := http.NewRequest("GET", urls, body)
  56221. if err != nil {
  56222. return nil, err
  56223. }
  56224. req.Header = reqHeaders
  56225. googleapi.Expand(req.URL, map[string]string{
  56226. "project": c.project,
  56227. "interconnect": c.interconnect,
  56228. })
  56229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56230. }
  56231. // Do executes the "compute.interconnects.getDiagnostics" call.
  56232. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  56233. // non-nil. Any non-2xx status code is an error. Response headers are in
  56234. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  56235. // (if a response was returned at all) in
  56236. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  56237. // whether the returned error was because http.StatusNotModified was
  56238. // returned.
  56239. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  56240. gensupport.SetOptions(c.urlParams_, opts...)
  56241. res, err := c.doRequest("json")
  56242. if res != nil && res.StatusCode == http.StatusNotModified {
  56243. if res.Body != nil {
  56244. res.Body.Close()
  56245. }
  56246. return nil, &googleapi.Error{
  56247. Code: res.StatusCode,
  56248. Header: res.Header,
  56249. }
  56250. }
  56251. if err != nil {
  56252. return nil, err
  56253. }
  56254. defer googleapi.CloseBody(res)
  56255. if err := googleapi.CheckResponse(res); err != nil {
  56256. return nil, err
  56257. }
  56258. ret := &InterconnectsGetDiagnosticsResponse{
  56259. ServerResponse: googleapi.ServerResponse{
  56260. Header: res.Header,
  56261. HTTPStatusCode: res.StatusCode,
  56262. },
  56263. }
  56264. target := &ret
  56265. if err := gensupport.DecodeResponse(target, res); err != nil {
  56266. return nil, err
  56267. }
  56268. return ret, nil
  56269. // {
  56270. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  56271. // "httpMethod": "GET",
  56272. // "id": "compute.interconnects.getDiagnostics",
  56273. // "parameterOrder": [
  56274. // "project",
  56275. // "interconnect"
  56276. // ],
  56277. // "parameters": {
  56278. // "interconnect": {
  56279. // "description": "Name of the interconnect resource to query.",
  56280. // "location": "path",
  56281. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56282. // "required": true,
  56283. // "type": "string"
  56284. // },
  56285. // "project": {
  56286. // "description": "Project ID for this request.",
  56287. // "location": "path",
  56288. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56289. // "required": true,
  56290. // "type": "string"
  56291. // }
  56292. // },
  56293. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  56294. // "response": {
  56295. // "$ref": "InterconnectsGetDiagnosticsResponse"
  56296. // },
  56297. // "scopes": [
  56298. // "https://www.googleapis.com/auth/cloud-platform",
  56299. // "https://www.googleapis.com/auth/compute",
  56300. // "https://www.googleapis.com/auth/compute.readonly"
  56301. // ]
  56302. // }
  56303. }
  56304. // method id "compute.interconnects.insert":
  56305. type InterconnectsInsertCall struct {
  56306. s *Service
  56307. project string
  56308. interconnect *Interconnect
  56309. urlParams_ gensupport.URLParams
  56310. ctx_ context.Context
  56311. header_ http.Header
  56312. }
  56313. // Insert: Creates a Interconnect in the specified project using the
  56314. // data included in the request.
  56315. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  56316. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56317. c.project = project
  56318. c.interconnect = interconnect
  56319. return c
  56320. }
  56321. // RequestId sets the optional parameter "requestId": An optional
  56322. // request ID to identify requests. Specify a unique request ID so that
  56323. // if you must retry your request, the server will know to ignore the
  56324. // request if it has already been completed.
  56325. //
  56326. // For example, consider a situation where you make an initial request
  56327. // and the request times out. If you make the request again with the
  56328. // same request ID, the server can check if original operation with the
  56329. // same request ID was received, and if so, will ignore the second
  56330. // request. This prevents clients from accidentally creating duplicate
  56331. // commitments.
  56332. //
  56333. // The request ID must be a valid UUID with the exception that zero UUID
  56334. // is not supported (00000000-0000-0000-0000-000000000000).
  56335. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  56336. c.urlParams_.Set("requestId", requestId)
  56337. return c
  56338. }
  56339. // Fields allows partial responses to be retrieved. See
  56340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56341. // for more information.
  56342. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  56343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56344. return c
  56345. }
  56346. // Context sets the context to be used in this call's Do method. Any
  56347. // pending HTTP request will be aborted if the provided context is
  56348. // canceled.
  56349. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  56350. c.ctx_ = ctx
  56351. return c
  56352. }
  56353. // Header returns an http.Header that can be modified by the caller to
  56354. // add HTTP headers to the request.
  56355. func (c *InterconnectsInsertCall) Header() http.Header {
  56356. if c.header_ == nil {
  56357. c.header_ = make(http.Header)
  56358. }
  56359. return c.header_
  56360. }
  56361. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  56362. reqHeaders := make(http.Header)
  56363. for k, v := range c.header_ {
  56364. reqHeaders[k] = v
  56365. }
  56366. reqHeaders.Set("User-Agent", c.s.userAgent())
  56367. var body io.Reader = nil
  56368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  56369. if err != nil {
  56370. return nil, err
  56371. }
  56372. reqHeaders.Set("Content-Type", "application/json")
  56373. c.urlParams_.Set("alt", alt)
  56374. c.urlParams_.Set("prettyPrint", "false")
  56375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  56376. urls += "?" + c.urlParams_.Encode()
  56377. req, err := http.NewRequest("POST", urls, body)
  56378. if err != nil {
  56379. return nil, err
  56380. }
  56381. req.Header = reqHeaders
  56382. googleapi.Expand(req.URL, map[string]string{
  56383. "project": c.project,
  56384. })
  56385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56386. }
  56387. // Do executes the "compute.interconnects.insert" call.
  56388. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56389. // status code is an error. Response headers are in either
  56390. // *Operation.ServerResponse.Header or (if a response was returned at
  56391. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56392. // to check whether the returned error was because
  56393. // http.StatusNotModified was returned.
  56394. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56395. gensupport.SetOptions(c.urlParams_, opts...)
  56396. res, err := c.doRequest("json")
  56397. if res != nil && res.StatusCode == http.StatusNotModified {
  56398. if res.Body != nil {
  56399. res.Body.Close()
  56400. }
  56401. return nil, &googleapi.Error{
  56402. Code: res.StatusCode,
  56403. Header: res.Header,
  56404. }
  56405. }
  56406. if err != nil {
  56407. return nil, err
  56408. }
  56409. defer googleapi.CloseBody(res)
  56410. if err := googleapi.CheckResponse(res); err != nil {
  56411. return nil, err
  56412. }
  56413. ret := &Operation{
  56414. ServerResponse: googleapi.ServerResponse{
  56415. Header: res.Header,
  56416. HTTPStatusCode: res.StatusCode,
  56417. },
  56418. }
  56419. target := &ret
  56420. if err := gensupport.DecodeResponse(target, res); err != nil {
  56421. return nil, err
  56422. }
  56423. return ret, nil
  56424. // {
  56425. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  56426. // "httpMethod": "POST",
  56427. // "id": "compute.interconnects.insert",
  56428. // "parameterOrder": [
  56429. // "project"
  56430. // ],
  56431. // "parameters": {
  56432. // "project": {
  56433. // "description": "Project ID for this request.",
  56434. // "location": "path",
  56435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56436. // "required": true,
  56437. // "type": "string"
  56438. // },
  56439. // "requestId": {
  56440. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56441. // "location": "query",
  56442. // "type": "string"
  56443. // }
  56444. // },
  56445. // "path": "{project}/global/interconnects",
  56446. // "request": {
  56447. // "$ref": "Interconnect"
  56448. // },
  56449. // "response": {
  56450. // "$ref": "Operation"
  56451. // },
  56452. // "scopes": [
  56453. // "https://www.googleapis.com/auth/cloud-platform",
  56454. // "https://www.googleapis.com/auth/compute"
  56455. // ]
  56456. // }
  56457. }
  56458. // method id "compute.interconnects.list":
  56459. type InterconnectsListCall struct {
  56460. s *Service
  56461. project string
  56462. urlParams_ gensupport.URLParams
  56463. ifNoneMatch_ string
  56464. ctx_ context.Context
  56465. header_ http.Header
  56466. }
  56467. // List: Retrieves the list of interconnect available to the specified
  56468. // project.
  56469. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  56470. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56471. c.project = project
  56472. return c
  56473. }
  56474. // Filter sets the optional parameter "filter": A filter expression that
  56475. // filters resources listed in the response. The expression must specify
  56476. // the field name, a comparison operator, and the value that you want to
  56477. // use for filtering. The value must be a string, a number, or a
  56478. // boolean. The comparison operator must be either =, !=, >, or <.
  56479. //
  56480. // For example, if you are filtering Compute Engine instances, you can
  56481. // exclude instances named example-instance by specifying name !=
  56482. // example-instance.
  56483. //
  56484. // You can also filter nested fields. For example, you could specify
  56485. // scheduling.automaticRestart = false to include instances only if they
  56486. // are not scheduled for automatic restarts. You can use filtering on
  56487. // nested fields to filter based on resource labels.
  56488. //
  56489. // To filter on multiple expressions, provide each separate expression
  56490. // within parentheses. For example, (scheduling.automaticRestart = true)
  56491. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56492. // AND expression. However, you can include AND and OR expressions
  56493. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56494. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56495. // true).
  56496. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  56497. c.urlParams_.Set("filter", filter)
  56498. return c
  56499. }
  56500. // MaxResults sets the optional parameter "maxResults": The maximum
  56501. // number of results per page that should be returned. If the number of
  56502. // available results is larger than maxResults, Compute Engine returns a
  56503. // nextPageToken that can be used to get the next page of results in
  56504. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56505. // (Default: 500)
  56506. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  56507. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56508. return c
  56509. }
  56510. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56511. // a certain order. By default, results are returned in alphanumerical
  56512. // order based on the resource name.
  56513. //
  56514. // You can also sort results in descending order based on the creation
  56515. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56516. // based on the creationTimestamp field in reverse chronological order
  56517. // (newest result first). Use this to sort resources like operations so
  56518. // that the newest operation is returned first.
  56519. //
  56520. // Currently, only sorting by name or creationTimestamp desc is
  56521. // supported.
  56522. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  56523. c.urlParams_.Set("orderBy", orderBy)
  56524. return c
  56525. }
  56526. // PageToken sets the optional parameter "pageToken": Specifies a page
  56527. // token to use. Set pageToken to the nextPageToken returned by a
  56528. // previous list request to get the next page of results.
  56529. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  56530. c.urlParams_.Set("pageToken", pageToken)
  56531. return c
  56532. }
  56533. // Fields allows partial responses to be retrieved. See
  56534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56535. // for more information.
  56536. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  56537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56538. return c
  56539. }
  56540. // IfNoneMatch sets the optional parameter which makes the operation
  56541. // fail if the object's ETag matches the given value. This is useful for
  56542. // getting updates only after the object has changed since the last
  56543. // request. Use googleapi.IsNotModified to check whether the response
  56544. // error from Do is the result of In-None-Match.
  56545. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  56546. c.ifNoneMatch_ = entityTag
  56547. return c
  56548. }
  56549. // Context sets the context to be used in this call's Do method. Any
  56550. // pending HTTP request will be aborted if the provided context is
  56551. // canceled.
  56552. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  56553. c.ctx_ = ctx
  56554. return c
  56555. }
  56556. // Header returns an http.Header that can be modified by the caller to
  56557. // add HTTP headers to the request.
  56558. func (c *InterconnectsListCall) Header() http.Header {
  56559. if c.header_ == nil {
  56560. c.header_ = make(http.Header)
  56561. }
  56562. return c.header_
  56563. }
  56564. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  56565. reqHeaders := make(http.Header)
  56566. for k, v := range c.header_ {
  56567. reqHeaders[k] = v
  56568. }
  56569. reqHeaders.Set("User-Agent", c.s.userAgent())
  56570. if c.ifNoneMatch_ != "" {
  56571. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56572. }
  56573. var body io.Reader = nil
  56574. c.urlParams_.Set("alt", alt)
  56575. c.urlParams_.Set("prettyPrint", "false")
  56576. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  56577. urls += "?" + c.urlParams_.Encode()
  56578. req, err := http.NewRequest("GET", urls, body)
  56579. if err != nil {
  56580. return nil, err
  56581. }
  56582. req.Header = reqHeaders
  56583. googleapi.Expand(req.URL, map[string]string{
  56584. "project": c.project,
  56585. })
  56586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56587. }
  56588. // Do executes the "compute.interconnects.list" call.
  56589. // Exactly one of *InterconnectList or error will be non-nil. Any
  56590. // non-2xx status code is an error. Response headers are in either
  56591. // *InterconnectList.ServerResponse.Header or (if a response was
  56592. // returned at all) in error.(*googleapi.Error).Header. Use
  56593. // googleapi.IsNotModified to check whether the returned error was
  56594. // because http.StatusNotModified was returned.
  56595. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  56596. gensupport.SetOptions(c.urlParams_, opts...)
  56597. res, err := c.doRequest("json")
  56598. if res != nil && res.StatusCode == http.StatusNotModified {
  56599. if res.Body != nil {
  56600. res.Body.Close()
  56601. }
  56602. return nil, &googleapi.Error{
  56603. Code: res.StatusCode,
  56604. Header: res.Header,
  56605. }
  56606. }
  56607. if err != nil {
  56608. return nil, err
  56609. }
  56610. defer googleapi.CloseBody(res)
  56611. if err := googleapi.CheckResponse(res); err != nil {
  56612. return nil, err
  56613. }
  56614. ret := &InterconnectList{
  56615. ServerResponse: googleapi.ServerResponse{
  56616. Header: res.Header,
  56617. HTTPStatusCode: res.StatusCode,
  56618. },
  56619. }
  56620. target := &ret
  56621. if err := gensupport.DecodeResponse(target, res); err != nil {
  56622. return nil, err
  56623. }
  56624. return ret, nil
  56625. // {
  56626. // "description": "Retrieves the list of interconnect available to the specified project.",
  56627. // "httpMethod": "GET",
  56628. // "id": "compute.interconnects.list",
  56629. // "parameterOrder": [
  56630. // "project"
  56631. // ],
  56632. // "parameters": {
  56633. // "filter": {
  56634. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56635. // "location": "query",
  56636. // "type": "string"
  56637. // },
  56638. // "maxResults": {
  56639. // "default": "500",
  56640. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56641. // "format": "uint32",
  56642. // "location": "query",
  56643. // "minimum": "0",
  56644. // "type": "integer"
  56645. // },
  56646. // "orderBy": {
  56647. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56648. // "location": "query",
  56649. // "type": "string"
  56650. // },
  56651. // "pageToken": {
  56652. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56653. // "location": "query",
  56654. // "type": "string"
  56655. // },
  56656. // "project": {
  56657. // "description": "Project ID for this request.",
  56658. // "location": "path",
  56659. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56660. // "required": true,
  56661. // "type": "string"
  56662. // }
  56663. // },
  56664. // "path": "{project}/global/interconnects",
  56665. // "response": {
  56666. // "$ref": "InterconnectList"
  56667. // },
  56668. // "scopes": [
  56669. // "https://www.googleapis.com/auth/cloud-platform",
  56670. // "https://www.googleapis.com/auth/compute",
  56671. // "https://www.googleapis.com/auth/compute.readonly"
  56672. // ]
  56673. // }
  56674. }
  56675. // Pages invokes f for each page of results.
  56676. // A non-nil error returned from f will halt the iteration.
  56677. // The provided context supersedes any context provided to the Context method.
  56678. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  56679. c.ctx_ = ctx
  56680. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56681. for {
  56682. x, err := c.Do()
  56683. if err != nil {
  56684. return err
  56685. }
  56686. if err := f(x); err != nil {
  56687. return err
  56688. }
  56689. if x.NextPageToken == "" {
  56690. return nil
  56691. }
  56692. c.PageToken(x.NextPageToken)
  56693. }
  56694. }
  56695. // method id "compute.interconnects.patch":
  56696. type InterconnectsPatchCall struct {
  56697. s *Service
  56698. project string
  56699. interconnect string
  56700. interconnect2 *Interconnect
  56701. urlParams_ gensupport.URLParams
  56702. ctx_ context.Context
  56703. header_ http.Header
  56704. }
  56705. // Patch: Updates the specified interconnect with the data included in
  56706. // the request. This method supports PATCH semantics and uses the JSON
  56707. // merge patch format and processing rules.
  56708. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  56709. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56710. c.project = project
  56711. c.interconnect = interconnect
  56712. c.interconnect2 = interconnect2
  56713. return c
  56714. }
  56715. // RequestId sets the optional parameter "requestId": An optional
  56716. // request ID to identify requests. Specify a unique request ID so that
  56717. // if you must retry your request, the server will know to ignore the
  56718. // request if it has already been completed.
  56719. //
  56720. // For example, consider a situation where you make an initial request
  56721. // and the request times out. If you make the request again with the
  56722. // same request ID, the server can check if original operation with the
  56723. // same request ID was received, and if so, will ignore the second
  56724. // request. This prevents clients from accidentally creating duplicate
  56725. // commitments.
  56726. //
  56727. // The request ID must be a valid UUID with the exception that zero UUID
  56728. // is not supported (00000000-0000-0000-0000-000000000000).
  56729. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  56730. c.urlParams_.Set("requestId", requestId)
  56731. return c
  56732. }
  56733. // Fields allows partial responses to be retrieved. See
  56734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56735. // for more information.
  56736. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  56737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56738. return c
  56739. }
  56740. // Context sets the context to be used in this call's Do method. Any
  56741. // pending HTTP request will be aborted if the provided context is
  56742. // canceled.
  56743. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  56744. c.ctx_ = ctx
  56745. return c
  56746. }
  56747. // Header returns an http.Header that can be modified by the caller to
  56748. // add HTTP headers to the request.
  56749. func (c *InterconnectsPatchCall) Header() http.Header {
  56750. if c.header_ == nil {
  56751. c.header_ = make(http.Header)
  56752. }
  56753. return c.header_
  56754. }
  56755. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  56756. reqHeaders := make(http.Header)
  56757. for k, v := range c.header_ {
  56758. reqHeaders[k] = v
  56759. }
  56760. reqHeaders.Set("User-Agent", c.s.userAgent())
  56761. var body io.Reader = nil
  56762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  56763. if err != nil {
  56764. return nil, err
  56765. }
  56766. reqHeaders.Set("Content-Type", "application/json")
  56767. c.urlParams_.Set("alt", alt)
  56768. c.urlParams_.Set("prettyPrint", "false")
  56769. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  56770. urls += "?" + c.urlParams_.Encode()
  56771. req, err := http.NewRequest("PATCH", urls, body)
  56772. if err != nil {
  56773. return nil, err
  56774. }
  56775. req.Header = reqHeaders
  56776. googleapi.Expand(req.URL, map[string]string{
  56777. "project": c.project,
  56778. "interconnect": c.interconnect,
  56779. })
  56780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56781. }
  56782. // Do executes the "compute.interconnects.patch" call.
  56783. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56784. // status code is an error. Response headers are in either
  56785. // *Operation.ServerResponse.Header or (if a response was returned at
  56786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56787. // to check whether the returned error was because
  56788. // http.StatusNotModified was returned.
  56789. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56790. gensupport.SetOptions(c.urlParams_, opts...)
  56791. res, err := c.doRequest("json")
  56792. if res != nil && res.StatusCode == http.StatusNotModified {
  56793. if res.Body != nil {
  56794. res.Body.Close()
  56795. }
  56796. return nil, &googleapi.Error{
  56797. Code: res.StatusCode,
  56798. Header: res.Header,
  56799. }
  56800. }
  56801. if err != nil {
  56802. return nil, err
  56803. }
  56804. defer googleapi.CloseBody(res)
  56805. if err := googleapi.CheckResponse(res); err != nil {
  56806. return nil, err
  56807. }
  56808. ret := &Operation{
  56809. ServerResponse: googleapi.ServerResponse{
  56810. Header: res.Header,
  56811. HTTPStatusCode: res.StatusCode,
  56812. },
  56813. }
  56814. target := &ret
  56815. if err := gensupport.DecodeResponse(target, res); err != nil {
  56816. return nil, err
  56817. }
  56818. return ret, nil
  56819. // {
  56820. // "description": "Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  56821. // "httpMethod": "PATCH",
  56822. // "id": "compute.interconnects.patch",
  56823. // "parameterOrder": [
  56824. // "project",
  56825. // "interconnect"
  56826. // ],
  56827. // "parameters": {
  56828. // "interconnect": {
  56829. // "description": "Name of the interconnect to update.",
  56830. // "location": "path",
  56831. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56832. // "required": true,
  56833. // "type": "string"
  56834. // },
  56835. // "project": {
  56836. // "description": "Project ID for this request.",
  56837. // "location": "path",
  56838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56839. // "required": true,
  56840. // "type": "string"
  56841. // },
  56842. // "requestId": {
  56843. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56844. // "location": "query",
  56845. // "type": "string"
  56846. // }
  56847. // },
  56848. // "path": "{project}/global/interconnects/{interconnect}",
  56849. // "request": {
  56850. // "$ref": "Interconnect"
  56851. // },
  56852. // "response": {
  56853. // "$ref": "Operation"
  56854. // },
  56855. // "scopes": [
  56856. // "https://www.googleapis.com/auth/cloud-platform",
  56857. // "https://www.googleapis.com/auth/compute"
  56858. // ]
  56859. // }
  56860. }
  56861. // method id "compute.licenseCodes.get":
  56862. type LicenseCodesGetCall struct {
  56863. s *Service
  56864. project string
  56865. licenseCode string
  56866. urlParams_ gensupport.URLParams
  56867. ifNoneMatch_ string
  56868. ctx_ context.Context
  56869. header_ http.Header
  56870. }
  56871. // Get: Return a specified license code. License codes are mirrored
  56872. // across all projects that have permissions to read the License Code.
  56873. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  56874. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56875. c.project = project
  56876. c.licenseCode = licenseCode
  56877. return c
  56878. }
  56879. // Fields allows partial responses to be retrieved. See
  56880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56881. // for more information.
  56882. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  56883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56884. return c
  56885. }
  56886. // IfNoneMatch sets the optional parameter which makes the operation
  56887. // fail if the object's ETag matches the given value. This is useful for
  56888. // getting updates only after the object has changed since the last
  56889. // request. Use googleapi.IsNotModified to check whether the response
  56890. // error from Do is the result of In-None-Match.
  56891. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  56892. c.ifNoneMatch_ = entityTag
  56893. return c
  56894. }
  56895. // Context sets the context to be used in this call's Do method. Any
  56896. // pending HTTP request will be aborted if the provided context is
  56897. // canceled.
  56898. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  56899. c.ctx_ = ctx
  56900. return c
  56901. }
  56902. // Header returns an http.Header that can be modified by the caller to
  56903. // add HTTP headers to the request.
  56904. func (c *LicenseCodesGetCall) Header() http.Header {
  56905. if c.header_ == nil {
  56906. c.header_ = make(http.Header)
  56907. }
  56908. return c.header_
  56909. }
  56910. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  56911. reqHeaders := make(http.Header)
  56912. for k, v := range c.header_ {
  56913. reqHeaders[k] = v
  56914. }
  56915. reqHeaders.Set("User-Agent", c.s.userAgent())
  56916. if c.ifNoneMatch_ != "" {
  56917. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56918. }
  56919. var body io.Reader = nil
  56920. c.urlParams_.Set("alt", alt)
  56921. c.urlParams_.Set("prettyPrint", "false")
  56922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  56923. urls += "?" + c.urlParams_.Encode()
  56924. req, err := http.NewRequest("GET", urls, body)
  56925. if err != nil {
  56926. return nil, err
  56927. }
  56928. req.Header = reqHeaders
  56929. googleapi.Expand(req.URL, map[string]string{
  56930. "project": c.project,
  56931. "licenseCode": c.licenseCode,
  56932. })
  56933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56934. }
  56935. // Do executes the "compute.licenseCodes.get" call.
  56936. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  56937. // status code is an error. Response headers are in either
  56938. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  56939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56940. // to check whether the returned error was because
  56941. // http.StatusNotModified was returned.
  56942. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  56943. gensupport.SetOptions(c.urlParams_, opts...)
  56944. res, err := c.doRequest("json")
  56945. if res != nil && res.StatusCode == http.StatusNotModified {
  56946. if res.Body != nil {
  56947. res.Body.Close()
  56948. }
  56949. return nil, &googleapi.Error{
  56950. Code: res.StatusCode,
  56951. Header: res.Header,
  56952. }
  56953. }
  56954. if err != nil {
  56955. return nil, err
  56956. }
  56957. defer googleapi.CloseBody(res)
  56958. if err := googleapi.CheckResponse(res); err != nil {
  56959. return nil, err
  56960. }
  56961. ret := &LicenseCode{
  56962. ServerResponse: googleapi.ServerResponse{
  56963. Header: res.Header,
  56964. HTTPStatusCode: res.StatusCode,
  56965. },
  56966. }
  56967. target := &ret
  56968. if err := gensupport.DecodeResponse(target, res); err != nil {
  56969. return nil, err
  56970. }
  56971. return ret, nil
  56972. // {
  56973. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  56974. // "httpMethod": "GET",
  56975. // "id": "compute.licenseCodes.get",
  56976. // "parameterOrder": [
  56977. // "project",
  56978. // "licenseCode"
  56979. // ],
  56980. // "parameters": {
  56981. // "licenseCode": {
  56982. // "description": "Number corresponding to the License code resource to return.",
  56983. // "location": "path",
  56984. // "pattern": "[0-9]{0,61}?",
  56985. // "required": true,
  56986. // "type": "string"
  56987. // },
  56988. // "project": {
  56989. // "description": "Project ID for this request.",
  56990. // "location": "path",
  56991. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56992. // "required": true,
  56993. // "type": "string"
  56994. // }
  56995. // },
  56996. // "path": "{project}/global/licenseCodes/{licenseCode}",
  56997. // "response": {
  56998. // "$ref": "LicenseCode"
  56999. // },
  57000. // "scopes": [
  57001. // "https://www.googleapis.com/auth/cloud-platform",
  57002. // "https://www.googleapis.com/auth/compute",
  57003. // "https://www.googleapis.com/auth/compute.readonly"
  57004. // ]
  57005. // }
  57006. }
  57007. // method id "compute.licenseCodes.testIamPermissions":
  57008. type LicenseCodesTestIamPermissionsCall struct {
  57009. s *Service
  57010. project string
  57011. resource string
  57012. testpermissionsrequest *TestPermissionsRequest
  57013. urlParams_ gensupport.URLParams
  57014. ctx_ context.Context
  57015. header_ http.Header
  57016. }
  57017. // TestIamPermissions: Returns permissions that a caller has on the
  57018. // specified resource.
  57019. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  57020. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57021. c.project = project
  57022. c.resource = resource
  57023. c.testpermissionsrequest = testpermissionsrequest
  57024. return c
  57025. }
  57026. // Fields allows partial responses to be retrieved. See
  57027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57028. // for more information.
  57029. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  57030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57031. return c
  57032. }
  57033. // Context sets the context to be used in this call's Do method. Any
  57034. // pending HTTP request will be aborted if the provided context is
  57035. // canceled.
  57036. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  57037. c.ctx_ = ctx
  57038. return c
  57039. }
  57040. // Header returns an http.Header that can be modified by the caller to
  57041. // add HTTP headers to the request.
  57042. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  57043. if c.header_ == nil {
  57044. c.header_ = make(http.Header)
  57045. }
  57046. return c.header_
  57047. }
  57048. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  57049. reqHeaders := make(http.Header)
  57050. for k, v := range c.header_ {
  57051. reqHeaders[k] = v
  57052. }
  57053. reqHeaders.Set("User-Agent", c.s.userAgent())
  57054. var body io.Reader = nil
  57055. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  57056. if err != nil {
  57057. return nil, err
  57058. }
  57059. reqHeaders.Set("Content-Type", "application/json")
  57060. c.urlParams_.Set("alt", alt)
  57061. c.urlParams_.Set("prettyPrint", "false")
  57062. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  57063. urls += "?" + c.urlParams_.Encode()
  57064. req, err := http.NewRequest("POST", urls, body)
  57065. if err != nil {
  57066. return nil, err
  57067. }
  57068. req.Header = reqHeaders
  57069. googleapi.Expand(req.URL, map[string]string{
  57070. "project": c.project,
  57071. "resource": c.resource,
  57072. })
  57073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57074. }
  57075. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  57076. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  57077. // non-2xx status code is an error. Response headers are in either
  57078. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  57079. // returned at all) in error.(*googleapi.Error).Header. Use
  57080. // googleapi.IsNotModified to check whether the returned error was
  57081. // because http.StatusNotModified was returned.
  57082. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  57083. gensupport.SetOptions(c.urlParams_, opts...)
  57084. res, err := c.doRequest("json")
  57085. if res != nil && res.StatusCode == http.StatusNotModified {
  57086. if res.Body != nil {
  57087. res.Body.Close()
  57088. }
  57089. return nil, &googleapi.Error{
  57090. Code: res.StatusCode,
  57091. Header: res.Header,
  57092. }
  57093. }
  57094. if err != nil {
  57095. return nil, err
  57096. }
  57097. defer googleapi.CloseBody(res)
  57098. if err := googleapi.CheckResponse(res); err != nil {
  57099. return nil, err
  57100. }
  57101. ret := &TestPermissionsResponse{
  57102. ServerResponse: googleapi.ServerResponse{
  57103. Header: res.Header,
  57104. HTTPStatusCode: res.StatusCode,
  57105. },
  57106. }
  57107. target := &ret
  57108. if err := gensupport.DecodeResponse(target, res); err != nil {
  57109. return nil, err
  57110. }
  57111. return ret, nil
  57112. // {
  57113. // "description": "Returns permissions that a caller has on the specified resource.",
  57114. // "httpMethod": "POST",
  57115. // "id": "compute.licenseCodes.testIamPermissions",
  57116. // "parameterOrder": [
  57117. // "project",
  57118. // "resource"
  57119. // ],
  57120. // "parameters": {
  57121. // "project": {
  57122. // "description": "Project ID for this request.",
  57123. // "location": "path",
  57124. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57125. // "required": true,
  57126. // "type": "string"
  57127. // },
  57128. // "resource": {
  57129. // "description": "Name or id of the resource for this request.",
  57130. // "location": "path",
  57131. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57132. // "required": true,
  57133. // "type": "string"
  57134. // }
  57135. // },
  57136. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  57137. // "request": {
  57138. // "$ref": "TestPermissionsRequest"
  57139. // },
  57140. // "response": {
  57141. // "$ref": "TestPermissionsResponse"
  57142. // },
  57143. // "scopes": [
  57144. // "https://www.googleapis.com/auth/cloud-platform",
  57145. // "https://www.googleapis.com/auth/compute",
  57146. // "https://www.googleapis.com/auth/compute.readonly"
  57147. // ]
  57148. // }
  57149. }
  57150. // method id "compute.licenses.delete":
  57151. type LicensesDeleteCall struct {
  57152. s *Service
  57153. project string
  57154. license string
  57155. urlParams_ gensupport.URLParams
  57156. ctx_ context.Context
  57157. header_ http.Header
  57158. }
  57159. // Delete: Deletes the specified license.
  57160. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  57161. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57162. c.project = project
  57163. c.license = license
  57164. return c
  57165. }
  57166. // RequestId sets the optional parameter "requestId": An optional
  57167. // request ID to identify requests. Specify a unique request ID so that
  57168. // if you must retry your request, the server will know to ignore the
  57169. // request if it has already been completed.
  57170. //
  57171. // For example, consider a situation where you make an initial request
  57172. // and the request times out. If you make the request again with the
  57173. // same request ID, the server can check if original operation with the
  57174. // same request ID was received, and if so, will ignore the second
  57175. // request. This prevents clients from accidentally creating duplicate
  57176. // commitments.
  57177. //
  57178. // The request ID must be a valid UUID with the exception that zero UUID
  57179. // is not supported (00000000-0000-0000-0000-000000000000).
  57180. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  57181. c.urlParams_.Set("requestId", requestId)
  57182. return c
  57183. }
  57184. // Fields allows partial responses to be retrieved. See
  57185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57186. // for more information.
  57187. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  57188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57189. return c
  57190. }
  57191. // Context sets the context to be used in this call's Do method. Any
  57192. // pending HTTP request will be aborted if the provided context is
  57193. // canceled.
  57194. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  57195. c.ctx_ = ctx
  57196. return c
  57197. }
  57198. // Header returns an http.Header that can be modified by the caller to
  57199. // add HTTP headers to the request.
  57200. func (c *LicensesDeleteCall) Header() http.Header {
  57201. if c.header_ == nil {
  57202. c.header_ = make(http.Header)
  57203. }
  57204. return c.header_
  57205. }
  57206. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  57207. reqHeaders := make(http.Header)
  57208. for k, v := range c.header_ {
  57209. reqHeaders[k] = v
  57210. }
  57211. reqHeaders.Set("User-Agent", c.s.userAgent())
  57212. var body io.Reader = nil
  57213. c.urlParams_.Set("alt", alt)
  57214. c.urlParams_.Set("prettyPrint", "false")
  57215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  57216. urls += "?" + c.urlParams_.Encode()
  57217. req, err := http.NewRequest("DELETE", urls, body)
  57218. if err != nil {
  57219. return nil, err
  57220. }
  57221. req.Header = reqHeaders
  57222. googleapi.Expand(req.URL, map[string]string{
  57223. "project": c.project,
  57224. "license": c.license,
  57225. })
  57226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57227. }
  57228. // Do executes the "compute.licenses.delete" call.
  57229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57230. // status code is an error. Response headers are in either
  57231. // *Operation.ServerResponse.Header or (if a response was returned at
  57232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57233. // to check whether the returned error was because
  57234. // http.StatusNotModified was returned.
  57235. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57236. gensupport.SetOptions(c.urlParams_, opts...)
  57237. res, err := c.doRequest("json")
  57238. if res != nil && res.StatusCode == http.StatusNotModified {
  57239. if res.Body != nil {
  57240. res.Body.Close()
  57241. }
  57242. return nil, &googleapi.Error{
  57243. Code: res.StatusCode,
  57244. Header: res.Header,
  57245. }
  57246. }
  57247. if err != nil {
  57248. return nil, err
  57249. }
  57250. defer googleapi.CloseBody(res)
  57251. if err := googleapi.CheckResponse(res); err != nil {
  57252. return nil, err
  57253. }
  57254. ret := &Operation{
  57255. ServerResponse: googleapi.ServerResponse{
  57256. Header: res.Header,
  57257. HTTPStatusCode: res.StatusCode,
  57258. },
  57259. }
  57260. target := &ret
  57261. if err := gensupport.DecodeResponse(target, res); err != nil {
  57262. return nil, err
  57263. }
  57264. return ret, nil
  57265. // {
  57266. // "description": "Deletes the specified license.",
  57267. // "httpMethod": "DELETE",
  57268. // "id": "compute.licenses.delete",
  57269. // "parameterOrder": [
  57270. // "project",
  57271. // "license"
  57272. // ],
  57273. // "parameters": {
  57274. // "license": {
  57275. // "description": "Name of the license resource to delete.",
  57276. // "location": "path",
  57277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57278. // "required": true,
  57279. // "type": "string"
  57280. // },
  57281. // "project": {
  57282. // "description": "Project ID for this request.",
  57283. // "location": "path",
  57284. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57285. // "required": true,
  57286. // "type": "string"
  57287. // },
  57288. // "requestId": {
  57289. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57290. // "location": "query",
  57291. // "type": "string"
  57292. // }
  57293. // },
  57294. // "path": "{project}/global/licenses/{license}",
  57295. // "response": {
  57296. // "$ref": "Operation"
  57297. // },
  57298. // "scopes": [
  57299. // "https://www.googleapis.com/auth/cloud-platform",
  57300. // "https://www.googleapis.com/auth/compute"
  57301. // ]
  57302. // }
  57303. }
  57304. // method id "compute.licenses.get":
  57305. type LicensesGetCall struct {
  57306. s *Service
  57307. project string
  57308. license string
  57309. urlParams_ gensupport.URLParams
  57310. ifNoneMatch_ string
  57311. ctx_ context.Context
  57312. header_ http.Header
  57313. }
  57314. // Get: Returns the specified License resource.
  57315. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  57316. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  57317. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57318. c.project = project
  57319. c.license = license
  57320. return c
  57321. }
  57322. // Fields allows partial responses to be retrieved. See
  57323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57324. // for more information.
  57325. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  57326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57327. return c
  57328. }
  57329. // IfNoneMatch sets the optional parameter which makes the operation
  57330. // fail if the object's ETag matches the given value. This is useful for
  57331. // getting updates only after the object has changed since the last
  57332. // request. Use googleapi.IsNotModified to check whether the response
  57333. // error from Do is the result of In-None-Match.
  57334. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  57335. c.ifNoneMatch_ = entityTag
  57336. return c
  57337. }
  57338. // Context sets the context to be used in this call's Do method. Any
  57339. // pending HTTP request will be aborted if the provided context is
  57340. // canceled.
  57341. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  57342. c.ctx_ = ctx
  57343. return c
  57344. }
  57345. // Header returns an http.Header that can be modified by the caller to
  57346. // add HTTP headers to the request.
  57347. func (c *LicensesGetCall) Header() http.Header {
  57348. if c.header_ == nil {
  57349. c.header_ = make(http.Header)
  57350. }
  57351. return c.header_
  57352. }
  57353. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  57354. reqHeaders := make(http.Header)
  57355. for k, v := range c.header_ {
  57356. reqHeaders[k] = v
  57357. }
  57358. reqHeaders.Set("User-Agent", c.s.userAgent())
  57359. if c.ifNoneMatch_ != "" {
  57360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57361. }
  57362. var body io.Reader = nil
  57363. c.urlParams_.Set("alt", alt)
  57364. c.urlParams_.Set("prettyPrint", "false")
  57365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  57366. urls += "?" + c.urlParams_.Encode()
  57367. req, err := http.NewRequest("GET", urls, body)
  57368. if err != nil {
  57369. return nil, err
  57370. }
  57371. req.Header = reqHeaders
  57372. googleapi.Expand(req.URL, map[string]string{
  57373. "project": c.project,
  57374. "license": c.license,
  57375. })
  57376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57377. }
  57378. // Do executes the "compute.licenses.get" call.
  57379. // Exactly one of *License or error will be non-nil. Any non-2xx status
  57380. // code is an error. Response headers are in either
  57381. // *License.ServerResponse.Header or (if a response was returned at all)
  57382. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  57383. // check whether the returned error was because http.StatusNotModified
  57384. // was returned.
  57385. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  57386. gensupport.SetOptions(c.urlParams_, opts...)
  57387. res, err := c.doRequest("json")
  57388. if res != nil && res.StatusCode == http.StatusNotModified {
  57389. if res.Body != nil {
  57390. res.Body.Close()
  57391. }
  57392. return nil, &googleapi.Error{
  57393. Code: res.StatusCode,
  57394. Header: res.Header,
  57395. }
  57396. }
  57397. if err != nil {
  57398. return nil, err
  57399. }
  57400. defer googleapi.CloseBody(res)
  57401. if err := googleapi.CheckResponse(res); err != nil {
  57402. return nil, err
  57403. }
  57404. ret := &License{
  57405. ServerResponse: googleapi.ServerResponse{
  57406. Header: res.Header,
  57407. HTTPStatusCode: res.StatusCode,
  57408. },
  57409. }
  57410. target := &ret
  57411. if err := gensupport.DecodeResponse(target, res); err != nil {
  57412. return nil, err
  57413. }
  57414. return ret, nil
  57415. // {
  57416. // "description": "Returns the specified License resource.",
  57417. // "httpMethod": "GET",
  57418. // "id": "compute.licenses.get",
  57419. // "parameterOrder": [
  57420. // "project",
  57421. // "license"
  57422. // ],
  57423. // "parameters": {
  57424. // "license": {
  57425. // "description": "Name of the License resource to return.",
  57426. // "location": "path",
  57427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57428. // "required": true,
  57429. // "type": "string"
  57430. // },
  57431. // "project": {
  57432. // "description": "Project ID for this request.",
  57433. // "location": "path",
  57434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57435. // "required": true,
  57436. // "type": "string"
  57437. // }
  57438. // },
  57439. // "path": "{project}/global/licenses/{license}",
  57440. // "response": {
  57441. // "$ref": "License"
  57442. // },
  57443. // "scopes": [
  57444. // "https://www.googleapis.com/auth/cloud-platform",
  57445. // "https://www.googleapis.com/auth/compute",
  57446. // "https://www.googleapis.com/auth/compute.readonly"
  57447. // ]
  57448. // }
  57449. }
  57450. // method id "compute.licenses.getIamPolicy":
  57451. type LicensesGetIamPolicyCall struct {
  57452. s *Service
  57453. project string
  57454. resource string
  57455. urlParams_ gensupport.URLParams
  57456. ifNoneMatch_ string
  57457. ctx_ context.Context
  57458. header_ http.Header
  57459. }
  57460. // GetIamPolicy: Gets the access control policy for a resource. May be
  57461. // empty if no such policy or resource exists.
  57462. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  57463. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57464. c.project = project
  57465. c.resource = resource
  57466. return c
  57467. }
  57468. // Fields allows partial responses to be retrieved. See
  57469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57470. // for more information.
  57471. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  57472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57473. return c
  57474. }
  57475. // IfNoneMatch sets the optional parameter which makes the operation
  57476. // fail if the object's ETag matches the given value. This is useful for
  57477. // getting updates only after the object has changed since the last
  57478. // request. Use googleapi.IsNotModified to check whether the response
  57479. // error from Do is the result of In-None-Match.
  57480. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  57481. c.ifNoneMatch_ = entityTag
  57482. return c
  57483. }
  57484. // Context sets the context to be used in this call's Do method. Any
  57485. // pending HTTP request will be aborted if the provided context is
  57486. // canceled.
  57487. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  57488. c.ctx_ = ctx
  57489. return c
  57490. }
  57491. // Header returns an http.Header that can be modified by the caller to
  57492. // add HTTP headers to the request.
  57493. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  57494. if c.header_ == nil {
  57495. c.header_ = make(http.Header)
  57496. }
  57497. return c.header_
  57498. }
  57499. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  57500. reqHeaders := make(http.Header)
  57501. for k, v := range c.header_ {
  57502. reqHeaders[k] = v
  57503. }
  57504. reqHeaders.Set("User-Agent", c.s.userAgent())
  57505. if c.ifNoneMatch_ != "" {
  57506. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57507. }
  57508. var body io.Reader = nil
  57509. c.urlParams_.Set("alt", alt)
  57510. c.urlParams_.Set("prettyPrint", "false")
  57511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  57512. urls += "?" + c.urlParams_.Encode()
  57513. req, err := http.NewRequest("GET", urls, body)
  57514. if err != nil {
  57515. return nil, err
  57516. }
  57517. req.Header = reqHeaders
  57518. googleapi.Expand(req.URL, map[string]string{
  57519. "project": c.project,
  57520. "resource": c.resource,
  57521. })
  57522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57523. }
  57524. // Do executes the "compute.licenses.getIamPolicy" call.
  57525. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  57526. // code is an error. Response headers are in either
  57527. // *Policy.ServerResponse.Header or (if a response was returned at all)
  57528. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  57529. // check whether the returned error was because http.StatusNotModified
  57530. // was returned.
  57531. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  57532. gensupport.SetOptions(c.urlParams_, opts...)
  57533. res, err := c.doRequest("json")
  57534. if res != nil && res.StatusCode == http.StatusNotModified {
  57535. if res.Body != nil {
  57536. res.Body.Close()
  57537. }
  57538. return nil, &googleapi.Error{
  57539. Code: res.StatusCode,
  57540. Header: res.Header,
  57541. }
  57542. }
  57543. if err != nil {
  57544. return nil, err
  57545. }
  57546. defer googleapi.CloseBody(res)
  57547. if err := googleapi.CheckResponse(res); err != nil {
  57548. return nil, err
  57549. }
  57550. ret := &Policy{
  57551. ServerResponse: googleapi.ServerResponse{
  57552. Header: res.Header,
  57553. HTTPStatusCode: res.StatusCode,
  57554. },
  57555. }
  57556. target := &ret
  57557. if err := gensupport.DecodeResponse(target, res); err != nil {
  57558. return nil, err
  57559. }
  57560. return ret, nil
  57561. // {
  57562. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  57563. // "httpMethod": "GET",
  57564. // "id": "compute.licenses.getIamPolicy",
  57565. // "parameterOrder": [
  57566. // "project",
  57567. // "resource"
  57568. // ],
  57569. // "parameters": {
  57570. // "project": {
  57571. // "description": "Project ID for this request.",
  57572. // "location": "path",
  57573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57574. // "required": true,
  57575. // "type": "string"
  57576. // },
  57577. // "resource": {
  57578. // "description": "Name or id of the resource for this request.",
  57579. // "location": "path",
  57580. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57581. // "required": true,
  57582. // "type": "string"
  57583. // }
  57584. // },
  57585. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  57586. // "response": {
  57587. // "$ref": "Policy"
  57588. // },
  57589. // "scopes": [
  57590. // "https://www.googleapis.com/auth/cloud-platform",
  57591. // "https://www.googleapis.com/auth/compute",
  57592. // "https://www.googleapis.com/auth/compute.readonly"
  57593. // ]
  57594. // }
  57595. }
  57596. // method id "compute.licenses.insert":
  57597. type LicensesInsertCall struct {
  57598. s *Service
  57599. project string
  57600. license *License
  57601. urlParams_ gensupport.URLParams
  57602. ctx_ context.Context
  57603. header_ http.Header
  57604. }
  57605. // Insert: Create a License resource in the specified project.
  57606. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  57607. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57608. c.project = project
  57609. c.license = license
  57610. return c
  57611. }
  57612. // RequestId sets the optional parameter "requestId": An optional
  57613. // request ID to identify requests. Specify a unique request ID so that
  57614. // if you must retry your request, the server will know to ignore the
  57615. // request if it has already been completed.
  57616. //
  57617. // For example, consider a situation where you make an initial request
  57618. // and the request times out. If you make the request again with the
  57619. // same request ID, the server can check if original operation with the
  57620. // same request ID was received, and if so, will ignore the second
  57621. // request. This prevents clients from accidentally creating duplicate
  57622. // commitments.
  57623. //
  57624. // The request ID must be a valid UUID with the exception that zero UUID
  57625. // is not supported (00000000-0000-0000-0000-000000000000).
  57626. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  57627. c.urlParams_.Set("requestId", requestId)
  57628. return c
  57629. }
  57630. // Fields allows partial responses to be retrieved. See
  57631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57632. // for more information.
  57633. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  57634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57635. return c
  57636. }
  57637. // Context sets the context to be used in this call's Do method. Any
  57638. // pending HTTP request will be aborted if the provided context is
  57639. // canceled.
  57640. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  57641. c.ctx_ = ctx
  57642. return c
  57643. }
  57644. // Header returns an http.Header that can be modified by the caller to
  57645. // add HTTP headers to the request.
  57646. func (c *LicensesInsertCall) Header() http.Header {
  57647. if c.header_ == nil {
  57648. c.header_ = make(http.Header)
  57649. }
  57650. return c.header_
  57651. }
  57652. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  57653. reqHeaders := make(http.Header)
  57654. for k, v := range c.header_ {
  57655. reqHeaders[k] = v
  57656. }
  57657. reqHeaders.Set("User-Agent", c.s.userAgent())
  57658. var body io.Reader = nil
  57659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  57660. if err != nil {
  57661. return nil, err
  57662. }
  57663. reqHeaders.Set("Content-Type", "application/json")
  57664. c.urlParams_.Set("alt", alt)
  57665. c.urlParams_.Set("prettyPrint", "false")
  57666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  57667. urls += "?" + c.urlParams_.Encode()
  57668. req, err := http.NewRequest("POST", urls, body)
  57669. if err != nil {
  57670. return nil, err
  57671. }
  57672. req.Header = reqHeaders
  57673. googleapi.Expand(req.URL, map[string]string{
  57674. "project": c.project,
  57675. })
  57676. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57677. }
  57678. // Do executes the "compute.licenses.insert" call.
  57679. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57680. // status code is an error. Response headers are in either
  57681. // *Operation.ServerResponse.Header or (if a response was returned at
  57682. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57683. // to check whether the returned error was because
  57684. // http.StatusNotModified was returned.
  57685. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57686. gensupport.SetOptions(c.urlParams_, opts...)
  57687. res, err := c.doRequest("json")
  57688. if res != nil && res.StatusCode == http.StatusNotModified {
  57689. if res.Body != nil {
  57690. res.Body.Close()
  57691. }
  57692. return nil, &googleapi.Error{
  57693. Code: res.StatusCode,
  57694. Header: res.Header,
  57695. }
  57696. }
  57697. if err != nil {
  57698. return nil, err
  57699. }
  57700. defer googleapi.CloseBody(res)
  57701. if err := googleapi.CheckResponse(res); err != nil {
  57702. return nil, err
  57703. }
  57704. ret := &Operation{
  57705. ServerResponse: googleapi.ServerResponse{
  57706. Header: res.Header,
  57707. HTTPStatusCode: res.StatusCode,
  57708. },
  57709. }
  57710. target := &ret
  57711. if err := gensupport.DecodeResponse(target, res); err != nil {
  57712. return nil, err
  57713. }
  57714. return ret, nil
  57715. // {
  57716. // "description": "Create a License resource in the specified project.",
  57717. // "httpMethod": "POST",
  57718. // "id": "compute.licenses.insert",
  57719. // "parameterOrder": [
  57720. // "project"
  57721. // ],
  57722. // "parameters": {
  57723. // "project": {
  57724. // "description": "Project ID for this request.",
  57725. // "location": "path",
  57726. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57727. // "required": true,
  57728. // "type": "string"
  57729. // },
  57730. // "requestId": {
  57731. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57732. // "location": "query",
  57733. // "type": "string"
  57734. // }
  57735. // },
  57736. // "path": "{project}/global/licenses",
  57737. // "request": {
  57738. // "$ref": "License"
  57739. // },
  57740. // "response": {
  57741. // "$ref": "Operation"
  57742. // },
  57743. // "scopes": [
  57744. // "https://www.googleapis.com/auth/cloud-platform",
  57745. // "https://www.googleapis.com/auth/compute",
  57746. // "https://www.googleapis.com/auth/devstorage.full_control",
  57747. // "https://www.googleapis.com/auth/devstorage.read_only",
  57748. // "https://www.googleapis.com/auth/devstorage.read_write"
  57749. // ]
  57750. // }
  57751. }
  57752. // method id "compute.licenses.list":
  57753. type LicensesListCall struct {
  57754. s *Service
  57755. project string
  57756. urlParams_ gensupport.URLParams
  57757. ifNoneMatch_ string
  57758. ctx_ context.Context
  57759. header_ http.Header
  57760. }
  57761. // List: Retrieves the list of licenses available in the specified
  57762. // project. This method does not get any licenses that belong to other
  57763. // projects, including licenses attached to publicly-available images,
  57764. // like Debian 9. If you want to get a list of publicly-available
  57765. // licenses, use this method to make a request to the respective image
  57766. // project, such as debian-cloud or windows-cloud.
  57767. func (r *LicensesService) List(project string) *LicensesListCall {
  57768. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57769. c.project = project
  57770. return c
  57771. }
  57772. // Filter sets the optional parameter "filter": A filter expression that
  57773. // filters resources listed in the response. The expression must specify
  57774. // the field name, a comparison operator, and the value that you want to
  57775. // use for filtering. The value must be a string, a number, or a
  57776. // boolean. The comparison operator must be either =, !=, >, or <.
  57777. //
  57778. // For example, if you are filtering Compute Engine instances, you can
  57779. // exclude instances named example-instance by specifying name !=
  57780. // example-instance.
  57781. //
  57782. // You can also filter nested fields. For example, you could specify
  57783. // scheduling.automaticRestart = false to include instances only if they
  57784. // are not scheduled for automatic restarts. You can use filtering on
  57785. // nested fields to filter based on resource labels.
  57786. //
  57787. // To filter on multiple expressions, provide each separate expression
  57788. // within parentheses. For example, (scheduling.automaticRestart = true)
  57789. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57790. // AND expression. However, you can include AND and OR expressions
  57791. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57792. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57793. // true).
  57794. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  57795. c.urlParams_.Set("filter", filter)
  57796. return c
  57797. }
  57798. // MaxResults sets the optional parameter "maxResults": The maximum
  57799. // number of results per page that should be returned. If the number of
  57800. // available results is larger than maxResults, Compute Engine returns a
  57801. // nextPageToken that can be used to get the next page of results in
  57802. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57803. // (Default: 500)
  57804. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  57805. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57806. return c
  57807. }
  57808. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57809. // a certain order. By default, results are returned in alphanumerical
  57810. // order based on the resource name.
  57811. //
  57812. // You can also sort results in descending order based on the creation
  57813. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57814. // based on the creationTimestamp field in reverse chronological order
  57815. // (newest result first). Use this to sort resources like operations so
  57816. // that the newest operation is returned first.
  57817. //
  57818. // Currently, only sorting by name or creationTimestamp desc is
  57819. // supported.
  57820. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  57821. c.urlParams_.Set("orderBy", orderBy)
  57822. return c
  57823. }
  57824. // PageToken sets the optional parameter "pageToken": Specifies a page
  57825. // token to use. Set pageToken to the nextPageToken returned by a
  57826. // previous list request to get the next page of results.
  57827. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  57828. c.urlParams_.Set("pageToken", pageToken)
  57829. return c
  57830. }
  57831. // Fields allows partial responses to be retrieved. See
  57832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57833. // for more information.
  57834. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  57835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57836. return c
  57837. }
  57838. // IfNoneMatch sets the optional parameter which makes the operation
  57839. // fail if the object's ETag matches the given value. This is useful for
  57840. // getting updates only after the object has changed since the last
  57841. // request. Use googleapi.IsNotModified to check whether the response
  57842. // error from Do is the result of In-None-Match.
  57843. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  57844. c.ifNoneMatch_ = entityTag
  57845. return c
  57846. }
  57847. // Context sets the context to be used in this call's Do method. Any
  57848. // pending HTTP request will be aborted if the provided context is
  57849. // canceled.
  57850. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  57851. c.ctx_ = ctx
  57852. return c
  57853. }
  57854. // Header returns an http.Header that can be modified by the caller to
  57855. // add HTTP headers to the request.
  57856. func (c *LicensesListCall) Header() http.Header {
  57857. if c.header_ == nil {
  57858. c.header_ = make(http.Header)
  57859. }
  57860. return c.header_
  57861. }
  57862. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  57863. reqHeaders := make(http.Header)
  57864. for k, v := range c.header_ {
  57865. reqHeaders[k] = v
  57866. }
  57867. reqHeaders.Set("User-Agent", c.s.userAgent())
  57868. if c.ifNoneMatch_ != "" {
  57869. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57870. }
  57871. var body io.Reader = nil
  57872. c.urlParams_.Set("alt", alt)
  57873. c.urlParams_.Set("prettyPrint", "false")
  57874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  57875. urls += "?" + c.urlParams_.Encode()
  57876. req, err := http.NewRequest("GET", urls, body)
  57877. if err != nil {
  57878. return nil, err
  57879. }
  57880. req.Header = reqHeaders
  57881. googleapi.Expand(req.URL, map[string]string{
  57882. "project": c.project,
  57883. })
  57884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57885. }
  57886. // Do executes the "compute.licenses.list" call.
  57887. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  57888. // non-2xx status code is an error. Response headers are in either
  57889. // *LicensesListResponse.ServerResponse.Header or (if a response was
  57890. // returned at all) in error.(*googleapi.Error).Header. Use
  57891. // googleapi.IsNotModified to check whether the returned error was
  57892. // because http.StatusNotModified was returned.
  57893. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  57894. gensupport.SetOptions(c.urlParams_, opts...)
  57895. res, err := c.doRequest("json")
  57896. if res != nil && res.StatusCode == http.StatusNotModified {
  57897. if res.Body != nil {
  57898. res.Body.Close()
  57899. }
  57900. return nil, &googleapi.Error{
  57901. Code: res.StatusCode,
  57902. Header: res.Header,
  57903. }
  57904. }
  57905. if err != nil {
  57906. return nil, err
  57907. }
  57908. defer googleapi.CloseBody(res)
  57909. if err := googleapi.CheckResponse(res); err != nil {
  57910. return nil, err
  57911. }
  57912. ret := &LicensesListResponse{
  57913. ServerResponse: googleapi.ServerResponse{
  57914. Header: res.Header,
  57915. HTTPStatusCode: res.StatusCode,
  57916. },
  57917. }
  57918. target := &ret
  57919. if err := gensupport.DecodeResponse(target, res); err != nil {
  57920. return nil, err
  57921. }
  57922. return ret, nil
  57923. // {
  57924. // "description": "Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
  57925. // "httpMethod": "GET",
  57926. // "id": "compute.licenses.list",
  57927. // "parameterOrder": [
  57928. // "project"
  57929. // ],
  57930. // "parameters": {
  57931. // "filter": {
  57932. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57933. // "location": "query",
  57934. // "type": "string"
  57935. // },
  57936. // "maxResults": {
  57937. // "default": "500",
  57938. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57939. // "format": "uint32",
  57940. // "location": "query",
  57941. // "minimum": "0",
  57942. // "type": "integer"
  57943. // },
  57944. // "orderBy": {
  57945. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57946. // "location": "query",
  57947. // "type": "string"
  57948. // },
  57949. // "pageToken": {
  57950. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57951. // "location": "query",
  57952. // "type": "string"
  57953. // },
  57954. // "project": {
  57955. // "description": "Project ID for this request.",
  57956. // "location": "path",
  57957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57958. // "required": true,
  57959. // "type": "string"
  57960. // }
  57961. // },
  57962. // "path": "{project}/global/licenses",
  57963. // "response": {
  57964. // "$ref": "LicensesListResponse"
  57965. // },
  57966. // "scopes": [
  57967. // "https://www.googleapis.com/auth/cloud-platform",
  57968. // "https://www.googleapis.com/auth/compute",
  57969. // "https://www.googleapis.com/auth/compute.readonly"
  57970. // ]
  57971. // }
  57972. }
  57973. // Pages invokes f for each page of results.
  57974. // A non-nil error returned from f will halt the iteration.
  57975. // The provided context supersedes any context provided to the Context method.
  57976. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  57977. c.ctx_ = ctx
  57978. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57979. for {
  57980. x, err := c.Do()
  57981. if err != nil {
  57982. return err
  57983. }
  57984. if err := f(x); err != nil {
  57985. return err
  57986. }
  57987. if x.NextPageToken == "" {
  57988. return nil
  57989. }
  57990. c.PageToken(x.NextPageToken)
  57991. }
  57992. }
  57993. // method id "compute.licenses.setIamPolicy":
  57994. type LicensesSetIamPolicyCall struct {
  57995. s *Service
  57996. project string
  57997. resource string
  57998. globalsetpolicyrequest *GlobalSetPolicyRequest
  57999. urlParams_ gensupport.URLParams
  58000. ctx_ context.Context
  58001. header_ http.Header
  58002. }
  58003. // SetIamPolicy: Sets the access control policy on the specified
  58004. // resource. Replaces any existing policy.
  58005. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  58006. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58007. c.project = project
  58008. c.resource = resource
  58009. c.globalsetpolicyrequest = globalsetpolicyrequest
  58010. return c
  58011. }
  58012. // Fields allows partial responses to be retrieved. See
  58013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58014. // for more information.
  58015. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  58016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58017. return c
  58018. }
  58019. // Context sets the context to be used in this call's Do method. Any
  58020. // pending HTTP request will be aborted if the provided context is
  58021. // canceled.
  58022. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  58023. c.ctx_ = ctx
  58024. return c
  58025. }
  58026. // Header returns an http.Header that can be modified by the caller to
  58027. // add HTTP headers to the request.
  58028. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  58029. if c.header_ == nil {
  58030. c.header_ = make(http.Header)
  58031. }
  58032. return c.header_
  58033. }
  58034. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  58035. reqHeaders := make(http.Header)
  58036. for k, v := range c.header_ {
  58037. reqHeaders[k] = v
  58038. }
  58039. reqHeaders.Set("User-Agent", c.s.userAgent())
  58040. var body io.Reader = nil
  58041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  58042. if err != nil {
  58043. return nil, err
  58044. }
  58045. reqHeaders.Set("Content-Type", "application/json")
  58046. c.urlParams_.Set("alt", alt)
  58047. c.urlParams_.Set("prettyPrint", "false")
  58048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  58049. urls += "?" + c.urlParams_.Encode()
  58050. req, err := http.NewRequest("POST", urls, body)
  58051. if err != nil {
  58052. return nil, err
  58053. }
  58054. req.Header = reqHeaders
  58055. googleapi.Expand(req.URL, map[string]string{
  58056. "project": c.project,
  58057. "resource": c.resource,
  58058. })
  58059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58060. }
  58061. // Do executes the "compute.licenses.setIamPolicy" call.
  58062. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  58063. // code is an error. Response headers are in either
  58064. // *Policy.ServerResponse.Header or (if a response was returned at all)
  58065. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  58066. // check whether the returned error was because http.StatusNotModified
  58067. // was returned.
  58068. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  58069. gensupport.SetOptions(c.urlParams_, opts...)
  58070. res, err := c.doRequest("json")
  58071. if res != nil && res.StatusCode == http.StatusNotModified {
  58072. if res.Body != nil {
  58073. res.Body.Close()
  58074. }
  58075. return nil, &googleapi.Error{
  58076. Code: res.StatusCode,
  58077. Header: res.Header,
  58078. }
  58079. }
  58080. if err != nil {
  58081. return nil, err
  58082. }
  58083. defer googleapi.CloseBody(res)
  58084. if err := googleapi.CheckResponse(res); err != nil {
  58085. return nil, err
  58086. }
  58087. ret := &Policy{
  58088. ServerResponse: googleapi.ServerResponse{
  58089. Header: res.Header,
  58090. HTTPStatusCode: res.StatusCode,
  58091. },
  58092. }
  58093. target := &ret
  58094. if err := gensupport.DecodeResponse(target, res); err != nil {
  58095. return nil, err
  58096. }
  58097. return ret, nil
  58098. // {
  58099. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  58100. // "httpMethod": "POST",
  58101. // "id": "compute.licenses.setIamPolicy",
  58102. // "parameterOrder": [
  58103. // "project",
  58104. // "resource"
  58105. // ],
  58106. // "parameters": {
  58107. // "project": {
  58108. // "description": "Project ID for this request.",
  58109. // "location": "path",
  58110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58111. // "required": true,
  58112. // "type": "string"
  58113. // },
  58114. // "resource": {
  58115. // "description": "Name or id of the resource for this request.",
  58116. // "location": "path",
  58117. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58118. // "required": true,
  58119. // "type": "string"
  58120. // }
  58121. // },
  58122. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  58123. // "request": {
  58124. // "$ref": "GlobalSetPolicyRequest"
  58125. // },
  58126. // "response": {
  58127. // "$ref": "Policy"
  58128. // },
  58129. // "scopes": [
  58130. // "https://www.googleapis.com/auth/cloud-platform",
  58131. // "https://www.googleapis.com/auth/compute"
  58132. // ]
  58133. // }
  58134. }
  58135. // method id "compute.licenses.testIamPermissions":
  58136. type LicensesTestIamPermissionsCall struct {
  58137. s *Service
  58138. project string
  58139. resource string
  58140. testpermissionsrequest *TestPermissionsRequest
  58141. urlParams_ gensupport.URLParams
  58142. ctx_ context.Context
  58143. header_ http.Header
  58144. }
  58145. // TestIamPermissions: Returns permissions that a caller has on the
  58146. // specified resource.
  58147. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  58148. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58149. c.project = project
  58150. c.resource = resource
  58151. c.testpermissionsrequest = testpermissionsrequest
  58152. return c
  58153. }
  58154. // Fields allows partial responses to be retrieved. See
  58155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58156. // for more information.
  58157. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  58158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58159. return c
  58160. }
  58161. // Context sets the context to be used in this call's Do method. Any
  58162. // pending HTTP request will be aborted if the provided context is
  58163. // canceled.
  58164. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  58165. c.ctx_ = ctx
  58166. return c
  58167. }
  58168. // Header returns an http.Header that can be modified by the caller to
  58169. // add HTTP headers to the request.
  58170. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  58171. if c.header_ == nil {
  58172. c.header_ = make(http.Header)
  58173. }
  58174. return c.header_
  58175. }
  58176. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  58177. reqHeaders := make(http.Header)
  58178. for k, v := range c.header_ {
  58179. reqHeaders[k] = v
  58180. }
  58181. reqHeaders.Set("User-Agent", c.s.userAgent())
  58182. var body io.Reader = nil
  58183. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  58184. if err != nil {
  58185. return nil, err
  58186. }
  58187. reqHeaders.Set("Content-Type", "application/json")
  58188. c.urlParams_.Set("alt", alt)
  58189. c.urlParams_.Set("prettyPrint", "false")
  58190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  58191. urls += "?" + c.urlParams_.Encode()
  58192. req, err := http.NewRequest("POST", urls, body)
  58193. if err != nil {
  58194. return nil, err
  58195. }
  58196. req.Header = reqHeaders
  58197. googleapi.Expand(req.URL, map[string]string{
  58198. "project": c.project,
  58199. "resource": c.resource,
  58200. })
  58201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58202. }
  58203. // Do executes the "compute.licenses.testIamPermissions" call.
  58204. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  58205. // non-2xx status code is an error. Response headers are in either
  58206. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58207. // returned at all) in error.(*googleapi.Error).Header. Use
  58208. // googleapi.IsNotModified to check whether the returned error was
  58209. // because http.StatusNotModified was returned.
  58210. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58211. gensupport.SetOptions(c.urlParams_, opts...)
  58212. res, err := c.doRequest("json")
  58213. if res != nil && res.StatusCode == http.StatusNotModified {
  58214. if res.Body != nil {
  58215. res.Body.Close()
  58216. }
  58217. return nil, &googleapi.Error{
  58218. Code: res.StatusCode,
  58219. Header: res.Header,
  58220. }
  58221. }
  58222. if err != nil {
  58223. return nil, err
  58224. }
  58225. defer googleapi.CloseBody(res)
  58226. if err := googleapi.CheckResponse(res); err != nil {
  58227. return nil, err
  58228. }
  58229. ret := &TestPermissionsResponse{
  58230. ServerResponse: googleapi.ServerResponse{
  58231. Header: res.Header,
  58232. HTTPStatusCode: res.StatusCode,
  58233. },
  58234. }
  58235. target := &ret
  58236. if err := gensupport.DecodeResponse(target, res); err != nil {
  58237. return nil, err
  58238. }
  58239. return ret, nil
  58240. // {
  58241. // "description": "Returns permissions that a caller has on the specified resource.",
  58242. // "httpMethod": "POST",
  58243. // "id": "compute.licenses.testIamPermissions",
  58244. // "parameterOrder": [
  58245. // "project",
  58246. // "resource"
  58247. // ],
  58248. // "parameters": {
  58249. // "project": {
  58250. // "description": "Project ID for this request.",
  58251. // "location": "path",
  58252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58253. // "required": true,
  58254. // "type": "string"
  58255. // },
  58256. // "resource": {
  58257. // "description": "Name or id of the resource for this request.",
  58258. // "location": "path",
  58259. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58260. // "required": true,
  58261. // "type": "string"
  58262. // }
  58263. // },
  58264. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  58265. // "request": {
  58266. // "$ref": "TestPermissionsRequest"
  58267. // },
  58268. // "response": {
  58269. // "$ref": "TestPermissionsResponse"
  58270. // },
  58271. // "scopes": [
  58272. // "https://www.googleapis.com/auth/cloud-platform",
  58273. // "https://www.googleapis.com/auth/compute",
  58274. // "https://www.googleapis.com/auth/compute.readonly"
  58275. // ]
  58276. // }
  58277. }
  58278. // method id "compute.machineTypes.aggregatedList":
  58279. type MachineTypesAggregatedListCall struct {
  58280. s *Service
  58281. project string
  58282. urlParams_ gensupport.URLParams
  58283. ifNoneMatch_ string
  58284. ctx_ context.Context
  58285. header_ http.Header
  58286. }
  58287. // AggregatedList: Retrieves an aggregated list of machine types.
  58288. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  58289. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  58290. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58291. c.project = project
  58292. return c
  58293. }
  58294. // Filter sets the optional parameter "filter": A filter expression that
  58295. // filters resources listed in the response. The expression must specify
  58296. // the field name, a comparison operator, and the value that you want to
  58297. // use for filtering. The value must be a string, a number, or a
  58298. // boolean. The comparison operator must be either =, !=, >, or <.
  58299. //
  58300. // For example, if you are filtering Compute Engine instances, you can
  58301. // exclude instances named example-instance by specifying name !=
  58302. // example-instance.
  58303. //
  58304. // You can also filter nested fields. For example, you could specify
  58305. // scheduling.automaticRestart = false to include instances only if they
  58306. // are not scheduled for automatic restarts. You can use filtering on
  58307. // nested fields to filter based on resource labels.
  58308. //
  58309. // To filter on multiple expressions, provide each separate expression
  58310. // within parentheses. For example, (scheduling.automaticRestart = true)
  58311. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58312. // AND expression. However, you can include AND and OR expressions
  58313. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58314. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58315. // true).
  58316. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  58317. c.urlParams_.Set("filter", filter)
  58318. return c
  58319. }
  58320. // MaxResults sets the optional parameter "maxResults": The maximum
  58321. // number of results per page that should be returned. If the number of
  58322. // available results is larger than maxResults, Compute Engine returns a
  58323. // nextPageToken that can be used to get the next page of results in
  58324. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58325. // (Default: 500)
  58326. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  58327. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58328. return c
  58329. }
  58330. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58331. // a certain order. By default, results are returned in alphanumerical
  58332. // order based on the resource name.
  58333. //
  58334. // You can also sort results in descending order based on the creation
  58335. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58336. // based on the creationTimestamp field in reverse chronological order
  58337. // (newest result first). Use this to sort resources like operations so
  58338. // that the newest operation is returned first.
  58339. //
  58340. // Currently, only sorting by name or creationTimestamp desc is
  58341. // supported.
  58342. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  58343. c.urlParams_.Set("orderBy", orderBy)
  58344. return c
  58345. }
  58346. // PageToken sets the optional parameter "pageToken": Specifies a page
  58347. // token to use. Set pageToken to the nextPageToken returned by a
  58348. // previous list request to get the next page of results.
  58349. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  58350. c.urlParams_.Set("pageToken", pageToken)
  58351. return c
  58352. }
  58353. // Fields allows partial responses to be retrieved. See
  58354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58355. // for more information.
  58356. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  58357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58358. return c
  58359. }
  58360. // IfNoneMatch sets the optional parameter which makes the operation
  58361. // fail if the object's ETag matches the given value. This is useful for
  58362. // getting updates only after the object has changed since the last
  58363. // request. Use googleapi.IsNotModified to check whether the response
  58364. // error from Do is the result of In-None-Match.
  58365. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  58366. c.ifNoneMatch_ = entityTag
  58367. return c
  58368. }
  58369. // Context sets the context to be used in this call's Do method. Any
  58370. // pending HTTP request will be aborted if the provided context is
  58371. // canceled.
  58372. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  58373. c.ctx_ = ctx
  58374. return c
  58375. }
  58376. // Header returns an http.Header that can be modified by the caller to
  58377. // add HTTP headers to the request.
  58378. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  58379. if c.header_ == nil {
  58380. c.header_ = make(http.Header)
  58381. }
  58382. return c.header_
  58383. }
  58384. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  58385. reqHeaders := make(http.Header)
  58386. for k, v := range c.header_ {
  58387. reqHeaders[k] = v
  58388. }
  58389. reqHeaders.Set("User-Agent", c.s.userAgent())
  58390. if c.ifNoneMatch_ != "" {
  58391. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58392. }
  58393. var body io.Reader = nil
  58394. c.urlParams_.Set("alt", alt)
  58395. c.urlParams_.Set("prettyPrint", "false")
  58396. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  58397. urls += "?" + c.urlParams_.Encode()
  58398. req, err := http.NewRequest("GET", urls, body)
  58399. if err != nil {
  58400. return nil, err
  58401. }
  58402. req.Header = reqHeaders
  58403. googleapi.Expand(req.URL, map[string]string{
  58404. "project": c.project,
  58405. })
  58406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58407. }
  58408. // Do executes the "compute.machineTypes.aggregatedList" call.
  58409. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  58410. // Any non-2xx status code is an error. Response headers are in either
  58411. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  58412. // was returned at all) in error.(*googleapi.Error).Header. Use
  58413. // googleapi.IsNotModified to check whether the returned error was
  58414. // because http.StatusNotModified was returned.
  58415. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  58416. gensupport.SetOptions(c.urlParams_, opts...)
  58417. res, err := c.doRequest("json")
  58418. if res != nil && res.StatusCode == http.StatusNotModified {
  58419. if res.Body != nil {
  58420. res.Body.Close()
  58421. }
  58422. return nil, &googleapi.Error{
  58423. Code: res.StatusCode,
  58424. Header: res.Header,
  58425. }
  58426. }
  58427. if err != nil {
  58428. return nil, err
  58429. }
  58430. defer googleapi.CloseBody(res)
  58431. if err := googleapi.CheckResponse(res); err != nil {
  58432. return nil, err
  58433. }
  58434. ret := &MachineTypeAggregatedList{
  58435. ServerResponse: googleapi.ServerResponse{
  58436. Header: res.Header,
  58437. HTTPStatusCode: res.StatusCode,
  58438. },
  58439. }
  58440. target := &ret
  58441. if err := gensupport.DecodeResponse(target, res); err != nil {
  58442. return nil, err
  58443. }
  58444. return ret, nil
  58445. // {
  58446. // "description": "Retrieves an aggregated list of machine types.",
  58447. // "httpMethod": "GET",
  58448. // "id": "compute.machineTypes.aggregatedList",
  58449. // "parameterOrder": [
  58450. // "project"
  58451. // ],
  58452. // "parameters": {
  58453. // "filter": {
  58454. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58455. // "location": "query",
  58456. // "type": "string"
  58457. // },
  58458. // "maxResults": {
  58459. // "default": "500",
  58460. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58461. // "format": "uint32",
  58462. // "location": "query",
  58463. // "minimum": "0",
  58464. // "type": "integer"
  58465. // },
  58466. // "orderBy": {
  58467. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58468. // "location": "query",
  58469. // "type": "string"
  58470. // },
  58471. // "pageToken": {
  58472. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58473. // "location": "query",
  58474. // "type": "string"
  58475. // },
  58476. // "project": {
  58477. // "description": "Project ID for this request.",
  58478. // "location": "path",
  58479. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58480. // "required": true,
  58481. // "type": "string"
  58482. // }
  58483. // },
  58484. // "path": "{project}/aggregated/machineTypes",
  58485. // "response": {
  58486. // "$ref": "MachineTypeAggregatedList"
  58487. // },
  58488. // "scopes": [
  58489. // "https://www.googleapis.com/auth/cloud-platform",
  58490. // "https://www.googleapis.com/auth/compute",
  58491. // "https://www.googleapis.com/auth/compute.readonly"
  58492. // ]
  58493. // }
  58494. }
  58495. // Pages invokes f for each page of results.
  58496. // A non-nil error returned from f will halt the iteration.
  58497. // The provided context supersedes any context provided to the Context method.
  58498. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  58499. c.ctx_ = ctx
  58500. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58501. for {
  58502. x, err := c.Do()
  58503. if err != nil {
  58504. return err
  58505. }
  58506. if err := f(x); err != nil {
  58507. return err
  58508. }
  58509. if x.NextPageToken == "" {
  58510. return nil
  58511. }
  58512. c.PageToken(x.NextPageToken)
  58513. }
  58514. }
  58515. // method id "compute.machineTypes.get":
  58516. type MachineTypesGetCall struct {
  58517. s *Service
  58518. project string
  58519. zone string
  58520. machineType string
  58521. urlParams_ gensupport.URLParams
  58522. ifNoneMatch_ string
  58523. ctx_ context.Context
  58524. header_ http.Header
  58525. }
  58526. // Get: Returns the specified machine type. Gets a list of available
  58527. // machine types by making a list() request.
  58528. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  58529. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  58530. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58531. c.project = project
  58532. c.zone = zone
  58533. c.machineType = machineType
  58534. return c
  58535. }
  58536. // Fields allows partial responses to be retrieved. See
  58537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58538. // for more information.
  58539. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  58540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58541. return c
  58542. }
  58543. // IfNoneMatch sets the optional parameter which makes the operation
  58544. // fail if the object's ETag matches the given value. This is useful for
  58545. // getting updates only after the object has changed since the last
  58546. // request. Use googleapi.IsNotModified to check whether the response
  58547. // error from Do is the result of In-None-Match.
  58548. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  58549. c.ifNoneMatch_ = entityTag
  58550. return c
  58551. }
  58552. // Context sets the context to be used in this call's Do method. Any
  58553. // pending HTTP request will be aborted if the provided context is
  58554. // canceled.
  58555. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  58556. c.ctx_ = ctx
  58557. return c
  58558. }
  58559. // Header returns an http.Header that can be modified by the caller to
  58560. // add HTTP headers to the request.
  58561. func (c *MachineTypesGetCall) Header() http.Header {
  58562. if c.header_ == nil {
  58563. c.header_ = make(http.Header)
  58564. }
  58565. return c.header_
  58566. }
  58567. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  58568. reqHeaders := make(http.Header)
  58569. for k, v := range c.header_ {
  58570. reqHeaders[k] = v
  58571. }
  58572. reqHeaders.Set("User-Agent", c.s.userAgent())
  58573. if c.ifNoneMatch_ != "" {
  58574. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58575. }
  58576. var body io.Reader = nil
  58577. c.urlParams_.Set("alt", alt)
  58578. c.urlParams_.Set("prettyPrint", "false")
  58579. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  58580. urls += "?" + c.urlParams_.Encode()
  58581. req, err := http.NewRequest("GET", urls, body)
  58582. if err != nil {
  58583. return nil, err
  58584. }
  58585. req.Header = reqHeaders
  58586. googleapi.Expand(req.URL, map[string]string{
  58587. "project": c.project,
  58588. "zone": c.zone,
  58589. "machineType": c.machineType,
  58590. })
  58591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58592. }
  58593. // Do executes the "compute.machineTypes.get" call.
  58594. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  58595. // status code is an error. Response headers are in either
  58596. // *MachineType.ServerResponse.Header or (if a response was returned at
  58597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58598. // to check whether the returned error was because
  58599. // http.StatusNotModified was returned.
  58600. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  58601. gensupport.SetOptions(c.urlParams_, opts...)
  58602. res, err := c.doRequest("json")
  58603. if res != nil && res.StatusCode == http.StatusNotModified {
  58604. if res.Body != nil {
  58605. res.Body.Close()
  58606. }
  58607. return nil, &googleapi.Error{
  58608. Code: res.StatusCode,
  58609. Header: res.Header,
  58610. }
  58611. }
  58612. if err != nil {
  58613. return nil, err
  58614. }
  58615. defer googleapi.CloseBody(res)
  58616. if err := googleapi.CheckResponse(res); err != nil {
  58617. return nil, err
  58618. }
  58619. ret := &MachineType{
  58620. ServerResponse: googleapi.ServerResponse{
  58621. Header: res.Header,
  58622. HTTPStatusCode: res.StatusCode,
  58623. },
  58624. }
  58625. target := &ret
  58626. if err := gensupport.DecodeResponse(target, res); err != nil {
  58627. return nil, err
  58628. }
  58629. return ret, nil
  58630. // {
  58631. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  58632. // "httpMethod": "GET",
  58633. // "id": "compute.machineTypes.get",
  58634. // "parameterOrder": [
  58635. // "project",
  58636. // "zone",
  58637. // "machineType"
  58638. // ],
  58639. // "parameters": {
  58640. // "machineType": {
  58641. // "description": "Name of the machine type to return.",
  58642. // "location": "path",
  58643. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58644. // "required": true,
  58645. // "type": "string"
  58646. // },
  58647. // "project": {
  58648. // "description": "Project ID for this request.",
  58649. // "location": "path",
  58650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58651. // "required": true,
  58652. // "type": "string"
  58653. // },
  58654. // "zone": {
  58655. // "description": "The name of the zone for this request.",
  58656. // "location": "path",
  58657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58658. // "required": true,
  58659. // "type": "string"
  58660. // }
  58661. // },
  58662. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  58663. // "response": {
  58664. // "$ref": "MachineType"
  58665. // },
  58666. // "scopes": [
  58667. // "https://www.googleapis.com/auth/cloud-platform",
  58668. // "https://www.googleapis.com/auth/compute",
  58669. // "https://www.googleapis.com/auth/compute.readonly"
  58670. // ]
  58671. // }
  58672. }
  58673. // method id "compute.machineTypes.list":
  58674. type MachineTypesListCall struct {
  58675. s *Service
  58676. project string
  58677. zone string
  58678. urlParams_ gensupport.URLParams
  58679. ifNoneMatch_ string
  58680. ctx_ context.Context
  58681. header_ http.Header
  58682. }
  58683. // List: Retrieves a list of machine types available to the specified
  58684. // project.
  58685. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  58686. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  58687. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58688. c.project = project
  58689. c.zone = zone
  58690. return c
  58691. }
  58692. // Filter sets the optional parameter "filter": A filter expression that
  58693. // filters resources listed in the response. The expression must specify
  58694. // the field name, a comparison operator, and the value that you want to
  58695. // use for filtering. The value must be a string, a number, or a
  58696. // boolean. The comparison operator must be either =, !=, >, or <.
  58697. //
  58698. // For example, if you are filtering Compute Engine instances, you can
  58699. // exclude instances named example-instance by specifying name !=
  58700. // example-instance.
  58701. //
  58702. // You can also filter nested fields. For example, you could specify
  58703. // scheduling.automaticRestart = false to include instances only if they
  58704. // are not scheduled for automatic restarts. You can use filtering on
  58705. // nested fields to filter based on resource labels.
  58706. //
  58707. // To filter on multiple expressions, provide each separate expression
  58708. // within parentheses. For example, (scheduling.automaticRestart = true)
  58709. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58710. // AND expression. However, you can include AND and OR expressions
  58711. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58712. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58713. // true).
  58714. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  58715. c.urlParams_.Set("filter", filter)
  58716. return c
  58717. }
  58718. // MaxResults sets the optional parameter "maxResults": The maximum
  58719. // number of results per page that should be returned. If the number of
  58720. // available results is larger than maxResults, Compute Engine returns a
  58721. // nextPageToken that can be used to get the next page of results in
  58722. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58723. // (Default: 500)
  58724. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  58725. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58726. return c
  58727. }
  58728. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58729. // a certain order. By default, results are returned in alphanumerical
  58730. // order based on the resource name.
  58731. //
  58732. // You can also sort results in descending order based on the creation
  58733. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58734. // based on the creationTimestamp field in reverse chronological order
  58735. // (newest result first). Use this to sort resources like operations so
  58736. // that the newest operation is returned first.
  58737. //
  58738. // Currently, only sorting by name or creationTimestamp desc is
  58739. // supported.
  58740. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  58741. c.urlParams_.Set("orderBy", orderBy)
  58742. return c
  58743. }
  58744. // PageToken sets the optional parameter "pageToken": Specifies a page
  58745. // token to use. Set pageToken to the nextPageToken returned by a
  58746. // previous list request to get the next page of results.
  58747. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  58748. c.urlParams_.Set("pageToken", pageToken)
  58749. return c
  58750. }
  58751. // Fields allows partial responses to be retrieved. See
  58752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58753. // for more information.
  58754. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  58755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58756. return c
  58757. }
  58758. // IfNoneMatch sets the optional parameter which makes the operation
  58759. // fail if the object's ETag matches the given value. This is useful for
  58760. // getting updates only after the object has changed since the last
  58761. // request. Use googleapi.IsNotModified to check whether the response
  58762. // error from Do is the result of In-None-Match.
  58763. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  58764. c.ifNoneMatch_ = entityTag
  58765. return c
  58766. }
  58767. // Context sets the context to be used in this call's Do method. Any
  58768. // pending HTTP request will be aborted if the provided context is
  58769. // canceled.
  58770. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  58771. c.ctx_ = ctx
  58772. return c
  58773. }
  58774. // Header returns an http.Header that can be modified by the caller to
  58775. // add HTTP headers to the request.
  58776. func (c *MachineTypesListCall) Header() http.Header {
  58777. if c.header_ == nil {
  58778. c.header_ = make(http.Header)
  58779. }
  58780. return c.header_
  58781. }
  58782. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  58783. reqHeaders := make(http.Header)
  58784. for k, v := range c.header_ {
  58785. reqHeaders[k] = v
  58786. }
  58787. reqHeaders.Set("User-Agent", c.s.userAgent())
  58788. if c.ifNoneMatch_ != "" {
  58789. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58790. }
  58791. var body io.Reader = nil
  58792. c.urlParams_.Set("alt", alt)
  58793. c.urlParams_.Set("prettyPrint", "false")
  58794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  58795. urls += "?" + c.urlParams_.Encode()
  58796. req, err := http.NewRequest("GET", urls, body)
  58797. if err != nil {
  58798. return nil, err
  58799. }
  58800. req.Header = reqHeaders
  58801. googleapi.Expand(req.URL, map[string]string{
  58802. "project": c.project,
  58803. "zone": c.zone,
  58804. })
  58805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58806. }
  58807. // Do executes the "compute.machineTypes.list" call.
  58808. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  58809. // status code is an error. Response headers are in either
  58810. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  58811. // at all) in error.(*googleapi.Error).Header. Use
  58812. // googleapi.IsNotModified to check whether the returned error was
  58813. // because http.StatusNotModified was returned.
  58814. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  58815. gensupport.SetOptions(c.urlParams_, opts...)
  58816. res, err := c.doRequest("json")
  58817. if res != nil && res.StatusCode == http.StatusNotModified {
  58818. if res.Body != nil {
  58819. res.Body.Close()
  58820. }
  58821. return nil, &googleapi.Error{
  58822. Code: res.StatusCode,
  58823. Header: res.Header,
  58824. }
  58825. }
  58826. if err != nil {
  58827. return nil, err
  58828. }
  58829. defer googleapi.CloseBody(res)
  58830. if err := googleapi.CheckResponse(res); err != nil {
  58831. return nil, err
  58832. }
  58833. ret := &MachineTypeList{
  58834. ServerResponse: googleapi.ServerResponse{
  58835. Header: res.Header,
  58836. HTTPStatusCode: res.StatusCode,
  58837. },
  58838. }
  58839. target := &ret
  58840. if err := gensupport.DecodeResponse(target, res); err != nil {
  58841. return nil, err
  58842. }
  58843. return ret, nil
  58844. // {
  58845. // "description": "Retrieves a list of machine types available to the specified project.",
  58846. // "httpMethod": "GET",
  58847. // "id": "compute.machineTypes.list",
  58848. // "parameterOrder": [
  58849. // "project",
  58850. // "zone"
  58851. // ],
  58852. // "parameters": {
  58853. // "filter": {
  58854. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58855. // "location": "query",
  58856. // "type": "string"
  58857. // },
  58858. // "maxResults": {
  58859. // "default": "500",
  58860. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58861. // "format": "uint32",
  58862. // "location": "query",
  58863. // "minimum": "0",
  58864. // "type": "integer"
  58865. // },
  58866. // "orderBy": {
  58867. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58868. // "location": "query",
  58869. // "type": "string"
  58870. // },
  58871. // "pageToken": {
  58872. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58873. // "location": "query",
  58874. // "type": "string"
  58875. // },
  58876. // "project": {
  58877. // "description": "Project ID for this request.",
  58878. // "location": "path",
  58879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58880. // "required": true,
  58881. // "type": "string"
  58882. // },
  58883. // "zone": {
  58884. // "description": "The name of the zone for this request.",
  58885. // "location": "path",
  58886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58887. // "required": true,
  58888. // "type": "string"
  58889. // }
  58890. // },
  58891. // "path": "{project}/zones/{zone}/machineTypes",
  58892. // "response": {
  58893. // "$ref": "MachineTypeList"
  58894. // },
  58895. // "scopes": [
  58896. // "https://www.googleapis.com/auth/cloud-platform",
  58897. // "https://www.googleapis.com/auth/compute",
  58898. // "https://www.googleapis.com/auth/compute.readonly"
  58899. // ]
  58900. // }
  58901. }
  58902. // Pages invokes f for each page of results.
  58903. // A non-nil error returned from f will halt the iteration.
  58904. // The provided context supersedes any context provided to the Context method.
  58905. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  58906. c.ctx_ = ctx
  58907. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58908. for {
  58909. x, err := c.Do()
  58910. if err != nil {
  58911. return err
  58912. }
  58913. if err := f(x); err != nil {
  58914. return err
  58915. }
  58916. if x.NextPageToken == "" {
  58917. return nil
  58918. }
  58919. c.PageToken(x.NextPageToken)
  58920. }
  58921. }
  58922. // method id "compute.networks.addPeering":
  58923. type NetworksAddPeeringCall struct {
  58924. s *Service
  58925. project string
  58926. network string
  58927. networksaddpeeringrequest *NetworksAddPeeringRequest
  58928. urlParams_ gensupport.URLParams
  58929. ctx_ context.Context
  58930. header_ http.Header
  58931. }
  58932. // AddPeering: Adds a peering to the specified network.
  58933. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  58934. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58935. c.project = project
  58936. c.network = network
  58937. c.networksaddpeeringrequest = networksaddpeeringrequest
  58938. return c
  58939. }
  58940. // RequestId sets the optional parameter "requestId": An optional
  58941. // request ID to identify requests. Specify a unique request ID so that
  58942. // if you must retry your request, the server will know to ignore the
  58943. // request if it has already been completed.
  58944. //
  58945. // For example, consider a situation where you make an initial request
  58946. // and the request times out. If you make the request again with the
  58947. // same request ID, the server can check if original operation with the
  58948. // same request ID was received, and if so, will ignore the second
  58949. // request. This prevents clients from accidentally creating duplicate
  58950. // commitments.
  58951. //
  58952. // The request ID must be a valid UUID with the exception that zero UUID
  58953. // is not supported (00000000-0000-0000-0000-000000000000).
  58954. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  58955. c.urlParams_.Set("requestId", requestId)
  58956. return c
  58957. }
  58958. // Fields allows partial responses to be retrieved. See
  58959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58960. // for more information.
  58961. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  58962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58963. return c
  58964. }
  58965. // Context sets the context to be used in this call's Do method. Any
  58966. // pending HTTP request will be aborted if the provided context is
  58967. // canceled.
  58968. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  58969. c.ctx_ = ctx
  58970. return c
  58971. }
  58972. // Header returns an http.Header that can be modified by the caller to
  58973. // add HTTP headers to the request.
  58974. func (c *NetworksAddPeeringCall) Header() http.Header {
  58975. if c.header_ == nil {
  58976. c.header_ = make(http.Header)
  58977. }
  58978. return c.header_
  58979. }
  58980. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  58981. reqHeaders := make(http.Header)
  58982. for k, v := range c.header_ {
  58983. reqHeaders[k] = v
  58984. }
  58985. reqHeaders.Set("User-Agent", c.s.userAgent())
  58986. var body io.Reader = nil
  58987. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  58988. if err != nil {
  58989. return nil, err
  58990. }
  58991. reqHeaders.Set("Content-Type", "application/json")
  58992. c.urlParams_.Set("alt", alt)
  58993. c.urlParams_.Set("prettyPrint", "false")
  58994. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  58995. urls += "?" + c.urlParams_.Encode()
  58996. req, err := http.NewRequest("POST", urls, body)
  58997. if err != nil {
  58998. return nil, err
  58999. }
  59000. req.Header = reqHeaders
  59001. googleapi.Expand(req.URL, map[string]string{
  59002. "project": c.project,
  59003. "network": c.network,
  59004. })
  59005. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59006. }
  59007. // Do executes the "compute.networks.addPeering" call.
  59008. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59009. // status code is an error. Response headers are in either
  59010. // *Operation.ServerResponse.Header or (if a response was returned at
  59011. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59012. // to check whether the returned error was because
  59013. // http.StatusNotModified was returned.
  59014. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59015. gensupport.SetOptions(c.urlParams_, opts...)
  59016. res, err := c.doRequest("json")
  59017. if res != nil && res.StatusCode == http.StatusNotModified {
  59018. if res.Body != nil {
  59019. res.Body.Close()
  59020. }
  59021. return nil, &googleapi.Error{
  59022. Code: res.StatusCode,
  59023. Header: res.Header,
  59024. }
  59025. }
  59026. if err != nil {
  59027. return nil, err
  59028. }
  59029. defer googleapi.CloseBody(res)
  59030. if err := googleapi.CheckResponse(res); err != nil {
  59031. return nil, err
  59032. }
  59033. ret := &Operation{
  59034. ServerResponse: googleapi.ServerResponse{
  59035. Header: res.Header,
  59036. HTTPStatusCode: res.StatusCode,
  59037. },
  59038. }
  59039. target := &ret
  59040. if err := gensupport.DecodeResponse(target, res); err != nil {
  59041. return nil, err
  59042. }
  59043. return ret, nil
  59044. // {
  59045. // "description": "Adds a peering to the specified network.",
  59046. // "httpMethod": "POST",
  59047. // "id": "compute.networks.addPeering",
  59048. // "parameterOrder": [
  59049. // "project",
  59050. // "network"
  59051. // ],
  59052. // "parameters": {
  59053. // "network": {
  59054. // "description": "Name of the network resource to add peering to.",
  59055. // "location": "path",
  59056. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59057. // "required": true,
  59058. // "type": "string"
  59059. // },
  59060. // "project": {
  59061. // "description": "Project ID for this request.",
  59062. // "location": "path",
  59063. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59064. // "required": true,
  59065. // "type": "string"
  59066. // },
  59067. // "requestId": {
  59068. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59069. // "location": "query",
  59070. // "type": "string"
  59071. // }
  59072. // },
  59073. // "path": "{project}/global/networks/{network}/addPeering",
  59074. // "request": {
  59075. // "$ref": "NetworksAddPeeringRequest"
  59076. // },
  59077. // "response": {
  59078. // "$ref": "Operation"
  59079. // },
  59080. // "scopes": [
  59081. // "https://www.googleapis.com/auth/cloud-platform",
  59082. // "https://www.googleapis.com/auth/compute"
  59083. // ]
  59084. // }
  59085. }
  59086. // method id "compute.networks.delete":
  59087. type NetworksDeleteCall struct {
  59088. s *Service
  59089. project string
  59090. network string
  59091. urlParams_ gensupport.URLParams
  59092. ctx_ context.Context
  59093. header_ http.Header
  59094. }
  59095. // Delete: Deletes the specified network.
  59096. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  59097. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  59098. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59099. c.project = project
  59100. c.network = network
  59101. return c
  59102. }
  59103. // RequestId sets the optional parameter "requestId": An optional
  59104. // request ID to identify requests. Specify a unique request ID so that
  59105. // if you must retry your request, the server will know to ignore the
  59106. // request if it has already been completed.
  59107. //
  59108. // For example, consider a situation where you make an initial request
  59109. // and the request times out. If you make the request again with the
  59110. // same request ID, the server can check if original operation with the
  59111. // same request ID was received, and if so, will ignore the second
  59112. // request. This prevents clients from accidentally creating duplicate
  59113. // commitments.
  59114. //
  59115. // The request ID must be a valid UUID with the exception that zero UUID
  59116. // is not supported (00000000-0000-0000-0000-000000000000).
  59117. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  59118. c.urlParams_.Set("requestId", requestId)
  59119. return c
  59120. }
  59121. // Fields allows partial responses to be retrieved. See
  59122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59123. // for more information.
  59124. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  59125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59126. return c
  59127. }
  59128. // Context sets the context to be used in this call's Do method. Any
  59129. // pending HTTP request will be aborted if the provided context is
  59130. // canceled.
  59131. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  59132. c.ctx_ = ctx
  59133. return c
  59134. }
  59135. // Header returns an http.Header that can be modified by the caller to
  59136. // add HTTP headers to the request.
  59137. func (c *NetworksDeleteCall) Header() http.Header {
  59138. if c.header_ == nil {
  59139. c.header_ = make(http.Header)
  59140. }
  59141. return c.header_
  59142. }
  59143. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  59144. reqHeaders := make(http.Header)
  59145. for k, v := range c.header_ {
  59146. reqHeaders[k] = v
  59147. }
  59148. reqHeaders.Set("User-Agent", c.s.userAgent())
  59149. var body io.Reader = nil
  59150. c.urlParams_.Set("alt", alt)
  59151. c.urlParams_.Set("prettyPrint", "false")
  59152. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  59153. urls += "?" + c.urlParams_.Encode()
  59154. req, err := http.NewRequest("DELETE", urls, body)
  59155. if err != nil {
  59156. return nil, err
  59157. }
  59158. req.Header = reqHeaders
  59159. googleapi.Expand(req.URL, map[string]string{
  59160. "project": c.project,
  59161. "network": c.network,
  59162. })
  59163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59164. }
  59165. // Do executes the "compute.networks.delete" call.
  59166. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59167. // status code is an error. Response headers are in either
  59168. // *Operation.ServerResponse.Header or (if a response was returned at
  59169. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59170. // to check whether the returned error was because
  59171. // http.StatusNotModified was returned.
  59172. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59173. gensupport.SetOptions(c.urlParams_, opts...)
  59174. res, err := c.doRequest("json")
  59175. if res != nil && res.StatusCode == http.StatusNotModified {
  59176. if res.Body != nil {
  59177. res.Body.Close()
  59178. }
  59179. return nil, &googleapi.Error{
  59180. Code: res.StatusCode,
  59181. Header: res.Header,
  59182. }
  59183. }
  59184. if err != nil {
  59185. return nil, err
  59186. }
  59187. defer googleapi.CloseBody(res)
  59188. if err := googleapi.CheckResponse(res); err != nil {
  59189. return nil, err
  59190. }
  59191. ret := &Operation{
  59192. ServerResponse: googleapi.ServerResponse{
  59193. Header: res.Header,
  59194. HTTPStatusCode: res.StatusCode,
  59195. },
  59196. }
  59197. target := &ret
  59198. if err := gensupport.DecodeResponse(target, res); err != nil {
  59199. return nil, err
  59200. }
  59201. return ret, nil
  59202. // {
  59203. // "description": "Deletes the specified network.",
  59204. // "httpMethod": "DELETE",
  59205. // "id": "compute.networks.delete",
  59206. // "parameterOrder": [
  59207. // "project",
  59208. // "network"
  59209. // ],
  59210. // "parameters": {
  59211. // "network": {
  59212. // "description": "Name of the network to delete.",
  59213. // "location": "path",
  59214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59215. // "required": true,
  59216. // "type": "string"
  59217. // },
  59218. // "project": {
  59219. // "description": "Project ID for this request.",
  59220. // "location": "path",
  59221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59222. // "required": true,
  59223. // "type": "string"
  59224. // },
  59225. // "requestId": {
  59226. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59227. // "location": "query",
  59228. // "type": "string"
  59229. // }
  59230. // },
  59231. // "path": "{project}/global/networks/{network}",
  59232. // "response": {
  59233. // "$ref": "Operation"
  59234. // },
  59235. // "scopes": [
  59236. // "https://www.googleapis.com/auth/cloud-platform",
  59237. // "https://www.googleapis.com/auth/compute"
  59238. // ]
  59239. // }
  59240. }
  59241. // method id "compute.networks.get":
  59242. type NetworksGetCall struct {
  59243. s *Service
  59244. project string
  59245. network string
  59246. urlParams_ gensupport.URLParams
  59247. ifNoneMatch_ string
  59248. ctx_ context.Context
  59249. header_ http.Header
  59250. }
  59251. // Get: Returns the specified network. Gets a list of available networks
  59252. // by making a list() request.
  59253. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  59254. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  59255. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59256. c.project = project
  59257. c.network = network
  59258. return c
  59259. }
  59260. // Fields allows partial responses to be retrieved. See
  59261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59262. // for more information.
  59263. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  59264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59265. return c
  59266. }
  59267. // IfNoneMatch sets the optional parameter which makes the operation
  59268. // fail if the object's ETag matches the given value. This is useful for
  59269. // getting updates only after the object has changed since the last
  59270. // request. Use googleapi.IsNotModified to check whether the response
  59271. // error from Do is the result of In-None-Match.
  59272. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  59273. c.ifNoneMatch_ = entityTag
  59274. return c
  59275. }
  59276. // Context sets the context to be used in this call's Do method. Any
  59277. // pending HTTP request will be aborted if the provided context is
  59278. // canceled.
  59279. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  59280. c.ctx_ = ctx
  59281. return c
  59282. }
  59283. // Header returns an http.Header that can be modified by the caller to
  59284. // add HTTP headers to the request.
  59285. func (c *NetworksGetCall) Header() http.Header {
  59286. if c.header_ == nil {
  59287. c.header_ = make(http.Header)
  59288. }
  59289. return c.header_
  59290. }
  59291. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  59292. reqHeaders := make(http.Header)
  59293. for k, v := range c.header_ {
  59294. reqHeaders[k] = v
  59295. }
  59296. reqHeaders.Set("User-Agent", c.s.userAgent())
  59297. if c.ifNoneMatch_ != "" {
  59298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59299. }
  59300. var body io.Reader = nil
  59301. c.urlParams_.Set("alt", alt)
  59302. c.urlParams_.Set("prettyPrint", "false")
  59303. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  59304. urls += "?" + c.urlParams_.Encode()
  59305. req, err := http.NewRequest("GET", urls, body)
  59306. if err != nil {
  59307. return nil, err
  59308. }
  59309. req.Header = reqHeaders
  59310. googleapi.Expand(req.URL, map[string]string{
  59311. "project": c.project,
  59312. "network": c.network,
  59313. })
  59314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59315. }
  59316. // Do executes the "compute.networks.get" call.
  59317. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  59318. // code is an error. Response headers are in either
  59319. // *Network.ServerResponse.Header or (if a response was returned at all)
  59320. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59321. // check whether the returned error was because http.StatusNotModified
  59322. // was returned.
  59323. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  59324. gensupport.SetOptions(c.urlParams_, opts...)
  59325. res, err := c.doRequest("json")
  59326. if res != nil && res.StatusCode == http.StatusNotModified {
  59327. if res.Body != nil {
  59328. res.Body.Close()
  59329. }
  59330. return nil, &googleapi.Error{
  59331. Code: res.StatusCode,
  59332. Header: res.Header,
  59333. }
  59334. }
  59335. if err != nil {
  59336. return nil, err
  59337. }
  59338. defer googleapi.CloseBody(res)
  59339. if err := googleapi.CheckResponse(res); err != nil {
  59340. return nil, err
  59341. }
  59342. ret := &Network{
  59343. ServerResponse: googleapi.ServerResponse{
  59344. Header: res.Header,
  59345. HTTPStatusCode: res.StatusCode,
  59346. },
  59347. }
  59348. target := &ret
  59349. if err := gensupport.DecodeResponse(target, res); err != nil {
  59350. return nil, err
  59351. }
  59352. return ret, nil
  59353. // {
  59354. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  59355. // "httpMethod": "GET",
  59356. // "id": "compute.networks.get",
  59357. // "parameterOrder": [
  59358. // "project",
  59359. // "network"
  59360. // ],
  59361. // "parameters": {
  59362. // "network": {
  59363. // "description": "Name of the network to return.",
  59364. // "location": "path",
  59365. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59366. // "required": true,
  59367. // "type": "string"
  59368. // },
  59369. // "project": {
  59370. // "description": "Project ID for this request.",
  59371. // "location": "path",
  59372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59373. // "required": true,
  59374. // "type": "string"
  59375. // }
  59376. // },
  59377. // "path": "{project}/global/networks/{network}",
  59378. // "response": {
  59379. // "$ref": "Network"
  59380. // },
  59381. // "scopes": [
  59382. // "https://www.googleapis.com/auth/cloud-platform",
  59383. // "https://www.googleapis.com/auth/compute",
  59384. // "https://www.googleapis.com/auth/compute.readonly"
  59385. // ]
  59386. // }
  59387. }
  59388. // method id "compute.networks.insert":
  59389. type NetworksInsertCall struct {
  59390. s *Service
  59391. project string
  59392. network *Network
  59393. urlParams_ gensupport.URLParams
  59394. ctx_ context.Context
  59395. header_ http.Header
  59396. }
  59397. // Insert: Creates a network in the specified project using the data
  59398. // included in the request.
  59399. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  59400. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  59401. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59402. c.project = project
  59403. c.network = network
  59404. return c
  59405. }
  59406. // RequestId sets the optional parameter "requestId": An optional
  59407. // request ID to identify requests. Specify a unique request ID so that
  59408. // if you must retry your request, the server will know to ignore the
  59409. // request if it has already been completed.
  59410. //
  59411. // For example, consider a situation where you make an initial request
  59412. // and the request times out. If you make the request again with the
  59413. // same request ID, the server can check if original operation with the
  59414. // same request ID was received, and if so, will ignore the second
  59415. // request. This prevents clients from accidentally creating duplicate
  59416. // commitments.
  59417. //
  59418. // The request ID must be a valid UUID with the exception that zero UUID
  59419. // is not supported (00000000-0000-0000-0000-000000000000).
  59420. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  59421. c.urlParams_.Set("requestId", requestId)
  59422. return c
  59423. }
  59424. // Fields allows partial responses to be retrieved. See
  59425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59426. // for more information.
  59427. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  59428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59429. return c
  59430. }
  59431. // Context sets the context to be used in this call's Do method. Any
  59432. // pending HTTP request will be aborted if the provided context is
  59433. // canceled.
  59434. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  59435. c.ctx_ = ctx
  59436. return c
  59437. }
  59438. // Header returns an http.Header that can be modified by the caller to
  59439. // add HTTP headers to the request.
  59440. func (c *NetworksInsertCall) Header() http.Header {
  59441. if c.header_ == nil {
  59442. c.header_ = make(http.Header)
  59443. }
  59444. return c.header_
  59445. }
  59446. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  59447. reqHeaders := make(http.Header)
  59448. for k, v := range c.header_ {
  59449. reqHeaders[k] = v
  59450. }
  59451. reqHeaders.Set("User-Agent", c.s.userAgent())
  59452. var body io.Reader = nil
  59453. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  59454. if err != nil {
  59455. return nil, err
  59456. }
  59457. reqHeaders.Set("Content-Type", "application/json")
  59458. c.urlParams_.Set("alt", alt)
  59459. c.urlParams_.Set("prettyPrint", "false")
  59460. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  59461. urls += "?" + c.urlParams_.Encode()
  59462. req, err := http.NewRequest("POST", urls, body)
  59463. if err != nil {
  59464. return nil, err
  59465. }
  59466. req.Header = reqHeaders
  59467. googleapi.Expand(req.URL, map[string]string{
  59468. "project": c.project,
  59469. })
  59470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59471. }
  59472. // Do executes the "compute.networks.insert" call.
  59473. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59474. // status code is an error. Response headers are in either
  59475. // *Operation.ServerResponse.Header or (if a response was returned at
  59476. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59477. // to check whether the returned error was because
  59478. // http.StatusNotModified was returned.
  59479. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59480. gensupport.SetOptions(c.urlParams_, opts...)
  59481. res, err := c.doRequest("json")
  59482. if res != nil && res.StatusCode == http.StatusNotModified {
  59483. if res.Body != nil {
  59484. res.Body.Close()
  59485. }
  59486. return nil, &googleapi.Error{
  59487. Code: res.StatusCode,
  59488. Header: res.Header,
  59489. }
  59490. }
  59491. if err != nil {
  59492. return nil, err
  59493. }
  59494. defer googleapi.CloseBody(res)
  59495. if err := googleapi.CheckResponse(res); err != nil {
  59496. return nil, err
  59497. }
  59498. ret := &Operation{
  59499. ServerResponse: googleapi.ServerResponse{
  59500. Header: res.Header,
  59501. HTTPStatusCode: res.StatusCode,
  59502. },
  59503. }
  59504. target := &ret
  59505. if err := gensupport.DecodeResponse(target, res); err != nil {
  59506. return nil, err
  59507. }
  59508. return ret, nil
  59509. // {
  59510. // "description": "Creates a network in the specified project using the data included in the request.",
  59511. // "httpMethod": "POST",
  59512. // "id": "compute.networks.insert",
  59513. // "parameterOrder": [
  59514. // "project"
  59515. // ],
  59516. // "parameters": {
  59517. // "project": {
  59518. // "description": "Project ID for this request.",
  59519. // "location": "path",
  59520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59521. // "required": true,
  59522. // "type": "string"
  59523. // },
  59524. // "requestId": {
  59525. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59526. // "location": "query",
  59527. // "type": "string"
  59528. // }
  59529. // },
  59530. // "path": "{project}/global/networks",
  59531. // "request": {
  59532. // "$ref": "Network"
  59533. // },
  59534. // "response": {
  59535. // "$ref": "Operation"
  59536. // },
  59537. // "scopes": [
  59538. // "https://www.googleapis.com/auth/cloud-platform",
  59539. // "https://www.googleapis.com/auth/compute"
  59540. // ]
  59541. // }
  59542. }
  59543. // method id "compute.networks.list":
  59544. type NetworksListCall struct {
  59545. s *Service
  59546. project string
  59547. urlParams_ gensupport.URLParams
  59548. ifNoneMatch_ string
  59549. ctx_ context.Context
  59550. header_ http.Header
  59551. }
  59552. // List: Retrieves the list of networks available to the specified
  59553. // project.
  59554. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  59555. func (r *NetworksService) List(project string) *NetworksListCall {
  59556. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59557. c.project = project
  59558. return c
  59559. }
  59560. // Filter sets the optional parameter "filter": A filter expression that
  59561. // filters resources listed in the response. The expression must specify
  59562. // the field name, a comparison operator, and the value that you want to
  59563. // use for filtering. The value must be a string, a number, or a
  59564. // boolean. The comparison operator must be either =, !=, >, or <.
  59565. //
  59566. // For example, if you are filtering Compute Engine instances, you can
  59567. // exclude instances named example-instance by specifying name !=
  59568. // example-instance.
  59569. //
  59570. // You can also filter nested fields. For example, you could specify
  59571. // scheduling.automaticRestart = false to include instances only if they
  59572. // are not scheduled for automatic restarts. You can use filtering on
  59573. // nested fields to filter based on resource labels.
  59574. //
  59575. // To filter on multiple expressions, provide each separate expression
  59576. // within parentheses. For example, (scheduling.automaticRestart = true)
  59577. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59578. // AND expression. However, you can include AND and OR expressions
  59579. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59580. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59581. // true).
  59582. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  59583. c.urlParams_.Set("filter", filter)
  59584. return c
  59585. }
  59586. // MaxResults sets the optional parameter "maxResults": The maximum
  59587. // number of results per page that should be returned. If the number of
  59588. // available results is larger than maxResults, Compute Engine returns a
  59589. // nextPageToken that can be used to get the next page of results in
  59590. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59591. // (Default: 500)
  59592. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  59593. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59594. return c
  59595. }
  59596. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59597. // a certain order. By default, results are returned in alphanumerical
  59598. // order based on the resource name.
  59599. //
  59600. // You can also sort results in descending order based on the creation
  59601. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59602. // based on the creationTimestamp field in reverse chronological order
  59603. // (newest result first). Use this to sort resources like operations so
  59604. // that the newest operation is returned first.
  59605. //
  59606. // Currently, only sorting by name or creationTimestamp desc is
  59607. // supported.
  59608. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  59609. c.urlParams_.Set("orderBy", orderBy)
  59610. return c
  59611. }
  59612. // PageToken sets the optional parameter "pageToken": Specifies a page
  59613. // token to use. Set pageToken to the nextPageToken returned by a
  59614. // previous list request to get the next page of results.
  59615. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  59616. c.urlParams_.Set("pageToken", pageToken)
  59617. return c
  59618. }
  59619. // Fields allows partial responses to be retrieved. See
  59620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59621. // for more information.
  59622. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  59623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59624. return c
  59625. }
  59626. // IfNoneMatch sets the optional parameter which makes the operation
  59627. // fail if the object's ETag matches the given value. This is useful for
  59628. // getting updates only after the object has changed since the last
  59629. // request. Use googleapi.IsNotModified to check whether the response
  59630. // error from Do is the result of In-None-Match.
  59631. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  59632. c.ifNoneMatch_ = entityTag
  59633. return c
  59634. }
  59635. // Context sets the context to be used in this call's Do method. Any
  59636. // pending HTTP request will be aborted if the provided context is
  59637. // canceled.
  59638. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  59639. c.ctx_ = ctx
  59640. return c
  59641. }
  59642. // Header returns an http.Header that can be modified by the caller to
  59643. // add HTTP headers to the request.
  59644. func (c *NetworksListCall) Header() http.Header {
  59645. if c.header_ == nil {
  59646. c.header_ = make(http.Header)
  59647. }
  59648. return c.header_
  59649. }
  59650. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  59651. reqHeaders := make(http.Header)
  59652. for k, v := range c.header_ {
  59653. reqHeaders[k] = v
  59654. }
  59655. reqHeaders.Set("User-Agent", c.s.userAgent())
  59656. if c.ifNoneMatch_ != "" {
  59657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59658. }
  59659. var body io.Reader = nil
  59660. c.urlParams_.Set("alt", alt)
  59661. c.urlParams_.Set("prettyPrint", "false")
  59662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  59663. urls += "?" + c.urlParams_.Encode()
  59664. req, err := http.NewRequest("GET", urls, body)
  59665. if err != nil {
  59666. return nil, err
  59667. }
  59668. req.Header = reqHeaders
  59669. googleapi.Expand(req.URL, map[string]string{
  59670. "project": c.project,
  59671. })
  59672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59673. }
  59674. // Do executes the "compute.networks.list" call.
  59675. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  59676. // status code is an error. Response headers are in either
  59677. // *NetworkList.ServerResponse.Header or (if a response was returned at
  59678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59679. // to check whether the returned error was because
  59680. // http.StatusNotModified was returned.
  59681. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  59682. gensupport.SetOptions(c.urlParams_, opts...)
  59683. res, err := c.doRequest("json")
  59684. if res != nil && res.StatusCode == http.StatusNotModified {
  59685. if res.Body != nil {
  59686. res.Body.Close()
  59687. }
  59688. return nil, &googleapi.Error{
  59689. Code: res.StatusCode,
  59690. Header: res.Header,
  59691. }
  59692. }
  59693. if err != nil {
  59694. return nil, err
  59695. }
  59696. defer googleapi.CloseBody(res)
  59697. if err := googleapi.CheckResponse(res); err != nil {
  59698. return nil, err
  59699. }
  59700. ret := &NetworkList{
  59701. ServerResponse: googleapi.ServerResponse{
  59702. Header: res.Header,
  59703. HTTPStatusCode: res.StatusCode,
  59704. },
  59705. }
  59706. target := &ret
  59707. if err := gensupport.DecodeResponse(target, res); err != nil {
  59708. return nil, err
  59709. }
  59710. return ret, nil
  59711. // {
  59712. // "description": "Retrieves the list of networks available to the specified project.",
  59713. // "httpMethod": "GET",
  59714. // "id": "compute.networks.list",
  59715. // "parameterOrder": [
  59716. // "project"
  59717. // ],
  59718. // "parameters": {
  59719. // "filter": {
  59720. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59721. // "location": "query",
  59722. // "type": "string"
  59723. // },
  59724. // "maxResults": {
  59725. // "default": "500",
  59726. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59727. // "format": "uint32",
  59728. // "location": "query",
  59729. // "minimum": "0",
  59730. // "type": "integer"
  59731. // },
  59732. // "orderBy": {
  59733. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59734. // "location": "query",
  59735. // "type": "string"
  59736. // },
  59737. // "pageToken": {
  59738. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59739. // "location": "query",
  59740. // "type": "string"
  59741. // },
  59742. // "project": {
  59743. // "description": "Project ID for this request.",
  59744. // "location": "path",
  59745. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59746. // "required": true,
  59747. // "type": "string"
  59748. // }
  59749. // },
  59750. // "path": "{project}/global/networks",
  59751. // "response": {
  59752. // "$ref": "NetworkList"
  59753. // },
  59754. // "scopes": [
  59755. // "https://www.googleapis.com/auth/cloud-platform",
  59756. // "https://www.googleapis.com/auth/compute",
  59757. // "https://www.googleapis.com/auth/compute.readonly"
  59758. // ]
  59759. // }
  59760. }
  59761. // Pages invokes f for each page of results.
  59762. // A non-nil error returned from f will halt the iteration.
  59763. // The provided context supersedes any context provided to the Context method.
  59764. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  59765. c.ctx_ = ctx
  59766. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59767. for {
  59768. x, err := c.Do()
  59769. if err != nil {
  59770. return err
  59771. }
  59772. if err := f(x); err != nil {
  59773. return err
  59774. }
  59775. if x.NextPageToken == "" {
  59776. return nil
  59777. }
  59778. c.PageToken(x.NextPageToken)
  59779. }
  59780. }
  59781. // method id "compute.networks.patch":
  59782. type NetworksPatchCall struct {
  59783. s *Service
  59784. project string
  59785. network string
  59786. network2 *Network
  59787. urlParams_ gensupport.URLParams
  59788. ctx_ context.Context
  59789. header_ http.Header
  59790. }
  59791. // Patch: Patches the specified network with the data included in the
  59792. // request. Only the following fields can be modified:
  59793. // routingConfig.routingMode.
  59794. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  59795. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59796. c.project = project
  59797. c.network = network
  59798. c.network2 = network2
  59799. return c
  59800. }
  59801. // RequestId sets the optional parameter "requestId": An optional
  59802. // request ID to identify requests. Specify a unique request ID so that
  59803. // if you must retry your request, the server will know to ignore the
  59804. // request if it has already been completed.
  59805. //
  59806. // For example, consider a situation where you make an initial request
  59807. // and the request times out. If you make the request again with the
  59808. // same request ID, the server can check if original operation with the
  59809. // same request ID was received, and if so, will ignore the second
  59810. // request. This prevents clients from accidentally creating duplicate
  59811. // commitments.
  59812. //
  59813. // The request ID must be a valid UUID with the exception that zero UUID
  59814. // is not supported (00000000-0000-0000-0000-000000000000).
  59815. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  59816. c.urlParams_.Set("requestId", requestId)
  59817. return c
  59818. }
  59819. // Fields allows partial responses to be retrieved. See
  59820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59821. // for more information.
  59822. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  59823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59824. return c
  59825. }
  59826. // Context sets the context to be used in this call's Do method. Any
  59827. // pending HTTP request will be aborted if the provided context is
  59828. // canceled.
  59829. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  59830. c.ctx_ = ctx
  59831. return c
  59832. }
  59833. // Header returns an http.Header that can be modified by the caller to
  59834. // add HTTP headers to the request.
  59835. func (c *NetworksPatchCall) Header() http.Header {
  59836. if c.header_ == nil {
  59837. c.header_ = make(http.Header)
  59838. }
  59839. return c.header_
  59840. }
  59841. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  59842. reqHeaders := make(http.Header)
  59843. for k, v := range c.header_ {
  59844. reqHeaders[k] = v
  59845. }
  59846. reqHeaders.Set("User-Agent", c.s.userAgent())
  59847. var body io.Reader = nil
  59848. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  59849. if err != nil {
  59850. return nil, err
  59851. }
  59852. reqHeaders.Set("Content-Type", "application/json")
  59853. c.urlParams_.Set("alt", alt)
  59854. c.urlParams_.Set("prettyPrint", "false")
  59855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  59856. urls += "?" + c.urlParams_.Encode()
  59857. req, err := http.NewRequest("PATCH", urls, body)
  59858. if err != nil {
  59859. return nil, err
  59860. }
  59861. req.Header = reqHeaders
  59862. googleapi.Expand(req.URL, map[string]string{
  59863. "project": c.project,
  59864. "network": c.network,
  59865. })
  59866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59867. }
  59868. // Do executes the "compute.networks.patch" call.
  59869. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59870. // status code is an error. Response headers are in either
  59871. // *Operation.ServerResponse.Header or (if a response was returned at
  59872. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59873. // to check whether the returned error was because
  59874. // http.StatusNotModified was returned.
  59875. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59876. gensupport.SetOptions(c.urlParams_, opts...)
  59877. res, err := c.doRequest("json")
  59878. if res != nil && res.StatusCode == http.StatusNotModified {
  59879. if res.Body != nil {
  59880. res.Body.Close()
  59881. }
  59882. return nil, &googleapi.Error{
  59883. Code: res.StatusCode,
  59884. Header: res.Header,
  59885. }
  59886. }
  59887. if err != nil {
  59888. return nil, err
  59889. }
  59890. defer googleapi.CloseBody(res)
  59891. if err := googleapi.CheckResponse(res); err != nil {
  59892. return nil, err
  59893. }
  59894. ret := &Operation{
  59895. ServerResponse: googleapi.ServerResponse{
  59896. Header: res.Header,
  59897. HTTPStatusCode: res.StatusCode,
  59898. },
  59899. }
  59900. target := &ret
  59901. if err := gensupport.DecodeResponse(target, res); err != nil {
  59902. return nil, err
  59903. }
  59904. return ret, nil
  59905. // {
  59906. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  59907. // "httpMethod": "PATCH",
  59908. // "id": "compute.networks.patch",
  59909. // "parameterOrder": [
  59910. // "project",
  59911. // "network"
  59912. // ],
  59913. // "parameters": {
  59914. // "network": {
  59915. // "description": "Name of the network to update.",
  59916. // "location": "path",
  59917. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59918. // "required": true,
  59919. // "type": "string"
  59920. // },
  59921. // "project": {
  59922. // "description": "Project ID for this request.",
  59923. // "location": "path",
  59924. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59925. // "required": true,
  59926. // "type": "string"
  59927. // },
  59928. // "requestId": {
  59929. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59930. // "location": "query",
  59931. // "type": "string"
  59932. // }
  59933. // },
  59934. // "path": "{project}/global/networks/{network}",
  59935. // "request": {
  59936. // "$ref": "Network"
  59937. // },
  59938. // "response": {
  59939. // "$ref": "Operation"
  59940. // },
  59941. // "scopes": [
  59942. // "https://www.googleapis.com/auth/cloud-platform",
  59943. // "https://www.googleapis.com/auth/compute"
  59944. // ]
  59945. // }
  59946. }
  59947. // method id "compute.networks.removePeering":
  59948. type NetworksRemovePeeringCall struct {
  59949. s *Service
  59950. project string
  59951. network string
  59952. networksremovepeeringrequest *NetworksRemovePeeringRequest
  59953. urlParams_ gensupport.URLParams
  59954. ctx_ context.Context
  59955. header_ http.Header
  59956. }
  59957. // RemovePeering: Removes a peering from the specified network.
  59958. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  59959. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59960. c.project = project
  59961. c.network = network
  59962. c.networksremovepeeringrequest = networksremovepeeringrequest
  59963. return c
  59964. }
  59965. // RequestId sets the optional parameter "requestId": An optional
  59966. // request ID to identify requests. Specify a unique request ID so that
  59967. // if you must retry your request, the server will know to ignore the
  59968. // request if it has already been completed.
  59969. //
  59970. // For example, consider a situation where you make an initial request
  59971. // and the request times out. If you make the request again with the
  59972. // same request ID, the server can check if original operation with the
  59973. // same request ID was received, and if so, will ignore the second
  59974. // request. This prevents clients from accidentally creating duplicate
  59975. // commitments.
  59976. //
  59977. // The request ID must be a valid UUID with the exception that zero UUID
  59978. // is not supported (00000000-0000-0000-0000-000000000000).
  59979. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  59980. c.urlParams_.Set("requestId", requestId)
  59981. return c
  59982. }
  59983. // Fields allows partial responses to be retrieved. See
  59984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59985. // for more information.
  59986. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  59987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59988. return c
  59989. }
  59990. // Context sets the context to be used in this call's Do method. Any
  59991. // pending HTTP request will be aborted if the provided context is
  59992. // canceled.
  59993. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  59994. c.ctx_ = ctx
  59995. return c
  59996. }
  59997. // Header returns an http.Header that can be modified by the caller to
  59998. // add HTTP headers to the request.
  59999. func (c *NetworksRemovePeeringCall) Header() http.Header {
  60000. if c.header_ == nil {
  60001. c.header_ = make(http.Header)
  60002. }
  60003. return c.header_
  60004. }
  60005. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  60006. reqHeaders := make(http.Header)
  60007. for k, v := range c.header_ {
  60008. reqHeaders[k] = v
  60009. }
  60010. reqHeaders.Set("User-Agent", c.s.userAgent())
  60011. var body io.Reader = nil
  60012. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  60013. if err != nil {
  60014. return nil, err
  60015. }
  60016. reqHeaders.Set("Content-Type", "application/json")
  60017. c.urlParams_.Set("alt", alt)
  60018. c.urlParams_.Set("prettyPrint", "false")
  60019. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  60020. urls += "?" + c.urlParams_.Encode()
  60021. req, err := http.NewRequest("POST", urls, body)
  60022. if err != nil {
  60023. return nil, err
  60024. }
  60025. req.Header = reqHeaders
  60026. googleapi.Expand(req.URL, map[string]string{
  60027. "project": c.project,
  60028. "network": c.network,
  60029. })
  60030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60031. }
  60032. // Do executes the "compute.networks.removePeering" call.
  60033. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60034. // status code is an error. Response headers are in either
  60035. // *Operation.ServerResponse.Header or (if a response was returned at
  60036. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60037. // to check whether the returned error was because
  60038. // http.StatusNotModified was returned.
  60039. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60040. gensupport.SetOptions(c.urlParams_, opts...)
  60041. res, err := c.doRequest("json")
  60042. if res != nil && res.StatusCode == http.StatusNotModified {
  60043. if res.Body != nil {
  60044. res.Body.Close()
  60045. }
  60046. return nil, &googleapi.Error{
  60047. Code: res.StatusCode,
  60048. Header: res.Header,
  60049. }
  60050. }
  60051. if err != nil {
  60052. return nil, err
  60053. }
  60054. defer googleapi.CloseBody(res)
  60055. if err := googleapi.CheckResponse(res); err != nil {
  60056. return nil, err
  60057. }
  60058. ret := &Operation{
  60059. ServerResponse: googleapi.ServerResponse{
  60060. Header: res.Header,
  60061. HTTPStatusCode: res.StatusCode,
  60062. },
  60063. }
  60064. target := &ret
  60065. if err := gensupport.DecodeResponse(target, res); err != nil {
  60066. return nil, err
  60067. }
  60068. return ret, nil
  60069. // {
  60070. // "description": "Removes a peering from the specified network.",
  60071. // "httpMethod": "POST",
  60072. // "id": "compute.networks.removePeering",
  60073. // "parameterOrder": [
  60074. // "project",
  60075. // "network"
  60076. // ],
  60077. // "parameters": {
  60078. // "network": {
  60079. // "description": "Name of the network resource to remove peering from.",
  60080. // "location": "path",
  60081. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60082. // "required": true,
  60083. // "type": "string"
  60084. // },
  60085. // "project": {
  60086. // "description": "Project ID for this request.",
  60087. // "location": "path",
  60088. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60089. // "required": true,
  60090. // "type": "string"
  60091. // },
  60092. // "requestId": {
  60093. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60094. // "location": "query",
  60095. // "type": "string"
  60096. // }
  60097. // },
  60098. // "path": "{project}/global/networks/{network}/removePeering",
  60099. // "request": {
  60100. // "$ref": "NetworksRemovePeeringRequest"
  60101. // },
  60102. // "response": {
  60103. // "$ref": "Operation"
  60104. // },
  60105. // "scopes": [
  60106. // "https://www.googleapis.com/auth/cloud-platform",
  60107. // "https://www.googleapis.com/auth/compute"
  60108. // ]
  60109. // }
  60110. }
  60111. // method id "compute.networks.switchToCustomMode":
  60112. type NetworksSwitchToCustomModeCall struct {
  60113. s *Service
  60114. project string
  60115. network string
  60116. urlParams_ gensupport.URLParams
  60117. ctx_ context.Context
  60118. header_ http.Header
  60119. }
  60120. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  60121. // to custom subnet mode.
  60122. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  60123. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60124. c.project = project
  60125. c.network = network
  60126. return c
  60127. }
  60128. // RequestId sets the optional parameter "requestId": An optional
  60129. // request ID to identify requests. Specify a unique request ID so that
  60130. // if you must retry your request, the server will know to ignore the
  60131. // request if it has already been completed.
  60132. //
  60133. // For example, consider a situation where you make an initial request
  60134. // and the request times out. If you make the request again with the
  60135. // same request ID, the server can check if original operation with the
  60136. // same request ID was received, and if so, will ignore the second
  60137. // request. This prevents clients from accidentally creating duplicate
  60138. // commitments.
  60139. //
  60140. // The request ID must be a valid UUID with the exception that zero UUID
  60141. // is not supported (00000000-0000-0000-0000-000000000000).
  60142. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  60143. c.urlParams_.Set("requestId", requestId)
  60144. return c
  60145. }
  60146. // Fields allows partial responses to be retrieved. See
  60147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60148. // for more information.
  60149. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  60150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60151. return c
  60152. }
  60153. // Context sets the context to be used in this call's Do method. Any
  60154. // pending HTTP request will be aborted if the provided context is
  60155. // canceled.
  60156. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  60157. c.ctx_ = ctx
  60158. return c
  60159. }
  60160. // Header returns an http.Header that can be modified by the caller to
  60161. // add HTTP headers to the request.
  60162. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  60163. if c.header_ == nil {
  60164. c.header_ = make(http.Header)
  60165. }
  60166. return c.header_
  60167. }
  60168. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  60169. reqHeaders := make(http.Header)
  60170. for k, v := range c.header_ {
  60171. reqHeaders[k] = v
  60172. }
  60173. reqHeaders.Set("User-Agent", c.s.userAgent())
  60174. var body io.Reader = nil
  60175. c.urlParams_.Set("alt", alt)
  60176. c.urlParams_.Set("prettyPrint", "false")
  60177. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  60178. urls += "?" + c.urlParams_.Encode()
  60179. req, err := http.NewRequest("POST", urls, body)
  60180. if err != nil {
  60181. return nil, err
  60182. }
  60183. req.Header = reqHeaders
  60184. googleapi.Expand(req.URL, map[string]string{
  60185. "project": c.project,
  60186. "network": c.network,
  60187. })
  60188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60189. }
  60190. // Do executes the "compute.networks.switchToCustomMode" call.
  60191. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60192. // status code is an error. Response headers are in either
  60193. // *Operation.ServerResponse.Header or (if a response was returned at
  60194. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60195. // to check whether the returned error was because
  60196. // http.StatusNotModified was returned.
  60197. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60198. gensupport.SetOptions(c.urlParams_, opts...)
  60199. res, err := c.doRequest("json")
  60200. if res != nil && res.StatusCode == http.StatusNotModified {
  60201. if res.Body != nil {
  60202. res.Body.Close()
  60203. }
  60204. return nil, &googleapi.Error{
  60205. Code: res.StatusCode,
  60206. Header: res.Header,
  60207. }
  60208. }
  60209. if err != nil {
  60210. return nil, err
  60211. }
  60212. defer googleapi.CloseBody(res)
  60213. if err := googleapi.CheckResponse(res); err != nil {
  60214. return nil, err
  60215. }
  60216. ret := &Operation{
  60217. ServerResponse: googleapi.ServerResponse{
  60218. Header: res.Header,
  60219. HTTPStatusCode: res.StatusCode,
  60220. },
  60221. }
  60222. target := &ret
  60223. if err := gensupport.DecodeResponse(target, res); err != nil {
  60224. return nil, err
  60225. }
  60226. return ret, nil
  60227. // {
  60228. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  60229. // "httpMethod": "POST",
  60230. // "id": "compute.networks.switchToCustomMode",
  60231. // "parameterOrder": [
  60232. // "project",
  60233. // "network"
  60234. // ],
  60235. // "parameters": {
  60236. // "network": {
  60237. // "description": "Name of the network to be updated.",
  60238. // "location": "path",
  60239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60240. // "required": true,
  60241. // "type": "string"
  60242. // },
  60243. // "project": {
  60244. // "description": "Project ID for this request.",
  60245. // "location": "path",
  60246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60247. // "required": true,
  60248. // "type": "string"
  60249. // },
  60250. // "requestId": {
  60251. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60252. // "location": "query",
  60253. // "type": "string"
  60254. // }
  60255. // },
  60256. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  60257. // "response": {
  60258. // "$ref": "Operation"
  60259. // },
  60260. // "scopes": [
  60261. // "https://www.googleapis.com/auth/cloud-platform",
  60262. // "https://www.googleapis.com/auth/compute"
  60263. // ]
  60264. // }
  60265. }
  60266. // method id "compute.nodeGroups.addNodes":
  60267. type NodeGroupsAddNodesCall struct {
  60268. s *Service
  60269. project string
  60270. zone string
  60271. nodeGroup string
  60272. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  60273. urlParams_ gensupport.URLParams
  60274. ctx_ context.Context
  60275. header_ http.Header
  60276. }
  60277. // AddNodes: Adds specified number of nodes to the node group.
  60278. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  60279. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60280. c.project = project
  60281. c.zone = zone
  60282. c.nodeGroup = nodeGroup
  60283. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  60284. return c
  60285. }
  60286. // RequestId sets the optional parameter "requestId": An optional
  60287. // request ID to identify requests. Specify a unique request ID so that
  60288. // if you must retry your request, the server will know to ignore the
  60289. // request if it has already been completed.
  60290. //
  60291. // For example, consider a situation where you make an initial request
  60292. // and the request times out. If you make the request again with the
  60293. // same request ID, the server can check if original operation with the
  60294. // same request ID was received, and if so, will ignore the second
  60295. // request. This prevents clients from accidentally creating duplicate
  60296. // commitments.
  60297. //
  60298. // The request ID must be a valid UUID with the exception that zero UUID
  60299. // is not supported (00000000-0000-0000-0000-000000000000).
  60300. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  60301. c.urlParams_.Set("requestId", requestId)
  60302. return c
  60303. }
  60304. // Fields allows partial responses to be retrieved. See
  60305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60306. // for more information.
  60307. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  60308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60309. return c
  60310. }
  60311. // Context sets the context to be used in this call's Do method. Any
  60312. // pending HTTP request will be aborted if the provided context is
  60313. // canceled.
  60314. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  60315. c.ctx_ = ctx
  60316. return c
  60317. }
  60318. // Header returns an http.Header that can be modified by the caller to
  60319. // add HTTP headers to the request.
  60320. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  60321. if c.header_ == nil {
  60322. c.header_ = make(http.Header)
  60323. }
  60324. return c.header_
  60325. }
  60326. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  60327. reqHeaders := make(http.Header)
  60328. for k, v := range c.header_ {
  60329. reqHeaders[k] = v
  60330. }
  60331. reqHeaders.Set("User-Agent", c.s.userAgent())
  60332. var body io.Reader = nil
  60333. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  60334. if err != nil {
  60335. return nil, err
  60336. }
  60337. reqHeaders.Set("Content-Type", "application/json")
  60338. c.urlParams_.Set("alt", alt)
  60339. c.urlParams_.Set("prettyPrint", "false")
  60340. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  60341. urls += "?" + c.urlParams_.Encode()
  60342. req, err := http.NewRequest("POST", urls, body)
  60343. if err != nil {
  60344. return nil, err
  60345. }
  60346. req.Header = reqHeaders
  60347. googleapi.Expand(req.URL, map[string]string{
  60348. "project": c.project,
  60349. "zone": c.zone,
  60350. "nodeGroup": c.nodeGroup,
  60351. })
  60352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60353. }
  60354. // Do executes the "compute.nodeGroups.addNodes" call.
  60355. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60356. // status code is an error. Response headers are in either
  60357. // *Operation.ServerResponse.Header or (if a response was returned at
  60358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60359. // to check whether the returned error was because
  60360. // http.StatusNotModified was returned.
  60361. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60362. gensupport.SetOptions(c.urlParams_, opts...)
  60363. res, err := c.doRequest("json")
  60364. if res != nil && res.StatusCode == http.StatusNotModified {
  60365. if res.Body != nil {
  60366. res.Body.Close()
  60367. }
  60368. return nil, &googleapi.Error{
  60369. Code: res.StatusCode,
  60370. Header: res.Header,
  60371. }
  60372. }
  60373. if err != nil {
  60374. return nil, err
  60375. }
  60376. defer googleapi.CloseBody(res)
  60377. if err := googleapi.CheckResponse(res); err != nil {
  60378. return nil, err
  60379. }
  60380. ret := &Operation{
  60381. ServerResponse: googleapi.ServerResponse{
  60382. Header: res.Header,
  60383. HTTPStatusCode: res.StatusCode,
  60384. },
  60385. }
  60386. target := &ret
  60387. if err := gensupport.DecodeResponse(target, res); err != nil {
  60388. return nil, err
  60389. }
  60390. return ret, nil
  60391. // {
  60392. // "description": "Adds specified number of nodes to the node group.",
  60393. // "httpMethod": "POST",
  60394. // "id": "compute.nodeGroups.addNodes",
  60395. // "parameterOrder": [
  60396. // "project",
  60397. // "zone",
  60398. // "nodeGroup"
  60399. // ],
  60400. // "parameters": {
  60401. // "nodeGroup": {
  60402. // "description": "Name of the NodeGroup resource.",
  60403. // "location": "path",
  60404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60405. // "required": true,
  60406. // "type": "string"
  60407. // },
  60408. // "project": {
  60409. // "description": "Project ID for this request.",
  60410. // "location": "path",
  60411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60412. // "required": true,
  60413. // "type": "string"
  60414. // },
  60415. // "requestId": {
  60416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60417. // "location": "query",
  60418. // "type": "string"
  60419. // },
  60420. // "zone": {
  60421. // "description": "The name of the zone for this request.",
  60422. // "location": "path",
  60423. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60424. // "required": true,
  60425. // "type": "string"
  60426. // }
  60427. // },
  60428. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  60429. // "request": {
  60430. // "$ref": "NodeGroupsAddNodesRequest"
  60431. // },
  60432. // "response": {
  60433. // "$ref": "Operation"
  60434. // },
  60435. // "scopes": [
  60436. // "https://www.googleapis.com/auth/cloud-platform",
  60437. // "https://www.googleapis.com/auth/compute"
  60438. // ]
  60439. // }
  60440. }
  60441. // method id "compute.nodeGroups.aggregatedList":
  60442. type NodeGroupsAggregatedListCall struct {
  60443. s *Service
  60444. project string
  60445. urlParams_ gensupport.URLParams
  60446. ifNoneMatch_ string
  60447. ctx_ context.Context
  60448. header_ http.Header
  60449. }
  60450. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  60451. // use nodeGroups.listNodes for more details about each group.
  60452. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  60453. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60454. c.project = project
  60455. return c
  60456. }
  60457. // Filter sets the optional parameter "filter": A filter expression that
  60458. // filters resources listed in the response. The expression must specify
  60459. // the field name, a comparison operator, and the value that you want to
  60460. // use for filtering. The value must be a string, a number, or a
  60461. // boolean. The comparison operator must be either =, !=, >, or <.
  60462. //
  60463. // For example, if you are filtering Compute Engine instances, you can
  60464. // exclude instances named example-instance by specifying name !=
  60465. // example-instance.
  60466. //
  60467. // You can also filter nested fields. For example, you could specify
  60468. // scheduling.automaticRestart = false to include instances only if they
  60469. // are not scheduled for automatic restarts. You can use filtering on
  60470. // nested fields to filter based on resource labels.
  60471. //
  60472. // To filter on multiple expressions, provide each separate expression
  60473. // within parentheses. For example, (scheduling.automaticRestart = true)
  60474. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60475. // AND expression. However, you can include AND and OR expressions
  60476. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60477. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60478. // true).
  60479. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  60480. c.urlParams_.Set("filter", filter)
  60481. return c
  60482. }
  60483. // MaxResults sets the optional parameter "maxResults": The maximum
  60484. // number of results per page that should be returned. If the number of
  60485. // available results is larger than maxResults, Compute Engine returns a
  60486. // nextPageToken that can be used to get the next page of results in
  60487. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60488. // (Default: 500)
  60489. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  60490. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60491. return c
  60492. }
  60493. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60494. // a certain order. By default, results are returned in alphanumerical
  60495. // order based on the resource name.
  60496. //
  60497. // You can also sort results in descending order based on the creation
  60498. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60499. // based on the creationTimestamp field in reverse chronological order
  60500. // (newest result first). Use this to sort resources like operations so
  60501. // that the newest operation is returned first.
  60502. //
  60503. // Currently, only sorting by name or creationTimestamp desc is
  60504. // supported.
  60505. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  60506. c.urlParams_.Set("orderBy", orderBy)
  60507. return c
  60508. }
  60509. // PageToken sets the optional parameter "pageToken": Specifies a page
  60510. // token to use. Set pageToken to the nextPageToken returned by a
  60511. // previous list request to get the next page of results.
  60512. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  60513. c.urlParams_.Set("pageToken", pageToken)
  60514. return c
  60515. }
  60516. // Fields allows partial responses to be retrieved. See
  60517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60518. // for more information.
  60519. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  60520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60521. return c
  60522. }
  60523. // IfNoneMatch sets the optional parameter which makes the operation
  60524. // fail if the object's ETag matches the given value. This is useful for
  60525. // getting updates only after the object has changed since the last
  60526. // request. Use googleapi.IsNotModified to check whether the response
  60527. // error from Do is the result of In-None-Match.
  60528. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  60529. c.ifNoneMatch_ = entityTag
  60530. return c
  60531. }
  60532. // Context sets the context to be used in this call's Do method. Any
  60533. // pending HTTP request will be aborted if the provided context is
  60534. // canceled.
  60535. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  60536. c.ctx_ = ctx
  60537. return c
  60538. }
  60539. // Header returns an http.Header that can be modified by the caller to
  60540. // add HTTP headers to the request.
  60541. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  60542. if c.header_ == nil {
  60543. c.header_ = make(http.Header)
  60544. }
  60545. return c.header_
  60546. }
  60547. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  60548. reqHeaders := make(http.Header)
  60549. for k, v := range c.header_ {
  60550. reqHeaders[k] = v
  60551. }
  60552. reqHeaders.Set("User-Agent", c.s.userAgent())
  60553. if c.ifNoneMatch_ != "" {
  60554. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60555. }
  60556. var body io.Reader = nil
  60557. c.urlParams_.Set("alt", alt)
  60558. c.urlParams_.Set("prettyPrint", "false")
  60559. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  60560. urls += "?" + c.urlParams_.Encode()
  60561. req, err := http.NewRequest("GET", urls, body)
  60562. if err != nil {
  60563. return nil, err
  60564. }
  60565. req.Header = reqHeaders
  60566. googleapi.Expand(req.URL, map[string]string{
  60567. "project": c.project,
  60568. })
  60569. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60570. }
  60571. // Do executes the "compute.nodeGroups.aggregatedList" call.
  60572. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  60573. // non-2xx status code is an error. Response headers are in either
  60574. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  60575. // returned at all) in error.(*googleapi.Error).Header. Use
  60576. // googleapi.IsNotModified to check whether the returned error was
  60577. // because http.StatusNotModified was returned.
  60578. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  60579. gensupport.SetOptions(c.urlParams_, opts...)
  60580. res, err := c.doRequest("json")
  60581. if res != nil && res.StatusCode == http.StatusNotModified {
  60582. if res.Body != nil {
  60583. res.Body.Close()
  60584. }
  60585. return nil, &googleapi.Error{
  60586. Code: res.StatusCode,
  60587. Header: res.Header,
  60588. }
  60589. }
  60590. if err != nil {
  60591. return nil, err
  60592. }
  60593. defer googleapi.CloseBody(res)
  60594. if err := googleapi.CheckResponse(res); err != nil {
  60595. return nil, err
  60596. }
  60597. ret := &NodeGroupAggregatedList{
  60598. ServerResponse: googleapi.ServerResponse{
  60599. Header: res.Header,
  60600. HTTPStatusCode: res.StatusCode,
  60601. },
  60602. }
  60603. target := &ret
  60604. if err := gensupport.DecodeResponse(target, res); err != nil {
  60605. return nil, err
  60606. }
  60607. return ret, nil
  60608. // {
  60609. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  60610. // "httpMethod": "GET",
  60611. // "id": "compute.nodeGroups.aggregatedList",
  60612. // "parameterOrder": [
  60613. // "project"
  60614. // ],
  60615. // "parameters": {
  60616. // "filter": {
  60617. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60618. // "location": "query",
  60619. // "type": "string"
  60620. // },
  60621. // "maxResults": {
  60622. // "default": "500",
  60623. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60624. // "format": "uint32",
  60625. // "location": "query",
  60626. // "minimum": "0",
  60627. // "type": "integer"
  60628. // },
  60629. // "orderBy": {
  60630. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60631. // "location": "query",
  60632. // "type": "string"
  60633. // },
  60634. // "pageToken": {
  60635. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60636. // "location": "query",
  60637. // "type": "string"
  60638. // },
  60639. // "project": {
  60640. // "description": "Project ID for this request.",
  60641. // "location": "path",
  60642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60643. // "required": true,
  60644. // "type": "string"
  60645. // }
  60646. // },
  60647. // "path": "{project}/aggregated/nodeGroups",
  60648. // "response": {
  60649. // "$ref": "NodeGroupAggregatedList"
  60650. // },
  60651. // "scopes": [
  60652. // "https://www.googleapis.com/auth/cloud-platform",
  60653. // "https://www.googleapis.com/auth/compute",
  60654. // "https://www.googleapis.com/auth/compute.readonly"
  60655. // ]
  60656. // }
  60657. }
  60658. // Pages invokes f for each page of results.
  60659. // A non-nil error returned from f will halt the iteration.
  60660. // The provided context supersedes any context provided to the Context method.
  60661. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  60662. c.ctx_ = ctx
  60663. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60664. for {
  60665. x, err := c.Do()
  60666. if err != nil {
  60667. return err
  60668. }
  60669. if err := f(x); err != nil {
  60670. return err
  60671. }
  60672. if x.NextPageToken == "" {
  60673. return nil
  60674. }
  60675. c.PageToken(x.NextPageToken)
  60676. }
  60677. }
  60678. // method id "compute.nodeGroups.delete":
  60679. type NodeGroupsDeleteCall struct {
  60680. s *Service
  60681. project string
  60682. zone string
  60683. nodeGroup string
  60684. urlParams_ gensupport.URLParams
  60685. ctx_ context.Context
  60686. header_ http.Header
  60687. }
  60688. // Delete: Deletes the specified NodeGroup resource.
  60689. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  60690. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60691. c.project = project
  60692. c.zone = zone
  60693. c.nodeGroup = nodeGroup
  60694. return c
  60695. }
  60696. // RequestId sets the optional parameter "requestId": An optional
  60697. // request ID to identify requests. Specify a unique request ID so that
  60698. // if you must retry your request, the server will know to ignore the
  60699. // request if it has already been completed.
  60700. //
  60701. // For example, consider a situation where you make an initial request
  60702. // and the request times out. If you make the request again with the
  60703. // same request ID, the server can check if original operation with the
  60704. // same request ID was received, and if so, will ignore the second
  60705. // request. This prevents clients from accidentally creating duplicate
  60706. // commitments.
  60707. //
  60708. // The request ID must be a valid UUID with the exception that zero UUID
  60709. // is not supported (00000000-0000-0000-0000-000000000000).
  60710. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  60711. c.urlParams_.Set("requestId", requestId)
  60712. return c
  60713. }
  60714. // Fields allows partial responses to be retrieved. See
  60715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60716. // for more information.
  60717. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  60718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60719. return c
  60720. }
  60721. // Context sets the context to be used in this call's Do method. Any
  60722. // pending HTTP request will be aborted if the provided context is
  60723. // canceled.
  60724. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  60725. c.ctx_ = ctx
  60726. return c
  60727. }
  60728. // Header returns an http.Header that can be modified by the caller to
  60729. // add HTTP headers to the request.
  60730. func (c *NodeGroupsDeleteCall) Header() http.Header {
  60731. if c.header_ == nil {
  60732. c.header_ = make(http.Header)
  60733. }
  60734. return c.header_
  60735. }
  60736. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  60737. reqHeaders := make(http.Header)
  60738. for k, v := range c.header_ {
  60739. reqHeaders[k] = v
  60740. }
  60741. reqHeaders.Set("User-Agent", c.s.userAgent())
  60742. var body io.Reader = nil
  60743. c.urlParams_.Set("alt", alt)
  60744. c.urlParams_.Set("prettyPrint", "false")
  60745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  60746. urls += "?" + c.urlParams_.Encode()
  60747. req, err := http.NewRequest("DELETE", urls, body)
  60748. if err != nil {
  60749. return nil, err
  60750. }
  60751. req.Header = reqHeaders
  60752. googleapi.Expand(req.URL, map[string]string{
  60753. "project": c.project,
  60754. "zone": c.zone,
  60755. "nodeGroup": c.nodeGroup,
  60756. })
  60757. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60758. }
  60759. // Do executes the "compute.nodeGroups.delete" call.
  60760. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60761. // status code is an error. Response headers are in either
  60762. // *Operation.ServerResponse.Header or (if a response was returned at
  60763. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60764. // to check whether the returned error was because
  60765. // http.StatusNotModified was returned.
  60766. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60767. gensupport.SetOptions(c.urlParams_, opts...)
  60768. res, err := c.doRequest("json")
  60769. if res != nil && res.StatusCode == http.StatusNotModified {
  60770. if res.Body != nil {
  60771. res.Body.Close()
  60772. }
  60773. return nil, &googleapi.Error{
  60774. Code: res.StatusCode,
  60775. Header: res.Header,
  60776. }
  60777. }
  60778. if err != nil {
  60779. return nil, err
  60780. }
  60781. defer googleapi.CloseBody(res)
  60782. if err := googleapi.CheckResponse(res); err != nil {
  60783. return nil, err
  60784. }
  60785. ret := &Operation{
  60786. ServerResponse: googleapi.ServerResponse{
  60787. Header: res.Header,
  60788. HTTPStatusCode: res.StatusCode,
  60789. },
  60790. }
  60791. target := &ret
  60792. if err := gensupport.DecodeResponse(target, res); err != nil {
  60793. return nil, err
  60794. }
  60795. return ret, nil
  60796. // {
  60797. // "description": "Deletes the specified NodeGroup resource.",
  60798. // "httpMethod": "DELETE",
  60799. // "id": "compute.nodeGroups.delete",
  60800. // "parameterOrder": [
  60801. // "project",
  60802. // "zone",
  60803. // "nodeGroup"
  60804. // ],
  60805. // "parameters": {
  60806. // "nodeGroup": {
  60807. // "description": "Name of the NodeGroup resource to delete.",
  60808. // "location": "path",
  60809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60810. // "required": true,
  60811. // "type": "string"
  60812. // },
  60813. // "project": {
  60814. // "description": "Project ID for this request.",
  60815. // "location": "path",
  60816. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60817. // "required": true,
  60818. // "type": "string"
  60819. // },
  60820. // "requestId": {
  60821. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60822. // "location": "query",
  60823. // "type": "string"
  60824. // },
  60825. // "zone": {
  60826. // "description": "The name of the zone for this request.",
  60827. // "location": "path",
  60828. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60829. // "required": true,
  60830. // "type": "string"
  60831. // }
  60832. // },
  60833. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  60834. // "response": {
  60835. // "$ref": "Operation"
  60836. // },
  60837. // "scopes": [
  60838. // "https://www.googleapis.com/auth/cloud-platform",
  60839. // "https://www.googleapis.com/auth/compute"
  60840. // ]
  60841. // }
  60842. }
  60843. // method id "compute.nodeGroups.deleteNodes":
  60844. type NodeGroupsDeleteNodesCall struct {
  60845. s *Service
  60846. project string
  60847. zone string
  60848. nodeGroup string
  60849. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  60850. urlParams_ gensupport.URLParams
  60851. ctx_ context.Context
  60852. header_ http.Header
  60853. }
  60854. // DeleteNodes: Deletes specified nodes from the node group.
  60855. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  60856. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60857. c.project = project
  60858. c.zone = zone
  60859. c.nodeGroup = nodeGroup
  60860. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  60861. return c
  60862. }
  60863. // RequestId sets the optional parameter "requestId": An optional
  60864. // request ID to identify requests. Specify a unique request ID so that
  60865. // if you must retry your request, the server will know to ignore the
  60866. // request if it has already been completed.
  60867. //
  60868. // For example, consider a situation where you make an initial request
  60869. // and the request times out. If you make the request again with the
  60870. // same request ID, the server can check if original operation with the
  60871. // same request ID was received, and if so, will ignore the second
  60872. // request. This prevents clients from accidentally creating duplicate
  60873. // commitments.
  60874. //
  60875. // The request ID must be a valid UUID with the exception that zero UUID
  60876. // is not supported (00000000-0000-0000-0000-000000000000).
  60877. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  60878. c.urlParams_.Set("requestId", requestId)
  60879. return c
  60880. }
  60881. // Fields allows partial responses to be retrieved. See
  60882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60883. // for more information.
  60884. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  60885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60886. return c
  60887. }
  60888. // Context sets the context to be used in this call's Do method. Any
  60889. // pending HTTP request will be aborted if the provided context is
  60890. // canceled.
  60891. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  60892. c.ctx_ = ctx
  60893. return c
  60894. }
  60895. // Header returns an http.Header that can be modified by the caller to
  60896. // add HTTP headers to the request.
  60897. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  60898. if c.header_ == nil {
  60899. c.header_ = make(http.Header)
  60900. }
  60901. return c.header_
  60902. }
  60903. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  60904. reqHeaders := make(http.Header)
  60905. for k, v := range c.header_ {
  60906. reqHeaders[k] = v
  60907. }
  60908. reqHeaders.Set("User-Agent", c.s.userAgent())
  60909. var body io.Reader = nil
  60910. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  60911. if err != nil {
  60912. return nil, err
  60913. }
  60914. reqHeaders.Set("Content-Type", "application/json")
  60915. c.urlParams_.Set("alt", alt)
  60916. c.urlParams_.Set("prettyPrint", "false")
  60917. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  60918. urls += "?" + c.urlParams_.Encode()
  60919. req, err := http.NewRequest("POST", urls, body)
  60920. if err != nil {
  60921. return nil, err
  60922. }
  60923. req.Header = reqHeaders
  60924. googleapi.Expand(req.URL, map[string]string{
  60925. "project": c.project,
  60926. "zone": c.zone,
  60927. "nodeGroup": c.nodeGroup,
  60928. })
  60929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60930. }
  60931. // Do executes the "compute.nodeGroups.deleteNodes" call.
  60932. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60933. // status code is an error. Response headers are in either
  60934. // *Operation.ServerResponse.Header or (if a response was returned at
  60935. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60936. // to check whether the returned error was because
  60937. // http.StatusNotModified was returned.
  60938. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60939. gensupport.SetOptions(c.urlParams_, opts...)
  60940. res, err := c.doRequest("json")
  60941. if res != nil && res.StatusCode == http.StatusNotModified {
  60942. if res.Body != nil {
  60943. res.Body.Close()
  60944. }
  60945. return nil, &googleapi.Error{
  60946. Code: res.StatusCode,
  60947. Header: res.Header,
  60948. }
  60949. }
  60950. if err != nil {
  60951. return nil, err
  60952. }
  60953. defer googleapi.CloseBody(res)
  60954. if err := googleapi.CheckResponse(res); err != nil {
  60955. return nil, err
  60956. }
  60957. ret := &Operation{
  60958. ServerResponse: googleapi.ServerResponse{
  60959. Header: res.Header,
  60960. HTTPStatusCode: res.StatusCode,
  60961. },
  60962. }
  60963. target := &ret
  60964. if err := gensupport.DecodeResponse(target, res); err != nil {
  60965. return nil, err
  60966. }
  60967. return ret, nil
  60968. // {
  60969. // "description": "Deletes specified nodes from the node group.",
  60970. // "httpMethod": "POST",
  60971. // "id": "compute.nodeGroups.deleteNodes",
  60972. // "parameterOrder": [
  60973. // "project",
  60974. // "zone",
  60975. // "nodeGroup"
  60976. // ],
  60977. // "parameters": {
  60978. // "nodeGroup": {
  60979. // "description": "Name of the NodeGroup resource to delete.",
  60980. // "location": "path",
  60981. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60982. // "required": true,
  60983. // "type": "string"
  60984. // },
  60985. // "project": {
  60986. // "description": "Project ID for this request.",
  60987. // "location": "path",
  60988. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60989. // "required": true,
  60990. // "type": "string"
  60991. // },
  60992. // "requestId": {
  60993. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60994. // "location": "query",
  60995. // "type": "string"
  60996. // },
  60997. // "zone": {
  60998. // "description": "The name of the zone for this request.",
  60999. // "location": "path",
  61000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61001. // "required": true,
  61002. // "type": "string"
  61003. // }
  61004. // },
  61005. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  61006. // "request": {
  61007. // "$ref": "NodeGroupsDeleteNodesRequest"
  61008. // },
  61009. // "response": {
  61010. // "$ref": "Operation"
  61011. // },
  61012. // "scopes": [
  61013. // "https://www.googleapis.com/auth/cloud-platform",
  61014. // "https://www.googleapis.com/auth/compute"
  61015. // ]
  61016. // }
  61017. }
  61018. // method id "compute.nodeGroups.get":
  61019. type NodeGroupsGetCall struct {
  61020. s *Service
  61021. project string
  61022. zone string
  61023. nodeGroup string
  61024. urlParams_ gensupport.URLParams
  61025. ifNoneMatch_ string
  61026. ctx_ context.Context
  61027. header_ http.Header
  61028. }
  61029. // Get: Returns the specified NodeGroup. Get a list of available
  61030. // NodeGroups by making a list() request. Note: the "nodes" field should
  61031. // not be used. Use nodeGroups.listNodes instead.
  61032. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  61033. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61034. c.project = project
  61035. c.zone = zone
  61036. c.nodeGroup = nodeGroup
  61037. return c
  61038. }
  61039. // Fields allows partial responses to be retrieved. See
  61040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61041. // for more information.
  61042. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  61043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61044. return c
  61045. }
  61046. // IfNoneMatch sets the optional parameter which makes the operation
  61047. // fail if the object's ETag matches the given value. This is useful for
  61048. // getting updates only after the object has changed since the last
  61049. // request. Use googleapi.IsNotModified to check whether the response
  61050. // error from Do is the result of In-None-Match.
  61051. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  61052. c.ifNoneMatch_ = entityTag
  61053. return c
  61054. }
  61055. // Context sets the context to be used in this call's Do method. Any
  61056. // pending HTTP request will be aborted if the provided context is
  61057. // canceled.
  61058. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  61059. c.ctx_ = ctx
  61060. return c
  61061. }
  61062. // Header returns an http.Header that can be modified by the caller to
  61063. // add HTTP headers to the request.
  61064. func (c *NodeGroupsGetCall) Header() http.Header {
  61065. if c.header_ == nil {
  61066. c.header_ = make(http.Header)
  61067. }
  61068. return c.header_
  61069. }
  61070. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  61071. reqHeaders := make(http.Header)
  61072. for k, v := range c.header_ {
  61073. reqHeaders[k] = v
  61074. }
  61075. reqHeaders.Set("User-Agent", c.s.userAgent())
  61076. if c.ifNoneMatch_ != "" {
  61077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61078. }
  61079. var body io.Reader = nil
  61080. c.urlParams_.Set("alt", alt)
  61081. c.urlParams_.Set("prettyPrint", "false")
  61082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  61083. urls += "?" + c.urlParams_.Encode()
  61084. req, err := http.NewRequest("GET", urls, body)
  61085. if err != nil {
  61086. return nil, err
  61087. }
  61088. req.Header = reqHeaders
  61089. googleapi.Expand(req.URL, map[string]string{
  61090. "project": c.project,
  61091. "zone": c.zone,
  61092. "nodeGroup": c.nodeGroup,
  61093. })
  61094. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61095. }
  61096. // Do executes the "compute.nodeGroups.get" call.
  61097. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  61098. // status code is an error. Response headers are in either
  61099. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  61100. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61101. // to check whether the returned error was because
  61102. // http.StatusNotModified was returned.
  61103. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  61104. gensupport.SetOptions(c.urlParams_, opts...)
  61105. res, err := c.doRequest("json")
  61106. if res != nil && res.StatusCode == http.StatusNotModified {
  61107. if res.Body != nil {
  61108. res.Body.Close()
  61109. }
  61110. return nil, &googleapi.Error{
  61111. Code: res.StatusCode,
  61112. Header: res.Header,
  61113. }
  61114. }
  61115. if err != nil {
  61116. return nil, err
  61117. }
  61118. defer googleapi.CloseBody(res)
  61119. if err := googleapi.CheckResponse(res); err != nil {
  61120. return nil, err
  61121. }
  61122. ret := &NodeGroup{
  61123. ServerResponse: googleapi.ServerResponse{
  61124. Header: res.Header,
  61125. HTTPStatusCode: res.StatusCode,
  61126. },
  61127. }
  61128. target := &ret
  61129. if err := gensupport.DecodeResponse(target, res); err != nil {
  61130. return nil, err
  61131. }
  61132. return ret, nil
  61133. // {
  61134. // "description": "Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the \"nodes\" field should not be used. Use nodeGroups.listNodes instead.",
  61135. // "httpMethod": "GET",
  61136. // "id": "compute.nodeGroups.get",
  61137. // "parameterOrder": [
  61138. // "project",
  61139. // "zone",
  61140. // "nodeGroup"
  61141. // ],
  61142. // "parameters": {
  61143. // "nodeGroup": {
  61144. // "description": "Name of the node group to return.",
  61145. // "location": "path",
  61146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61147. // "required": true,
  61148. // "type": "string"
  61149. // },
  61150. // "project": {
  61151. // "description": "Project ID for this request.",
  61152. // "location": "path",
  61153. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61154. // "required": true,
  61155. // "type": "string"
  61156. // },
  61157. // "zone": {
  61158. // "description": "The name of the zone for this request.",
  61159. // "location": "path",
  61160. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61161. // "required": true,
  61162. // "type": "string"
  61163. // }
  61164. // },
  61165. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  61166. // "response": {
  61167. // "$ref": "NodeGroup"
  61168. // },
  61169. // "scopes": [
  61170. // "https://www.googleapis.com/auth/cloud-platform",
  61171. // "https://www.googleapis.com/auth/compute",
  61172. // "https://www.googleapis.com/auth/compute.readonly"
  61173. // ]
  61174. // }
  61175. }
  61176. // method id "compute.nodeGroups.getIamPolicy":
  61177. type NodeGroupsGetIamPolicyCall struct {
  61178. s *Service
  61179. project string
  61180. zone string
  61181. resource string
  61182. urlParams_ gensupport.URLParams
  61183. ifNoneMatch_ string
  61184. ctx_ context.Context
  61185. header_ http.Header
  61186. }
  61187. // GetIamPolicy: Gets the access control policy for a resource. May be
  61188. // empty if no such policy or resource exists.
  61189. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  61190. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61191. c.project = project
  61192. c.zone = zone
  61193. c.resource = resource
  61194. return c
  61195. }
  61196. // Fields allows partial responses to be retrieved. See
  61197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61198. // for more information.
  61199. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  61200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61201. return c
  61202. }
  61203. // IfNoneMatch sets the optional parameter which makes the operation
  61204. // fail if the object's ETag matches the given value. This is useful for
  61205. // getting updates only after the object has changed since the last
  61206. // request. Use googleapi.IsNotModified to check whether the response
  61207. // error from Do is the result of In-None-Match.
  61208. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  61209. c.ifNoneMatch_ = entityTag
  61210. return c
  61211. }
  61212. // Context sets the context to be used in this call's Do method. Any
  61213. // pending HTTP request will be aborted if the provided context is
  61214. // canceled.
  61215. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  61216. c.ctx_ = ctx
  61217. return c
  61218. }
  61219. // Header returns an http.Header that can be modified by the caller to
  61220. // add HTTP headers to the request.
  61221. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  61222. if c.header_ == nil {
  61223. c.header_ = make(http.Header)
  61224. }
  61225. return c.header_
  61226. }
  61227. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  61228. reqHeaders := make(http.Header)
  61229. for k, v := range c.header_ {
  61230. reqHeaders[k] = v
  61231. }
  61232. reqHeaders.Set("User-Agent", c.s.userAgent())
  61233. if c.ifNoneMatch_ != "" {
  61234. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61235. }
  61236. var body io.Reader = nil
  61237. c.urlParams_.Set("alt", alt)
  61238. c.urlParams_.Set("prettyPrint", "false")
  61239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  61240. urls += "?" + c.urlParams_.Encode()
  61241. req, err := http.NewRequest("GET", urls, body)
  61242. if err != nil {
  61243. return nil, err
  61244. }
  61245. req.Header = reqHeaders
  61246. googleapi.Expand(req.URL, map[string]string{
  61247. "project": c.project,
  61248. "zone": c.zone,
  61249. "resource": c.resource,
  61250. })
  61251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61252. }
  61253. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  61254. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  61255. // code is an error. Response headers are in either
  61256. // *Policy.ServerResponse.Header or (if a response was returned at all)
  61257. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61258. // check whether the returned error was because http.StatusNotModified
  61259. // was returned.
  61260. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  61261. gensupport.SetOptions(c.urlParams_, opts...)
  61262. res, err := c.doRequest("json")
  61263. if res != nil && res.StatusCode == http.StatusNotModified {
  61264. if res.Body != nil {
  61265. res.Body.Close()
  61266. }
  61267. return nil, &googleapi.Error{
  61268. Code: res.StatusCode,
  61269. Header: res.Header,
  61270. }
  61271. }
  61272. if err != nil {
  61273. return nil, err
  61274. }
  61275. defer googleapi.CloseBody(res)
  61276. if err := googleapi.CheckResponse(res); err != nil {
  61277. return nil, err
  61278. }
  61279. ret := &Policy{
  61280. ServerResponse: googleapi.ServerResponse{
  61281. Header: res.Header,
  61282. HTTPStatusCode: res.StatusCode,
  61283. },
  61284. }
  61285. target := &ret
  61286. if err := gensupport.DecodeResponse(target, res); err != nil {
  61287. return nil, err
  61288. }
  61289. return ret, nil
  61290. // {
  61291. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  61292. // "httpMethod": "GET",
  61293. // "id": "compute.nodeGroups.getIamPolicy",
  61294. // "parameterOrder": [
  61295. // "project",
  61296. // "zone",
  61297. // "resource"
  61298. // ],
  61299. // "parameters": {
  61300. // "project": {
  61301. // "description": "Project ID for this request.",
  61302. // "location": "path",
  61303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61304. // "required": true,
  61305. // "type": "string"
  61306. // },
  61307. // "resource": {
  61308. // "description": "Name or id of the resource for this request.",
  61309. // "location": "path",
  61310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61311. // "required": true,
  61312. // "type": "string"
  61313. // },
  61314. // "zone": {
  61315. // "description": "The name of the zone for this request.",
  61316. // "location": "path",
  61317. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61318. // "required": true,
  61319. // "type": "string"
  61320. // }
  61321. // },
  61322. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  61323. // "response": {
  61324. // "$ref": "Policy"
  61325. // },
  61326. // "scopes": [
  61327. // "https://www.googleapis.com/auth/cloud-platform",
  61328. // "https://www.googleapis.com/auth/compute",
  61329. // "https://www.googleapis.com/auth/compute.readonly"
  61330. // ]
  61331. // }
  61332. }
  61333. // method id "compute.nodeGroups.insert":
  61334. type NodeGroupsInsertCall struct {
  61335. s *Service
  61336. project string
  61337. zone string
  61338. nodegroup *NodeGroup
  61339. urlParams_ gensupport.URLParams
  61340. ctx_ context.Context
  61341. header_ http.Header
  61342. }
  61343. // Insert: Creates a NodeGroup resource in the specified project using
  61344. // the data included in the request.
  61345. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  61346. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61347. c.project = project
  61348. c.zone = zone
  61349. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  61350. c.nodegroup = nodegroup
  61351. return c
  61352. }
  61353. // RequestId sets the optional parameter "requestId": An optional
  61354. // request ID to identify requests. Specify a unique request ID so that
  61355. // if you must retry your request, the server will know to ignore the
  61356. // request if it has already been completed.
  61357. //
  61358. // For example, consider a situation where you make an initial request
  61359. // and the request times out. If you make the request again with the
  61360. // same request ID, the server can check if original operation with the
  61361. // same request ID was received, and if so, will ignore the second
  61362. // request. This prevents clients from accidentally creating duplicate
  61363. // commitments.
  61364. //
  61365. // The request ID must be a valid UUID with the exception that zero UUID
  61366. // is not supported (00000000-0000-0000-0000-000000000000).
  61367. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  61368. c.urlParams_.Set("requestId", requestId)
  61369. return c
  61370. }
  61371. // Fields allows partial responses to be retrieved. See
  61372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61373. // for more information.
  61374. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  61375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61376. return c
  61377. }
  61378. // Context sets the context to be used in this call's Do method. Any
  61379. // pending HTTP request will be aborted if the provided context is
  61380. // canceled.
  61381. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  61382. c.ctx_ = ctx
  61383. return c
  61384. }
  61385. // Header returns an http.Header that can be modified by the caller to
  61386. // add HTTP headers to the request.
  61387. func (c *NodeGroupsInsertCall) Header() http.Header {
  61388. if c.header_ == nil {
  61389. c.header_ = make(http.Header)
  61390. }
  61391. return c.header_
  61392. }
  61393. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  61394. reqHeaders := make(http.Header)
  61395. for k, v := range c.header_ {
  61396. reqHeaders[k] = v
  61397. }
  61398. reqHeaders.Set("User-Agent", c.s.userAgent())
  61399. var body io.Reader = nil
  61400. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  61401. if err != nil {
  61402. return nil, err
  61403. }
  61404. reqHeaders.Set("Content-Type", "application/json")
  61405. c.urlParams_.Set("alt", alt)
  61406. c.urlParams_.Set("prettyPrint", "false")
  61407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  61408. urls += "?" + c.urlParams_.Encode()
  61409. req, err := http.NewRequest("POST", urls, body)
  61410. if err != nil {
  61411. return nil, err
  61412. }
  61413. req.Header = reqHeaders
  61414. googleapi.Expand(req.URL, map[string]string{
  61415. "project": c.project,
  61416. "zone": c.zone,
  61417. })
  61418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61419. }
  61420. // Do executes the "compute.nodeGroups.insert" call.
  61421. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61422. // status code is an error. Response headers are in either
  61423. // *Operation.ServerResponse.Header or (if a response was returned at
  61424. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61425. // to check whether the returned error was because
  61426. // http.StatusNotModified was returned.
  61427. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61428. gensupport.SetOptions(c.urlParams_, opts...)
  61429. res, err := c.doRequest("json")
  61430. if res != nil && res.StatusCode == http.StatusNotModified {
  61431. if res.Body != nil {
  61432. res.Body.Close()
  61433. }
  61434. return nil, &googleapi.Error{
  61435. Code: res.StatusCode,
  61436. Header: res.Header,
  61437. }
  61438. }
  61439. if err != nil {
  61440. return nil, err
  61441. }
  61442. defer googleapi.CloseBody(res)
  61443. if err := googleapi.CheckResponse(res); err != nil {
  61444. return nil, err
  61445. }
  61446. ret := &Operation{
  61447. ServerResponse: googleapi.ServerResponse{
  61448. Header: res.Header,
  61449. HTTPStatusCode: res.StatusCode,
  61450. },
  61451. }
  61452. target := &ret
  61453. if err := gensupport.DecodeResponse(target, res); err != nil {
  61454. return nil, err
  61455. }
  61456. return ret, nil
  61457. // {
  61458. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  61459. // "httpMethod": "POST",
  61460. // "id": "compute.nodeGroups.insert",
  61461. // "parameterOrder": [
  61462. // "project",
  61463. // "zone",
  61464. // "initialNodeCount"
  61465. // ],
  61466. // "parameters": {
  61467. // "initialNodeCount": {
  61468. // "description": "Initial count of nodes in the node group.",
  61469. // "format": "int32",
  61470. // "location": "query",
  61471. // "required": true,
  61472. // "type": "integer"
  61473. // },
  61474. // "project": {
  61475. // "description": "Project ID for this request.",
  61476. // "location": "path",
  61477. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61478. // "required": true,
  61479. // "type": "string"
  61480. // },
  61481. // "requestId": {
  61482. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61483. // "location": "query",
  61484. // "type": "string"
  61485. // },
  61486. // "zone": {
  61487. // "description": "The name of the zone for this request.",
  61488. // "location": "path",
  61489. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61490. // "required": true,
  61491. // "type": "string"
  61492. // }
  61493. // },
  61494. // "path": "{project}/zones/{zone}/nodeGroups",
  61495. // "request": {
  61496. // "$ref": "NodeGroup"
  61497. // },
  61498. // "response": {
  61499. // "$ref": "Operation"
  61500. // },
  61501. // "scopes": [
  61502. // "https://www.googleapis.com/auth/cloud-platform",
  61503. // "https://www.googleapis.com/auth/compute"
  61504. // ]
  61505. // }
  61506. }
  61507. // method id "compute.nodeGroups.list":
  61508. type NodeGroupsListCall struct {
  61509. s *Service
  61510. project string
  61511. zone string
  61512. urlParams_ gensupport.URLParams
  61513. ifNoneMatch_ string
  61514. ctx_ context.Context
  61515. header_ http.Header
  61516. }
  61517. // List: Retrieves a list of node groups available to the specified
  61518. // project. Note: use nodeGroups.listNodes for more details about each
  61519. // group.
  61520. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  61521. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61522. c.project = project
  61523. c.zone = zone
  61524. return c
  61525. }
  61526. // Filter sets the optional parameter "filter": A filter expression that
  61527. // filters resources listed in the response. The expression must specify
  61528. // the field name, a comparison operator, and the value that you want to
  61529. // use for filtering. The value must be a string, a number, or a
  61530. // boolean. The comparison operator must be either =, !=, >, or <.
  61531. //
  61532. // For example, if you are filtering Compute Engine instances, you can
  61533. // exclude instances named example-instance by specifying name !=
  61534. // example-instance.
  61535. //
  61536. // You can also filter nested fields. For example, you could specify
  61537. // scheduling.automaticRestart = false to include instances only if they
  61538. // are not scheduled for automatic restarts. You can use filtering on
  61539. // nested fields to filter based on resource labels.
  61540. //
  61541. // To filter on multiple expressions, provide each separate expression
  61542. // within parentheses. For example, (scheduling.automaticRestart = true)
  61543. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61544. // AND expression. However, you can include AND and OR expressions
  61545. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61546. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61547. // true).
  61548. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  61549. c.urlParams_.Set("filter", filter)
  61550. return c
  61551. }
  61552. // MaxResults sets the optional parameter "maxResults": The maximum
  61553. // number of results per page that should be returned. If the number of
  61554. // available results is larger than maxResults, Compute Engine returns a
  61555. // nextPageToken that can be used to get the next page of results in
  61556. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61557. // (Default: 500)
  61558. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  61559. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61560. return c
  61561. }
  61562. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61563. // a certain order. By default, results are returned in alphanumerical
  61564. // order based on the resource name.
  61565. //
  61566. // You can also sort results in descending order based on the creation
  61567. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61568. // based on the creationTimestamp field in reverse chronological order
  61569. // (newest result first). Use this to sort resources like operations so
  61570. // that the newest operation is returned first.
  61571. //
  61572. // Currently, only sorting by name or creationTimestamp desc is
  61573. // supported.
  61574. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  61575. c.urlParams_.Set("orderBy", orderBy)
  61576. return c
  61577. }
  61578. // PageToken sets the optional parameter "pageToken": Specifies a page
  61579. // token to use. Set pageToken to the nextPageToken returned by a
  61580. // previous list request to get the next page of results.
  61581. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  61582. c.urlParams_.Set("pageToken", pageToken)
  61583. return c
  61584. }
  61585. // Fields allows partial responses to be retrieved. See
  61586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61587. // for more information.
  61588. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  61589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61590. return c
  61591. }
  61592. // IfNoneMatch sets the optional parameter which makes the operation
  61593. // fail if the object's ETag matches the given value. This is useful for
  61594. // getting updates only after the object has changed since the last
  61595. // request. Use googleapi.IsNotModified to check whether the response
  61596. // error from Do is the result of In-None-Match.
  61597. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  61598. c.ifNoneMatch_ = entityTag
  61599. return c
  61600. }
  61601. // Context sets the context to be used in this call's Do method. Any
  61602. // pending HTTP request will be aborted if the provided context is
  61603. // canceled.
  61604. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  61605. c.ctx_ = ctx
  61606. return c
  61607. }
  61608. // Header returns an http.Header that can be modified by the caller to
  61609. // add HTTP headers to the request.
  61610. func (c *NodeGroupsListCall) Header() http.Header {
  61611. if c.header_ == nil {
  61612. c.header_ = make(http.Header)
  61613. }
  61614. return c.header_
  61615. }
  61616. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  61617. reqHeaders := make(http.Header)
  61618. for k, v := range c.header_ {
  61619. reqHeaders[k] = v
  61620. }
  61621. reqHeaders.Set("User-Agent", c.s.userAgent())
  61622. if c.ifNoneMatch_ != "" {
  61623. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61624. }
  61625. var body io.Reader = nil
  61626. c.urlParams_.Set("alt", alt)
  61627. c.urlParams_.Set("prettyPrint", "false")
  61628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  61629. urls += "?" + c.urlParams_.Encode()
  61630. req, err := http.NewRequest("GET", urls, body)
  61631. if err != nil {
  61632. return nil, err
  61633. }
  61634. req.Header = reqHeaders
  61635. googleapi.Expand(req.URL, map[string]string{
  61636. "project": c.project,
  61637. "zone": c.zone,
  61638. })
  61639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61640. }
  61641. // Do executes the "compute.nodeGroups.list" call.
  61642. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  61643. // status code is an error. Response headers are in either
  61644. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  61645. // at all) in error.(*googleapi.Error).Header. Use
  61646. // googleapi.IsNotModified to check whether the returned error was
  61647. // because http.StatusNotModified was returned.
  61648. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  61649. gensupport.SetOptions(c.urlParams_, opts...)
  61650. res, err := c.doRequest("json")
  61651. if res != nil && res.StatusCode == http.StatusNotModified {
  61652. if res.Body != nil {
  61653. res.Body.Close()
  61654. }
  61655. return nil, &googleapi.Error{
  61656. Code: res.StatusCode,
  61657. Header: res.Header,
  61658. }
  61659. }
  61660. if err != nil {
  61661. return nil, err
  61662. }
  61663. defer googleapi.CloseBody(res)
  61664. if err := googleapi.CheckResponse(res); err != nil {
  61665. return nil, err
  61666. }
  61667. ret := &NodeGroupList{
  61668. ServerResponse: googleapi.ServerResponse{
  61669. Header: res.Header,
  61670. HTTPStatusCode: res.StatusCode,
  61671. },
  61672. }
  61673. target := &ret
  61674. if err := gensupport.DecodeResponse(target, res); err != nil {
  61675. return nil, err
  61676. }
  61677. return ret, nil
  61678. // {
  61679. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  61680. // "httpMethod": "GET",
  61681. // "id": "compute.nodeGroups.list",
  61682. // "parameterOrder": [
  61683. // "project",
  61684. // "zone"
  61685. // ],
  61686. // "parameters": {
  61687. // "filter": {
  61688. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  61689. // "location": "query",
  61690. // "type": "string"
  61691. // },
  61692. // "maxResults": {
  61693. // "default": "500",
  61694. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  61695. // "format": "uint32",
  61696. // "location": "query",
  61697. // "minimum": "0",
  61698. // "type": "integer"
  61699. // },
  61700. // "orderBy": {
  61701. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  61702. // "location": "query",
  61703. // "type": "string"
  61704. // },
  61705. // "pageToken": {
  61706. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  61707. // "location": "query",
  61708. // "type": "string"
  61709. // },
  61710. // "project": {
  61711. // "description": "Project ID for this request.",
  61712. // "location": "path",
  61713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61714. // "required": true,
  61715. // "type": "string"
  61716. // },
  61717. // "zone": {
  61718. // "description": "The name of the zone for this request.",
  61719. // "location": "path",
  61720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61721. // "required": true,
  61722. // "type": "string"
  61723. // }
  61724. // },
  61725. // "path": "{project}/zones/{zone}/nodeGroups",
  61726. // "response": {
  61727. // "$ref": "NodeGroupList"
  61728. // },
  61729. // "scopes": [
  61730. // "https://www.googleapis.com/auth/cloud-platform",
  61731. // "https://www.googleapis.com/auth/compute",
  61732. // "https://www.googleapis.com/auth/compute.readonly"
  61733. // ]
  61734. // }
  61735. }
  61736. // Pages invokes f for each page of results.
  61737. // A non-nil error returned from f will halt the iteration.
  61738. // The provided context supersedes any context provided to the Context method.
  61739. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  61740. c.ctx_ = ctx
  61741. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61742. for {
  61743. x, err := c.Do()
  61744. if err != nil {
  61745. return err
  61746. }
  61747. if err := f(x); err != nil {
  61748. return err
  61749. }
  61750. if x.NextPageToken == "" {
  61751. return nil
  61752. }
  61753. c.PageToken(x.NextPageToken)
  61754. }
  61755. }
  61756. // method id "compute.nodeGroups.listNodes":
  61757. type NodeGroupsListNodesCall struct {
  61758. s *Service
  61759. project string
  61760. zone string
  61761. nodeGroup string
  61762. urlParams_ gensupport.URLParams
  61763. ctx_ context.Context
  61764. header_ http.Header
  61765. }
  61766. // ListNodes: Lists nodes in the node group.
  61767. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  61768. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61769. c.project = project
  61770. c.zone = zone
  61771. c.nodeGroup = nodeGroup
  61772. return c
  61773. }
  61774. // Filter sets the optional parameter "filter": A filter expression that
  61775. // filters resources listed in the response. The expression must specify
  61776. // the field name, a comparison operator, and the value that you want to
  61777. // use for filtering. The value must be a string, a number, or a
  61778. // boolean. The comparison operator must be either =, !=, >, or <.
  61779. //
  61780. // For example, if you are filtering Compute Engine instances, you can
  61781. // exclude instances named example-instance by specifying name !=
  61782. // example-instance.
  61783. //
  61784. // You can also filter nested fields. For example, you could specify
  61785. // scheduling.automaticRestart = false to include instances only if they
  61786. // are not scheduled for automatic restarts. You can use filtering on
  61787. // nested fields to filter based on resource labels.
  61788. //
  61789. // To filter on multiple expressions, provide each separate expression
  61790. // within parentheses. For example, (scheduling.automaticRestart = true)
  61791. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61792. // AND expression. However, you can include AND and OR expressions
  61793. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61794. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61795. // true).
  61796. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  61797. c.urlParams_.Set("filter", filter)
  61798. return c
  61799. }
  61800. // MaxResults sets the optional parameter "maxResults": The maximum
  61801. // number of results per page that should be returned. If the number of
  61802. // available results is larger than maxResults, Compute Engine returns a
  61803. // nextPageToken that can be used to get the next page of results in
  61804. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61805. // (Default: 500)
  61806. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  61807. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61808. return c
  61809. }
  61810. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61811. // a certain order. By default, results are returned in alphanumerical
  61812. // order based on the resource name.
  61813. //
  61814. // You can also sort results in descending order based on the creation
  61815. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61816. // based on the creationTimestamp field in reverse chronological order
  61817. // (newest result first). Use this to sort resources like operations so
  61818. // that the newest operation is returned first.
  61819. //
  61820. // Currently, only sorting by name or creationTimestamp desc is
  61821. // supported.
  61822. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  61823. c.urlParams_.Set("orderBy", orderBy)
  61824. return c
  61825. }
  61826. // PageToken sets the optional parameter "pageToken": Specifies a page
  61827. // token to use. Set pageToken to the nextPageToken returned by a
  61828. // previous list request to get the next page of results.
  61829. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  61830. c.urlParams_.Set("pageToken", pageToken)
  61831. return c
  61832. }
  61833. // Fields allows partial responses to be retrieved. See
  61834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61835. // for more information.
  61836. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  61837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61838. return c
  61839. }
  61840. // Context sets the context to be used in this call's Do method. Any
  61841. // pending HTTP request will be aborted if the provided context is
  61842. // canceled.
  61843. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  61844. c.ctx_ = ctx
  61845. return c
  61846. }
  61847. // Header returns an http.Header that can be modified by the caller to
  61848. // add HTTP headers to the request.
  61849. func (c *NodeGroupsListNodesCall) Header() http.Header {
  61850. if c.header_ == nil {
  61851. c.header_ = make(http.Header)
  61852. }
  61853. return c.header_
  61854. }
  61855. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  61856. reqHeaders := make(http.Header)
  61857. for k, v := range c.header_ {
  61858. reqHeaders[k] = v
  61859. }
  61860. reqHeaders.Set("User-Agent", c.s.userAgent())
  61861. var body io.Reader = nil
  61862. c.urlParams_.Set("alt", alt)
  61863. c.urlParams_.Set("prettyPrint", "false")
  61864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  61865. urls += "?" + c.urlParams_.Encode()
  61866. req, err := http.NewRequest("POST", urls, body)
  61867. if err != nil {
  61868. return nil, err
  61869. }
  61870. req.Header = reqHeaders
  61871. googleapi.Expand(req.URL, map[string]string{
  61872. "project": c.project,
  61873. "zone": c.zone,
  61874. "nodeGroup": c.nodeGroup,
  61875. })
  61876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61877. }
  61878. // Do executes the "compute.nodeGroups.listNodes" call.
  61879. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  61880. // non-2xx status code is an error. Response headers are in either
  61881. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  61882. // returned at all) in error.(*googleapi.Error).Header. Use
  61883. // googleapi.IsNotModified to check whether the returned error was
  61884. // because http.StatusNotModified was returned.
  61885. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  61886. gensupport.SetOptions(c.urlParams_, opts...)
  61887. res, err := c.doRequest("json")
  61888. if res != nil && res.StatusCode == http.StatusNotModified {
  61889. if res.Body != nil {
  61890. res.Body.Close()
  61891. }
  61892. return nil, &googleapi.Error{
  61893. Code: res.StatusCode,
  61894. Header: res.Header,
  61895. }
  61896. }
  61897. if err != nil {
  61898. return nil, err
  61899. }
  61900. defer googleapi.CloseBody(res)
  61901. if err := googleapi.CheckResponse(res); err != nil {
  61902. return nil, err
  61903. }
  61904. ret := &NodeGroupsListNodes{
  61905. ServerResponse: googleapi.ServerResponse{
  61906. Header: res.Header,
  61907. HTTPStatusCode: res.StatusCode,
  61908. },
  61909. }
  61910. target := &ret
  61911. if err := gensupport.DecodeResponse(target, res); err != nil {
  61912. return nil, err
  61913. }
  61914. return ret, nil
  61915. // {
  61916. // "description": "Lists nodes in the node group.",
  61917. // "httpMethod": "POST",
  61918. // "id": "compute.nodeGroups.listNodes",
  61919. // "parameterOrder": [
  61920. // "project",
  61921. // "zone",
  61922. // "nodeGroup"
  61923. // ],
  61924. // "parameters": {
  61925. // "filter": {
  61926. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  61927. // "location": "query",
  61928. // "type": "string"
  61929. // },
  61930. // "maxResults": {
  61931. // "default": "500",
  61932. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  61933. // "format": "uint32",
  61934. // "location": "query",
  61935. // "minimum": "0",
  61936. // "type": "integer"
  61937. // },
  61938. // "nodeGroup": {
  61939. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  61940. // "location": "path",
  61941. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61942. // "required": true,
  61943. // "type": "string"
  61944. // },
  61945. // "orderBy": {
  61946. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  61947. // "location": "query",
  61948. // "type": "string"
  61949. // },
  61950. // "pageToken": {
  61951. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  61952. // "location": "query",
  61953. // "type": "string"
  61954. // },
  61955. // "project": {
  61956. // "description": "Project ID for this request.",
  61957. // "location": "path",
  61958. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61959. // "required": true,
  61960. // "type": "string"
  61961. // },
  61962. // "zone": {
  61963. // "description": "The name of the zone for this request.",
  61964. // "location": "path",
  61965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61966. // "required": true,
  61967. // "type": "string"
  61968. // }
  61969. // },
  61970. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  61971. // "response": {
  61972. // "$ref": "NodeGroupsListNodes"
  61973. // },
  61974. // "scopes": [
  61975. // "https://www.googleapis.com/auth/cloud-platform",
  61976. // "https://www.googleapis.com/auth/compute",
  61977. // "https://www.googleapis.com/auth/compute.readonly"
  61978. // ]
  61979. // }
  61980. }
  61981. // Pages invokes f for each page of results.
  61982. // A non-nil error returned from f will halt the iteration.
  61983. // The provided context supersedes any context provided to the Context method.
  61984. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  61985. c.ctx_ = ctx
  61986. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61987. for {
  61988. x, err := c.Do()
  61989. if err != nil {
  61990. return err
  61991. }
  61992. if err := f(x); err != nil {
  61993. return err
  61994. }
  61995. if x.NextPageToken == "" {
  61996. return nil
  61997. }
  61998. c.PageToken(x.NextPageToken)
  61999. }
  62000. }
  62001. // method id "compute.nodeGroups.setIamPolicy":
  62002. type NodeGroupsSetIamPolicyCall struct {
  62003. s *Service
  62004. project string
  62005. zone string
  62006. resource string
  62007. zonesetpolicyrequest *ZoneSetPolicyRequest
  62008. urlParams_ gensupport.URLParams
  62009. ctx_ context.Context
  62010. header_ http.Header
  62011. }
  62012. // SetIamPolicy: Sets the access control policy on the specified
  62013. // resource. Replaces any existing policy.
  62014. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  62015. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62016. c.project = project
  62017. c.zone = zone
  62018. c.resource = resource
  62019. c.zonesetpolicyrequest = zonesetpolicyrequest
  62020. return c
  62021. }
  62022. // Fields allows partial responses to be retrieved. See
  62023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62024. // for more information.
  62025. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  62026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62027. return c
  62028. }
  62029. // Context sets the context to be used in this call's Do method. Any
  62030. // pending HTTP request will be aborted if the provided context is
  62031. // canceled.
  62032. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  62033. c.ctx_ = ctx
  62034. return c
  62035. }
  62036. // Header returns an http.Header that can be modified by the caller to
  62037. // add HTTP headers to the request.
  62038. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  62039. if c.header_ == nil {
  62040. c.header_ = make(http.Header)
  62041. }
  62042. return c.header_
  62043. }
  62044. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  62045. reqHeaders := make(http.Header)
  62046. for k, v := range c.header_ {
  62047. reqHeaders[k] = v
  62048. }
  62049. reqHeaders.Set("User-Agent", c.s.userAgent())
  62050. var body io.Reader = nil
  62051. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  62052. if err != nil {
  62053. return nil, err
  62054. }
  62055. reqHeaders.Set("Content-Type", "application/json")
  62056. c.urlParams_.Set("alt", alt)
  62057. c.urlParams_.Set("prettyPrint", "false")
  62058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  62059. urls += "?" + c.urlParams_.Encode()
  62060. req, err := http.NewRequest("POST", urls, body)
  62061. if err != nil {
  62062. return nil, err
  62063. }
  62064. req.Header = reqHeaders
  62065. googleapi.Expand(req.URL, map[string]string{
  62066. "project": c.project,
  62067. "zone": c.zone,
  62068. "resource": c.resource,
  62069. })
  62070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62071. }
  62072. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  62073. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  62074. // code is an error. Response headers are in either
  62075. // *Policy.ServerResponse.Header or (if a response was returned at all)
  62076. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  62077. // check whether the returned error was because http.StatusNotModified
  62078. // was returned.
  62079. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  62080. gensupport.SetOptions(c.urlParams_, opts...)
  62081. res, err := c.doRequest("json")
  62082. if res != nil && res.StatusCode == http.StatusNotModified {
  62083. if res.Body != nil {
  62084. res.Body.Close()
  62085. }
  62086. return nil, &googleapi.Error{
  62087. Code: res.StatusCode,
  62088. Header: res.Header,
  62089. }
  62090. }
  62091. if err != nil {
  62092. return nil, err
  62093. }
  62094. defer googleapi.CloseBody(res)
  62095. if err := googleapi.CheckResponse(res); err != nil {
  62096. return nil, err
  62097. }
  62098. ret := &Policy{
  62099. ServerResponse: googleapi.ServerResponse{
  62100. Header: res.Header,
  62101. HTTPStatusCode: res.StatusCode,
  62102. },
  62103. }
  62104. target := &ret
  62105. if err := gensupport.DecodeResponse(target, res); err != nil {
  62106. return nil, err
  62107. }
  62108. return ret, nil
  62109. // {
  62110. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  62111. // "httpMethod": "POST",
  62112. // "id": "compute.nodeGroups.setIamPolicy",
  62113. // "parameterOrder": [
  62114. // "project",
  62115. // "zone",
  62116. // "resource"
  62117. // ],
  62118. // "parameters": {
  62119. // "project": {
  62120. // "description": "Project ID for this request.",
  62121. // "location": "path",
  62122. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62123. // "required": true,
  62124. // "type": "string"
  62125. // },
  62126. // "resource": {
  62127. // "description": "Name or id of the resource for this request.",
  62128. // "location": "path",
  62129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62130. // "required": true,
  62131. // "type": "string"
  62132. // },
  62133. // "zone": {
  62134. // "description": "The name of the zone for this request.",
  62135. // "location": "path",
  62136. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62137. // "required": true,
  62138. // "type": "string"
  62139. // }
  62140. // },
  62141. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  62142. // "request": {
  62143. // "$ref": "ZoneSetPolicyRequest"
  62144. // },
  62145. // "response": {
  62146. // "$ref": "Policy"
  62147. // },
  62148. // "scopes": [
  62149. // "https://www.googleapis.com/auth/cloud-platform",
  62150. // "https://www.googleapis.com/auth/compute"
  62151. // ]
  62152. // }
  62153. }
  62154. // method id "compute.nodeGroups.setNodeTemplate":
  62155. type NodeGroupsSetNodeTemplateCall struct {
  62156. s *Service
  62157. project string
  62158. zone string
  62159. nodeGroup string
  62160. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  62161. urlParams_ gensupport.URLParams
  62162. ctx_ context.Context
  62163. header_ http.Header
  62164. }
  62165. // SetNodeTemplate: Updates the node template of the node group.
  62166. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  62167. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62168. c.project = project
  62169. c.zone = zone
  62170. c.nodeGroup = nodeGroup
  62171. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  62172. return c
  62173. }
  62174. // RequestId sets the optional parameter "requestId": An optional
  62175. // request ID to identify requests. Specify a unique request ID so that
  62176. // if you must retry your request, the server will know to ignore the
  62177. // request if it has already been completed.
  62178. //
  62179. // For example, consider a situation where you make an initial request
  62180. // and the request times out. If you make the request again with the
  62181. // same request ID, the server can check if original operation with the
  62182. // same request ID was received, and if so, will ignore the second
  62183. // request. This prevents clients from accidentally creating duplicate
  62184. // commitments.
  62185. //
  62186. // The request ID must be a valid UUID with the exception that zero UUID
  62187. // is not supported (00000000-0000-0000-0000-000000000000).
  62188. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  62189. c.urlParams_.Set("requestId", requestId)
  62190. return c
  62191. }
  62192. // Fields allows partial responses to be retrieved. See
  62193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62194. // for more information.
  62195. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  62196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62197. return c
  62198. }
  62199. // Context sets the context to be used in this call's Do method. Any
  62200. // pending HTTP request will be aborted if the provided context is
  62201. // canceled.
  62202. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  62203. c.ctx_ = ctx
  62204. return c
  62205. }
  62206. // Header returns an http.Header that can be modified by the caller to
  62207. // add HTTP headers to the request.
  62208. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  62209. if c.header_ == nil {
  62210. c.header_ = make(http.Header)
  62211. }
  62212. return c.header_
  62213. }
  62214. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  62215. reqHeaders := make(http.Header)
  62216. for k, v := range c.header_ {
  62217. reqHeaders[k] = v
  62218. }
  62219. reqHeaders.Set("User-Agent", c.s.userAgent())
  62220. var body io.Reader = nil
  62221. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  62222. if err != nil {
  62223. return nil, err
  62224. }
  62225. reqHeaders.Set("Content-Type", "application/json")
  62226. c.urlParams_.Set("alt", alt)
  62227. c.urlParams_.Set("prettyPrint", "false")
  62228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  62229. urls += "?" + c.urlParams_.Encode()
  62230. req, err := http.NewRequest("POST", urls, body)
  62231. if err != nil {
  62232. return nil, err
  62233. }
  62234. req.Header = reqHeaders
  62235. googleapi.Expand(req.URL, map[string]string{
  62236. "project": c.project,
  62237. "zone": c.zone,
  62238. "nodeGroup": c.nodeGroup,
  62239. })
  62240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62241. }
  62242. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  62243. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62244. // status code is an error. Response headers are in either
  62245. // *Operation.ServerResponse.Header or (if a response was returned at
  62246. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62247. // to check whether the returned error was because
  62248. // http.StatusNotModified was returned.
  62249. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62250. gensupport.SetOptions(c.urlParams_, opts...)
  62251. res, err := c.doRequest("json")
  62252. if res != nil && res.StatusCode == http.StatusNotModified {
  62253. if res.Body != nil {
  62254. res.Body.Close()
  62255. }
  62256. return nil, &googleapi.Error{
  62257. Code: res.StatusCode,
  62258. Header: res.Header,
  62259. }
  62260. }
  62261. if err != nil {
  62262. return nil, err
  62263. }
  62264. defer googleapi.CloseBody(res)
  62265. if err := googleapi.CheckResponse(res); err != nil {
  62266. return nil, err
  62267. }
  62268. ret := &Operation{
  62269. ServerResponse: googleapi.ServerResponse{
  62270. Header: res.Header,
  62271. HTTPStatusCode: res.StatusCode,
  62272. },
  62273. }
  62274. target := &ret
  62275. if err := gensupport.DecodeResponse(target, res); err != nil {
  62276. return nil, err
  62277. }
  62278. return ret, nil
  62279. // {
  62280. // "description": "Updates the node template of the node group.",
  62281. // "httpMethod": "POST",
  62282. // "id": "compute.nodeGroups.setNodeTemplate",
  62283. // "parameterOrder": [
  62284. // "project",
  62285. // "zone",
  62286. // "nodeGroup"
  62287. // ],
  62288. // "parameters": {
  62289. // "nodeGroup": {
  62290. // "description": "Name of the NodeGroup resource to delete.",
  62291. // "location": "path",
  62292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62293. // "required": true,
  62294. // "type": "string"
  62295. // },
  62296. // "project": {
  62297. // "description": "Project ID for this request.",
  62298. // "location": "path",
  62299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62300. // "required": true,
  62301. // "type": "string"
  62302. // },
  62303. // "requestId": {
  62304. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62305. // "location": "query",
  62306. // "type": "string"
  62307. // },
  62308. // "zone": {
  62309. // "description": "The name of the zone for this request.",
  62310. // "location": "path",
  62311. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62312. // "required": true,
  62313. // "type": "string"
  62314. // }
  62315. // },
  62316. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  62317. // "request": {
  62318. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  62319. // },
  62320. // "response": {
  62321. // "$ref": "Operation"
  62322. // },
  62323. // "scopes": [
  62324. // "https://www.googleapis.com/auth/cloud-platform",
  62325. // "https://www.googleapis.com/auth/compute"
  62326. // ]
  62327. // }
  62328. }
  62329. // method id "compute.nodeGroups.testIamPermissions":
  62330. type NodeGroupsTestIamPermissionsCall struct {
  62331. s *Service
  62332. project string
  62333. zone string
  62334. resource string
  62335. testpermissionsrequest *TestPermissionsRequest
  62336. urlParams_ gensupport.URLParams
  62337. ctx_ context.Context
  62338. header_ http.Header
  62339. }
  62340. // TestIamPermissions: Returns permissions that a caller has on the
  62341. // specified resource.
  62342. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  62343. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62344. c.project = project
  62345. c.zone = zone
  62346. c.resource = resource
  62347. c.testpermissionsrequest = testpermissionsrequest
  62348. return c
  62349. }
  62350. // Fields allows partial responses to be retrieved. See
  62351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62352. // for more information.
  62353. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  62354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62355. return c
  62356. }
  62357. // Context sets the context to be used in this call's Do method. Any
  62358. // pending HTTP request will be aborted if the provided context is
  62359. // canceled.
  62360. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  62361. c.ctx_ = ctx
  62362. return c
  62363. }
  62364. // Header returns an http.Header that can be modified by the caller to
  62365. // add HTTP headers to the request.
  62366. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  62367. if c.header_ == nil {
  62368. c.header_ = make(http.Header)
  62369. }
  62370. return c.header_
  62371. }
  62372. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  62373. reqHeaders := make(http.Header)
  62374. for k, v := range c.header_ {
  62375. reqHeaders[k] = v
  62376. }
  62377. reqHeaders.Set("User-Agent", c.s.userAgent())
  62378. var body io.Reader = nil
  62379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  62380. if err != nil {
  62381. return nil, err
  62382. }
  62383. reqHeaders.Set("Content-Type", "application/json")
  62384. c.urlParams_.Set("alt", alt)
  62385. c.urlParams_.Set("prettyPrint", "false")
  62386. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  62387. urls += "?" + c.urlParams_.Encode()
  62388. req, err := http.NewRequest("POST", urls, body)
  62389. if err != nil {
  62390. return nil, err
  62391. }
  62392. req.Header = reqHeaders
  62393. googleapi.Expand(req.URL, map[string]string{
  62394. "project": c.project,
  62395. "zone": c.zone,
  62396. "resource": c.resource,
  62397. })
  62398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62399. }
  62400. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  62401. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  62402. // non-2xx status code is an error. Response headers are in either
  62403. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  62404. // returned at all) in error.(*googleapi.Error).Header. Use
  62405. // googleapi.IsNotModified to check whether the returned error was
  62406. // because http.StatusNotModified was returned.
  62407. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  62408. gensupport.SetOptions(c.urlParams_, opts...)
  62409. res, err := c.doRequest("json")
  62410. if res != nil && res.StatusCode == http.StatusNotModified {
  62411. if res.Body != nil {
  62412. res.Body.Close()
  62413. }
  62414. return nil, &googleapi.Error{
  62415. Code: res.StatusCode,
  62416. Header: res.Header,
  62417. }
  62418. }
  62419. if err != nil {
  62420. return nil, err
  62421. }
  62422. defer googleapi.CloseBody(res)
  62423. if err := googleapi.CheckResponse(res); err != nil {
  62424. return nil, err
  62425. }
  62426. ret := &TestPermissionsResponse{
  62427. ServerResponse: googleapi.ServerResponse{
  62428. Header: res.Header,
  62429. HTTPStatusCode: res.StatusCode,
  62430. },
  62431. }
  62432. target := &ret
  62433. if err := gensupport.DecodeResponse(target, res); err != nil {
  62434. return nil, err
  62435. }
  62436. return ret, nil
  62437. // {
  62438. // "description": "Returns permissions that a caller has on the specified resource.",
  62439. // "httpMethod": "POST",
  62440. // "id": "compute.nodeGroups.testIamPermissions",
  62441. // "parameterOrder": [
  62442. // "project",
  62443. // "zone",
  62444. // "resource"
  62445. // ],
  62446. // "parameters": {
  62447. // "project": {
  62448. // "description": "Project ID for this request.",
  62449. // "location": "path",
  62450. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62451. // "required": true,
  62452. // "type": "string"
  62453. // },
  62454. // "resource": {
  62455. // "description": "Name or id of the resource for this request.",
  62456. // "location": "path",
  62457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62458. // "required": true,
  62459. // "type": "string"
  62460. // },
  62461. // "zone": {
  62462. // "description": "The name of the zone for this request.",
  62463. // "location": "path",
  62464. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62465. // "required": true,
  62466. // "type": "string"
  62467. // }
  62468. // },
  62469. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  62470. // "request": {
  62471. // "$ref": "TestPermissionsRequest"
  62472. // },
  62473. // "response": {
  62474. // "$ref": "TestPermissionsResponse"
  62475. // },
  62476. // "scopes": [
  62477. // "https://www.googleapis.com/auth/cloud-platform",
  62478. // "https://www.googleapis.com/auth/compute",
  62479. // "https://www.googleapis.com/auth/compute.readonly"
  62480. // ]
  62481. // }
  62482. }
  62483. // method id "compute.nodeTemplates.aggregatedList":
  62484. type NodeTemplatesAggregatedListCall struct {
  62485. s *Service
  62486. project string
  62487. urlParams_ gensupport.URLParams
  62488. ifNoneMatch_ string
  62489. ctx_ context.Context
  62490. header_ http.Header
  62491. }
  62492. // AggregatedList: Retrieves an aggregated list of node templates.
  62493. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  62494. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62495. c.project = project
  62496. return c
  62497. }
  62498. // Filter sets the optional parameter "filter": A filter expression that
  62499. // filters resources listed in the response. The expression must specify
  62500. // the field name, a comparison operator, and the value that you want to
  62501. // use for filtering. The value must be a string, a number, or a
  62502. // boolean. The comparison operator must be either =, !=, >, or <.
  62503. //
  62504. // For example, if you are filtering Compute Engine instances, you can
  62505. // exclude instances named example-instance by specifying name !=
  62506. // example-instance.
  62507. //
  62508. // You can also filter nested fields. For example, you could specify
  62509. // scheduling.automaticRestart = false to include instances only if they
  62510. // are not scheduled for automatic restarts. You can use filtering on
  62511. // nested fields to filter based on resource labels.
  62512. //
  62513. // To filter on multiple expressions, provide each separate expression
  62514. // within parentheses. For example, (scheduling.automaticRestart = true)
  62515. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62516. // AND expression. However, you can include AND and OR expressions
  62517. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62518. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62519. // true).
  62520. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  62521. c.urlParams_.Set("filter", filter)
  62522. return c
  62523. }
  62524. // MaxResults sets the optional parameter "maxResults": The maximum
  62525. // number of results per page that should be returned. If the number of
  62526. // available results is larger than maxResults, Compute Engine returns a
  62527. // nextPageToken that can be used to get the next page of results in
  62528. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62529. // (Default: 500)
  62530. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  62531. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62532. return c
  62533. }
  62534. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62535. // a certain order. By default, results are returned in alphanumerical
  62536. // order based on the resource name.
  62537. //
  62538. // You can also sort results in descending order based on the creation
  62539. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62540. // based on the creationTimestamp field in reverse chronological order
  62541. // (newest result first). Use this to sort resources like operations so
  62542. // that the newest operation is returned first.
  62543. //
  62544. // Currently, only sorting by name or creationTimestamp desc is
  62545. // supported.
  62546. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  62547. c.urlParams_.Set("orderBy", orderBy)
  62548. return c
  62549. }
  62550. // PageToken sets the optional parameter "pageToken": Specifies a page
  62551. // token to use. Set pageToken to the nextPageToken returned by a
  62552. // previous list request to get the next page of results.
  62553. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  62554. c.urlParams_.Set("pageToken", pageToken)
  62555. return c
  62556. }
  62557. // Fields allows partial responses to be retrieved. See
  62558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62559. // for more information.
  62560. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  62561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62562. return c
  62563. }
  62564. // IfNoneMatch sets the optional parameter which makes the operation
  62565. // fail if the object's ETag matches the given value. This is useful for
  62566. // getting updates only after the object has changed since the last
  62567. // request. Use googleapi.IsNotModified to check whether the response
  62568. // error from Do is the result of In-None-Match.
  62569. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  62570. c.ifNoneMatch_ = entityTag
  62571. return c
  62572. }
  62573. // Context sets the context to be used in this call's Do method. Any
  62574. // pending HTTP request will be aborted if the provided context is
  62575. // canceled.
  62576. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  62577. c.ctx_ = ctx
  62578. return c
  62579. }
  62580. // Header returns an http.Header that can be modified by the caller to
  62581. // add HTTP headers to the request.
  62582. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  62583. if c.header_ == nil {
  62584. c.header_ = make(http.Header)
  62585. }
  62586. return c.header_
  62587. }
  62588. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  62589. reqHeaders := make(http.Header)
  62590. for k, v := range c.header_ {
  62591. reqHeaders[k] = v
  62592. }
  62593. reqHeaders.Set("User-Agent", c.s.userAgent())
  62594. if c.ifNoneMatch_ != "" {
  62595. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62596. }
  62597. var body io.Reader = nil
  62598. c.urlParams_.Set("alt", alt)
  62599. c.urlParams_.Set("prettyPrint", "false")
  62600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  62601. urls += "?" + c.urlParams_.Encode()
  62602. req, err := http.NewRequest("GET", urls, body)
  62603. if err != nil {
  62604. return nil, err
  62605. }
  62606. req.Header = reqHeaders
  62607. googleapi.Expand(req.URL, map[string]string{
  62608. "project": c.project,
  62609. })
  62610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62611. }
  62612. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  62613. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  62614. // Any non-2xx status code is an error. Response headers are in either
  62615. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  62616. // was returned at all) in error.(*googleapi.Error).Header. Use
  62617. // googleapi.IsNotModified to check whether the returned error was
  62618. // because http.StatusNotModified was returned.
  62619. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  62620. gensupport.SetOptions(c.urlParams_, opts...)
  62621. res, err := c.doRequest("json")
  62622. if res != nil && res.StatusCode == http.StatusNotModified {
  62623. if res.Body != nil {
  62624. res.Body.Close()
  62625. }
  62626. return nil, &googleapi.Error{
  62627. Code: res.StatusCode,
  62628. Header: res.Header,
  62629. }
  62630. }
  62631. if err != nil {
  62632. return nil, err
  62633. }
  62634. defer googleapi.CloseBody(res)
  62635. if err := googleapi.CheckResponse(res); err != nil {
  62636. return nil, err
  62637. }
  62638. ret := &NodeTemplateAggregatedList{
  62639. ServerResponse: googleapi.ServerResponse{
  62640. Header: res.Header,
  62641. HTTPStatusCode: res.StatusCode,
  62642. },
  62643. }
  62644. target := &ret
  62645. if err := gensupport.DecodeResponse(target, res); err != nil {
  62646. return nil, err
  62647. }
  62648. return ret, nil
  62649. // {
  62650. // "description": "Retrieves an aggregated list of node templates.",
  62651. // "httpMethod": "GET",
  62652. // "id": "compute.nodeTemplates.aggregatedList",
  62653. // "parameterOrder": [
  62654. // "project"
  62655. // ],
  62656. // "parameters": {
  62657. // "filter": {
  62658. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62659. // "location": "query",
  62660. // "type": "string"
  62661. // },
  62662. // "maxResults": {
  62663. // "default": "500",
  62664. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62665. // "format": "uint32",
  62666. // "location": "query",
  62667. // "minimum": "0",
  62668. // "type": "integer"
  62669. // },
  62670. // "orderBy": {
  62671. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62672. // "location": "query",
  62673. // "type": "string"
  62674. // },
  62675. // "pageToken": {
  62676. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62677. // "location": "query",
  62678. // "type": "string"
  62679. // },
  62680. // "project": {
  62681. // "description": "Project ID for this request.",
  62682. // "location": "path",
  62683. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62684. // "required": true,
  62685. // "type": "string"
  62686. // }
  62687. // },
  62688. // "path": "{project}/aggregated/nodeTemplates",
  62689. // "response": {
  62690. // "$ref": "NodeTemplateAggregatedList"
  62691. // },
  62692. // "scopes": [
  62693. // "https://www.googleapis.com/auth/cloud-platform",
  62694. // "https://www.googleapis.com/auth/compute",
  62695. // "https://www.googleapis.com/auth/compute.readonly"
  62696. // ]
  62697. // }
  62698. }
  62699. // Pages invokes f for each page of results.
  62700. // A non-nil error returned from f will halt the iteration.
  62701. // The provided context supersedes any context provided to the Context method.
  62702. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  62703. c.ctx_ = ctx
  62704. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62705. for {
  62706. x, err := c.Do()
  62707. if err != nil {
  62708. return err
  62709. }
  62710. if err := f(x); err != nil {
  62711. return err
  62712. }
  62713. if x.NextPageToken == "" {
  62714. return nil
  62715. }
  62716. c.PageToken(x.NextPageToken)
  62717. }
  62718. }
  62719. // method id "compute.nodeTemplates.delete":
  62720. type NodeTemplatesDeleteCall struct {
  62721. s *Service
  62722. project string
  62723. region string
  62724. nodeTemplate string
  62725. urlParams_ gensupport.URLParams
  62726. ctx_ context.Context
  62727. header_ http.Header
  62728. }
  62729. // Delete: Deletes the specified NodeTemplate resource.
  62730. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  62731. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62732. c.project = project
  62733. c.region = region
  62734. c.nodeTemplate = nodeTemplate
  62735. return c
  62736. }
  62737. // RequestId sets the optional parameter "requestId": An optional
  62738. // request ID to identify requests. Specify a unique request ID so that
  62739. // if you must retry your request, the server will know to ignore the
  62740. // request if it has already been completed.
  62741. //
  62742. // For example, consider a situation where you make an initial request
  62743. // and the request times out. If you make the request again with the
  62744. // same request ID, the server can check if original operation with the
  62745. // same request ID was received, and if so, will ignore the second
  62746. // request. This prevents clients from accidentally creating duplicate
  62747. // commitments.
  62748. //
  62749. // The request ID must be a valid UUID with the exception that zero UUID
  62750. // is not supported (00000000-0000-0000-0000-000000000000).
  62751. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  62752. c.urlParams_.Set("requestId", requestId)
  62753. return c
  62754. }
  62755. // Fields allows partial responses to be retrieved. See
  62756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62757. // for more information.
  62758. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  62759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62760. return c
  62761. }
  62762. // Context sets the context to be used in this call's Do method. Any
  62763. // pending HTTP request will be aborted if the provided context is
  62764. // canceled.
  62765. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  62766. c.ctx_ = ctx
  62767. return c
  62768. }
  62769. // Header returns an http.Header that can be modified by the caller to
  62770. // add HTTP headers to the request.
  62771. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  62772. if c.header_ == nil {
  62773. c.header_ = make(http.Header)
  62774. }
  62775. return c.header_
  62776. }
  62777. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  62778. reqHeaders := make(http.Header)
  62779. for k, v := range c.header_ {
  62780. reqHeaders[k] = v
  62781. }
  62782. reqHeaders.Set("User-Agent", c.s.userAgent())
  62783. var body io.Reader = nil
  62784. c.urlParams_.Set("alt", alt)
  62785. c.urlParams_.Set("prettyPrint", "false")
  62786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  62787. urls += "?" + c.urlParams_.Encode()
  62788. req, err := http.NewRequest("DELETE", urls, body)
  62789. if err != nil {
  62790. return nil, err
  62791. }
  62792. req.Header = reqHeaders
  62793. googleapi.Expand(req.URL, map[string]string{
  62794. "project": c.project,
  62795. "region": c.region,
  62796. "nodeTemplate": c.nodeTemplate,
  62797. })
  62798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62799. }
  62800. // Do executes the "compute.nodeTemplates.delete" call.
  62801. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62802. // status code is an error. Response headers are in either
  62803. // *Operation.ServerResponse.Header or (if a response was returned at
  62804. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62805. // to check whether the returned error was because
  62806. // http.StatusNotModified was returned.
  62807. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62808. gensupport.SetOptions(c.urlParams_, opts...)
  62809. res, err := c.doRequest("json")
  62810. if res != nil && res.StatusCode == http.StatusNotModified {
  62811. if res.Body != nil {
  62812. res.Body.Close()
  62813. }
  62814. return nil, &googleapi.Error{
  62815. Code: res.StatusCode,
  62816. Header: res.Header,
  62817. }
  62818. }
  62819. if err != nil {
  62820. return nil, err
  62821. }
  62822. defer googleapi.CloseBody(res)
  62823. if err := googleapi.CheckResponse(res); err != nil {
  62824. return nil, err
  62825. }
  62826. ret := &Operation{
  62827. ServerResponse: googleapi.ServerResponse{
  62828. Header: res.Header,
  62829. HTTPStatusCode: res.StatusCode,
  62830. },
  62831. }
  62832. target := &ret
  62833. if err := gensupport.DecodeResponse(target, res); err != nil {
  62834. return nil, err
  62835. }
  62836. return ret, nil
  62837. // {
  62838. // "description": "Deletes the specified NodeTemplate resource.",
  62839. // "httpMethod": "DELETE",
  62840. // "id": "compute.nodeTemplates.delete",
  62841. // "parameterOrder": [
  62842. // "project",
  62843. // "region",
  62844. // "nodeTemplate"
  62845. // ],
  62846. // "parameters": {
  62847. // "nodeTemplate": {
  62848. // "description": "Name of the NodeTemplate resource to delete.",
  62849. // "location": "path",
  62850. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62851. // "required": true,
  62852. // "type": "string"
  62853. // },
  62854. // "project": {
  62855. // "description": "Project ID for this request.",
  62856. // "location": "path",
  62857. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62858. // "required": true,
  62859. // "type": "string"
  62860. // },
  62861. // "region": {
  62862. // "description": "The name of the region for this request.",
  62863. // "location": "path",
  62864. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62865. // "required": true,
  62866. // "type": "string"
  62867. // },
  62868. // "requestId": {
  62869. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62870. // "location": "query",
  62871. // "type": "string"
  62872. // }
  62873. // },
  62874. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  62875. // "response": {
  62876. // "$ref": "Operation"
  62877. // },
  62878. // "scopes": [
  62879. // "https://www.googleapis.com/auth/cloud-platform",
  62880. // "https://www.googleapis.com/auth/compute"
  62881. // ]
  62882. // }
  62883. }
  62884. // method id "compute.nodeTemplates.get":
  62885. type NodeTemplatesGetCall struct {
  62886. s *Service
  62887. project string
  62888. region string
  62889. nodeTemplate string
  62890. urlParams_ gensupport.URLParams
  62891. ifNoneMatch_ string
  62892. ctx_ context.Context
  62893. header_ http.Header
  62894. }
  62895. // Get: Returns the specified node template. Gets a list of available
  62896. // node templates by making a list() request.
  62897. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  62898. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62899. c.project = project
  62900. c.region = region
  62901. c.nodeTemplate = nodeTemplate
  62902. return c
  62903. }
  62904. // Fields allows partial responses to be retrieved. See
  62905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62906. // for more information.
  62907. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  62908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62909. return c
  62910. }
  62911. // IfNoneMatch sets the optional parameter which makes the operation
  62912. // fail if the object's ETag matches the given value. This is useful for
  62913. // getting updates only after the object has changed since the last
  62914. // request. Use googleapi.IsNotModified to check whether the response
  62915. // error from Do is the result of In-None-Match.
  62916. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  62917. c.ifNoneMatch_ = entityTag
  62918. return c
  62919. }
  62920. // Context sets the context to be used in this call's Do method. Any
  62921. // pending HTTP request will be aborted if the provided context is
  62922. // canceled.
  62923. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  62924. c.ctx_ = ctx
  62925. return c
  62926. }
  62927. // Header returns an http.Header that can be modified by the caller to
  62928. // add HTTP headers to the request.
  62929. func (c *NodeTemplatesGetCall) Header() http.Header {
  62930. if c.header_ == nil {
  62931. c.header_ = make(http.Header)
  62932. }
  62933. return c.header_
  62934. }
  62935. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  62936. reqHeaders := make(http.Header)
  62937. for k, v := range c.header_ {
  62938. reqHeaders[k] = v
  62939. }
  62940. reqHeaders.Set("User-Agent", c.s.userAgent())
  62941. if c.ifNoneMatch_ != "" {
  62942. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62943. }
  62944. var body io.Reader = nil
  62945. c.urlParams_.Set("alt", alt)
  62946. c.urlParams_.Set("prettyPrint", "false")
  62947. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  62948. urls += "?" + c.urlParams_.Encode()
  62949. req, err := http.NewRequest("GET", urls, body)
  62950. if err != nil {
  62951. return nil, err
  62952. }
  62953. req.Header = reqHeaders
  62954. googleapi.Expand(req.URL, map[string]string{
  62955. "project": c.project,
  62956. "region": c.region,
  62957. "nodeTemplate": c.nodeTemplate,
  62958. })
  62959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62960. }
  62961. // Do executes the "compute.nodeTemplates.get" call.
  62962. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  62963. // status code is an error. Response headers are in either
  62964. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  62965. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62966. // to check whether the returned error was because
  62967. // http.StatusNotModified was returned.
  62968. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  62969. gensupport.SetOptions(c.urlParams_, opts...)
  62970. res, err := c.doRequest("json")
  62971. if res != nil && res.StatusCode == http.StatusNotModified {
  62972. if res.Body != nil {
  62973. res.Body.Close()
  62974. }
  62975. return nil, &googleapi.Error{
  62976. Code: res.StatusCode,
  62977. Header: res.Header,
  62978. }
  62979. }
  62980. if err != nil {
  62981. return nil, err
  62982. }
  62983. defer googleapi.CloseBody(res)
  62984. if err := googleapi.CheckResponse(res); err != nil {
  62985. return nil, err
  62986. }
  62987. ret := &NodeTemplate{
  62988. ServerResponse: googleapi.ServerResponse{
  62989. Header: res.Header,
  62990. HTTPStatusCode: res.StatusCode,
  62991. },
  62992. }
  62993. target := &ret
  62994. if err := gensupport.DecodeResponse(target, res); err != nil {
  62995. return nil, err
  62996. }
  62997. return ret, nil
  62998. // {
  62999. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  63000. // "httpMethod": "GET",
  63001. // "id": "compute.nodeTemplates.get",
  63002. // "parameterOrder": [
  63003. // "project",
  63004. // "region",
  63005. // "nodeTemplate"
  63006. // ],
  63007. // "parameters": {
  63008. // "nodeTemplate": {
  63009. // "description": "Name of the node template to return.",
  63010. // "location": "path",
  63011. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63012. // "required": true,
  63013. // "type": "string"
  63014. // },
  63015. // "project": {
  63016. // "description": "Project ID for this request.",
  63017. // "location": "path",
  63018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63019. // "required": true,
  63020. // "type": "string"
  63021. // },
  63022. // "region": {
  63023. // "description": "The name of the region for this request.",
  63024. // "location": "path",
  63025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63026. // "required": true,
  63027. // "type": "string"
  63028. // }
  63029. // },
  63030. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  63031. // "response": {
  63032. // "$ref": "NodeTemplate"
  63033. // },
  63034. // "scopes": [
  63035. // "https://www.googleapis.com/auth/cloud-platform",
  63036. // "https://www.googleapis.com/auth/compute",
  63037. // "https://www.googleapis.com/auth/compute.readonly"
  63038. // ]
  63039. // }
  63040. }
  63041. // method id "compute.nodeTemplates.getIamPolicy":
  63042. type NodeTemplatesGetIamPolicyCall struct {
  63043. s *Service
  63044. project string
  63045. region string
  63046. resource string
  63047. urlParams_ gensupport.URLParams
  63048. ifNoneMatch_ string
  63049. ctx_ context.Context
  63050. header_ http.Header
  63051. }
  63052. // GetIamPolicy: Gets the access control policy for a resource. May be
  63053. // empty if no such policy or resource exists.
  63054. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  63055. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63056. c.project = project
  63057. c.region = region
  63058. c.resource = resource
  63059. return c
  63060. }
  63061. // Fields allows partial responses to be retrieved. See
  63062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63063. // for more information.
  63064. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  63065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63066. return c
  63067. }
  63068. // IfNoneMatch sets the optional parameter which makes the operation
  63069. // fail if the object's ETag matches the given value. This is useful for
  63070. // getting updates only after the object has changed since the last
  63071. // request. Use googleapi.IsNotModified to check whether the response
  63072. // error from Do is the result of In-None-Match.
  63073. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  63074. c.ifNoneMatch_ = entityTag
  63075. return c
  63076. }
  63077. // Context sets the context to be used in this call's Do method. Any
  63078. // pending HTTP request will be aborted if the provided context is
  63079. // canceled.
  63080. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  63081. c.ctx_ = ctx
  63082. return c
  63083. }
  63084. // Header returns an http.Header that can be modified by the caller to
  63085. // add HTTP headers to the request.
  63086. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  63087. if c.header_ == nil {
  63088. c.header_ = make(http.Header)
  63089. }
  63090. return c.header_
  63091. }
  63092. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  63093. reqHeaders := make(http.Header)
  63094. for k, v := range c.header_ {
  63095. reqHeaders[k] = v
  63096. }
  63097. reqHeaders.Set("User-Agent", c.s.userAgent())
  63098. if c.ifNoneMatch_ != "" {
  63099. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63100. }
  63101. var body io.Reader = nil
  63102. c.urlParams_.Set("alt", alt)
  63103. c.urlParams_.Set("prettyPrint", "false")
  63104. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  63105. urls += "?" + c.urlParams_.Encode()
  63106. req, err := http.NewRequest("GET", urls, body)
  63107. if err != nil {
  63108. return nil, err
  63109. }
  63110. req.Header = reqHeaders
  63111. googleapi.Expand(req.URL, map[string]string{
  63112. "project": c.project,
  63113. "region": c.region,
  63114. "resource": c.resource,
  63115. })
  63116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63117. }
  63118. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  63119. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  63120. // code is an error. Response headers are in either
  63121. // *Policy.ServerResponse.Header or (if a response was returned at all)
  63122. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63123. // check whether the returned error was because http.StatusNotModified
  63124. // was returned.
  63125. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  63126. gensupport.SetOptions(c.urlParams_, opts...)
  63127. res, err := c.doRequest("json")
  63128. if res != nil && res.StatusCode == http.StatusNotModified {
  63129. if res.Body != nil {
  63130. res.Body.Close()
  63131. }
  63132. return nil, &googleapi.Error{
  63133. Code: res.StatusCode,
  63134. Header: res.Header,
  63135. }
  63136. }
  63137. if err != nil {
  63138. return nil, err
  63139. }
  63140. defer googleapi.CloseBody(res)
  63141. if err := googleapi.CheckResponse(res); err != nil {
  63142. return nil, err
  63143. }
  63144. ret := &Policy{
  63145. ServerResponse: googleapi.ServerResponse{
  63146. Header: res.Header,
  63147. HTTPStatusCode: res.StatusCode,
  63148. },
  63149. }
  63150. target := &ret
  63151. if err := gensupport.DecodeResponse(target, res); err != nil {
  63152. return nil, err
  63153. }
  63154. return ret, nil
  63155. // {
  63156. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  63157. // "httpMethod": "GET",
  63158. // "id": "compute.nodeTemplates.getIamPolicy",
  63159. // "parameterOrder": [
  63160. // "project",
  63161. // "region",
  63162. // "resource"
  63163. // ],
  63164. // "parameters": {
  63165. // "project": {
  63166. // "description": "Project ID for this request.",
  63167. // "location": "path",
  63168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63169. // "required": true,
  63170. // "type": "string"
  63171. // },
  63172. // "region": {
  63173. // "description": "The name of the region for this request.",
  63174. // "location": "path",
  63175. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63176. // "required": true,
  63177. // "type": "string"
  63178. // },
  63179. // "resource": {
  63180. // "description": "Name or id of the resource for this request.",
  63181. // "location": "path",
  63182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63183. // "required": true,
  63184. // "type": "string"
  63185. // }
  63186. // },
  63187. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  63188. // "response": {
  63189. // "$ref": "Policy"
  63190. // },
  63191. // "scopes": [
  63192. // "https://www.googleapis.com/auth/cloud-platform",
  63193. // "https://www.googleapis.com/auth/compute",
  63194. // "https://www.googleapis.com/auth/compute.readonly"
  63195. // ]
  63196. // }
  63197. }
  63198. // method id "compute.nodeTemplates.insert":
  63199. type NodeTemplatesInsertCall struct {
  63200. s *Service
  63201. project string
  63202. region string
  63203. nodetemplate *NodeTemplate
  63204. urlParams_ gensupport.URLParams
  63205. ctx_ context.Context
  63206. header_ http.Header
  63207. }
  63208. // Insert: Creates a NodeTemplate resource in the specified project
  63209. // using the data included in the request.
  63210. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  63211. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63212. c.project = project
  63213. c.region = region
  63214. c.nodetemplate = nodetemplate
  63215. return c
  63216. }
  63217. // RequestId sets the optional parameter "requestId": An optional
  63218. // request ID to identify requests. Specify a unique request ID so that
  63219. // if you must retry your request, the server will know to ignore the
  63220. // request if it has already been completed.
  63221. //
  63222. // For example, consider a situation where you make an initial request
  63223. // and the request times out. If you make the request again with the
  63224. // same request ID, the server can check if original operation with the
  63225. // same request ID was received, and if so, will ignore the second
  63226. // request. This prevents clients from accidentally creating duplicate
  63227. // commitments.
  63228. //
  63229. // The request ID must be a valid UUID with the exception that zero UUID
  63230. // is not supported (00000000-0000-0000-0000-000000000000).
  63231. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  63232. c.urlParams_.Set("requestId", requestId)
  63233. return c
  63234. }
  63235. // Fields allows partial responses to be retrieved. See
  63236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63237. // for more information.
  63238. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  63239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63240. return c
  63241. }
  63242. // Context sets the context to be used in this call's Do method. Any
  63243. // pending HTTP request will be aborted if the provided context is
  63244. // canceled.
  63245. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  63246. c.ctx_ = ctx
  63247. return c
  63248. }
  63249. // Header returns an http.Header that can be modified by the caller to
  63250. // add HTTP headers to the request.
  63251. func (c *NodeTemplatesInsertCall) Header() http.Header {
  63252. if c.header_ == nil {
  63253. c.header_ = make(http.Header)
  63254. }
  63255. return c.header_
  63256. }
  63257. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  63258. reqHeaders := make(http.Header)
  63259. for k, v := range c.header_ {
  63260. reqHeaders[k] = v
  63261. }
  63262. reqHeaders.Set("User-Agent", c.s.userAgent())
  63263. var body io.Reader = nil
  63264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  63265. if err != nil {
  63266. return nil, err
  63267. }
  63268. reqHeaders.Set("Content-Type", "application/json")
  63269. c.urlParams_.Set("alt", alt)
  63270. c.urlParams_.Set("prettyPrint", "false")
  63271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  63272. urls += "?" + c.urlParams_.Encode()
  63273. req, err := http.NewRequest("POST", urls, body)
  63274. if err != nil {
  63275. return nil, err
  63276. }
  63277. req.Header = reqHeaders
  63278. googleapi.Expand(req.URL, map[string]string{
  63279. "project": c.project,
  63280. "region": c.region,
  63281. })
  63282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63283. }
  63284. // Do executes the "compute.nodeTemplates.insert" call.
  63285. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63286. // status code is an error. Response headers are in either
  63287. // *Operation.ServerResponse.Header or (if a response was returned at
  63288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63289. // to check whether the returned error was because
  63290. // http.StatusNotModified was returned.
  63291. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63292. gensupport.SetOptions(c.urlParams_, opts...)
  63293. res, err := c.doRequest("json")
  63294. if res != nil && res.StatusCode == http.StatusNotModified {
  63295. if res.Body != nil {
  63296. res.Body.Close()
  63297. }
  63298. return nil, &googleapi.Error{
  63299. Code: res.StatusCode,
  63300. Header: res.Header,
  63301. }
  63302. }
  63303. if err != nil {
  63304. return nil, err
  63305. }
  63306. defer googleapi.CloseBody(res)
  63307. if err := googleapi.CheckResponse(res); err != nil {
  63308. return nil, err
  63309. }
  63310. ret := &Operation{
  63311. ServerResponse: googleapi.ServerResponse{
  63312. Header: res.Header,
  63313. HTTPStatusCode: res.StatusCode,
  63314. },
  63315. }
  63316. target := &ret
  63317. if err := gensupport.DecodeResponse(target, res); err != nil {
  63318. return nil, err
  63319. }
  63320. return ret, nil
  63321. // {
  63322. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  63323. // "httpMethod": "POST",
  63324. // "id": "compute.nodeTemplates.insert",
  63325. // "parameterOrder": [
  63326. // "project",
  63327. // "region"
  63328. // ],
  63329. // "parameters": {
  63330. // "project": {
  63331. // "description": "Project ID for this request.",
  63332. // "location": "path",
  63333. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63334. // "required": true,
  63335. // "type": "string"
  63336. // },
  63337. // "region": {
  63338. // "description": "The name of the region for this request.",
  63339. // "location": "path",
  63340. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63341. // "required": true,
  63342. // "type": "string"
  63343. // },
  63344. // "requestId": {
  63345. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63346. // "location": "query",
  63347. // "type": "string"
  63348. // }
  63349. // },
  63350. // "path": "{project}/regions/{region}/nodeTemplates",
  63351. // "request": {
  63352. // "$ref": "NodeTemplate"
  63353. // },
  63354. // "response": {
  63355. // "$ref": "Operation"
  63356. // },
  63357. // "scopes": [
  63358. // "https://www.googleapis.com/auth/cloud-platform",
  63359. // "https://www.googleapis.com/auth/compute"
  63360. // ]
  63361. // }
  63362. }
  63363. // method id "compute.nodeTemplates.list":
  63364. type NodeTemplatesListCall struct {
  63365. s *Service
  63366. project string
  63367. region string
  63368. urlParams_ gensupport.URLParams
  63369. ifNoneMatch_ string
  63370. ctx_ context.Context
  63371. header_ http.Header
  63372. }
  63373. // List: Retrieves a list of node templates available to the specified
  63374. // project.
  63375. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  63376. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63377. c.project = project
  63378. c.region = region
  63379. return c
  63380. }
  63381. // Filter sets the optional parameter "filter": A filter expression that
  63382. // filters resources listed in the response. The expression must specify
  63383. // the field name, a comparison operator, and the value that you want to
  63384. // use for filtering. The value must be a string, a number, or a
  63385. // boolean. The comparison operator must be either =, !=, >, or <.
  63386. //
  63387. // For example, if you are filtering Compute Engine instances, you can
  63388. // exclude instances named example-instance by specifying name !=
  63389. // example-instance.
  63390. //
  63391. // You can also filter nested fields. For example, you could specify
  63392. // scheduling.automaticRestart = false to include instances only if they
  63393. // are not scheduled for automatic restarts. You can use filtering on
  63394. // nested fields to filter based on resource labels.
  63395. //
  63396. // To filter on multiple expressions, provide each separate expression
  63397. // within parentheses. For example, (scheduling.automaticRestart = true)
  63398. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63399. // AND expression. However, you can include AND and OR expressions
  63400. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63401. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63402. // true).
  63403. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  63404. c.urlParams_.Set("filter", filter)
  63405. return c
  63406. }
  63407. // MaxResults sets the optional parameter "maxResults": The maximum
  63408. // number of results per page that should be returned. If the number of
  63409. // available results is larger than maxResults, Compute Engine returns a
  63410. // nextPageToken that can be used to get the next page of results in
  63411. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63412. // (Default: 500)
  63413. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  63414. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63415. return c
  63416. }
  63417. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63418. // a certain order. By default, results are returned in alphanumerical
  63419. // order based on the resource name.
  63420. //
  63421. // You can also sort results in descending order based on the creation
  63422. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63423. // based on the creationTimestamp field in reverse chronological order
  63424. // (newest result first). Use this to sort resources like operations so
  63425. // that the newest operation is returned first.
  63426. //
  63427. // Currently, only sorting by name or creationTimestamp desc is
  63428. // supported.
  63429. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  63430. c.urlParams_.Set("orderBy", orderBy)
  63431. return c
  63432. }
  63433. // PageToken sets the optional parameter "pageToken": Specifies a page
  63434. // token to use. Set pageToken to the nextPageToken returned by a
  63435. // previous list request to get the next page of results.
  63436. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  63437. c.urlParams_.Set("pageToken", pageToken)
  63438. return c
  63439. }
  63440. // Fields allows partial responses to be retrieved. See
  63441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63442. // for more information.
  63443. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  63444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63445. return c
  63446. }
  63447. // IfNoneMatch sets the optional parameter which makes the operation
  63448. // fail if the object's ETag matches the given value. This is useful for
  63449. // getting updates only after the object has changed since the last
  63450. // request. Use googleapi.IsNotModified to check whether the response
  63451. // error from Do is the result of In-None-Match.
  63452. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  63453. c.ifNoneMatch_ = entityTag
  63454. return c
  63455. }
  63456. // Context sets the context to be used in this call's Do method. Any
  63457. // pending HTTP request will be aborted if the provided context is
  63458. // canceled.
  63459. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  63460. c.ctx_ = ctx
  63461. return c
  63462. }
  63463. // Header returns an http.Header that can be modified by the caller to
  63464. // add HTTP headers to the request.
  63465. func (c *NodeTemplatesListCall) Header() http.Header {
  63466. if c.header_ == nil {
  63467. c.header_ = make(http.Header)
  63468. }
  63469. return c.header_
  63470. }
  63471. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  63472. reqHeaders := make(http.Header)
  63473. for k, v := range c.header_ {
  63474. reqHeaders[k] = v
  63475. }
  63476. reqHeaders.Set("User-Agent", c.s.userAgent())
  63477. if c.ifNoneMatch_ != "" {
  63478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63479. }
  63480. var body io.Reader = nil
  63481. c.urlParams_.Set("alt", alt)
  63482. c.urlParams_.Set("prettyPrint", "false")
  63483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  63484. urls += "?" + c.urlParams_.Encode()
  63485. req, err := http.NewRequest("GET", urls, body)
  63486. if err != nil {
  63487. return nil, err
  63488. }
  63489. req.Header = reqHeaders
  63490. googleapi.Expand(req.URL, map[string]string{
  63491. "project": c.project,
  63492. "region": c.region,
  63493. })
  63494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63495. }
  63496. // Do executes the "compute.nodeTemplates.list" call.
  63497. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  63498. // non-2xx status code is an error. Response headers are in either
  63499. // *NodeTemplateList.ServerResponse.Header or (if a response was
  63500. // returned at all) in error.(*googleapi.Error).Header. Use
  63501. // googleapi.IsNotModified to check whether the returned error was
  63502. // because http.StatusNotModified was returned.
  63503. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  63504. gensupport.SetOptions(c.urlParams_, opts...)
  63505. res, err := c.doRequest("json")
  63506. if res != nil && res.StatusCode == http.StatusNotModified {
  63507. if res.Body != nil {
  63508. res.Body.Close()
  63509. }
  63510. return nil, &googleapi.Error{
  63511. Code: res.StatusCode,
  63512. Header: res.Header,
  63513. }
  63514. }
  63515. if err != nil {
  63516. return nil, err
  63517. }
  63518. defer googleapi.CloseBody(res)
  63519. if err := googleapi.CheckResponse(res); err != nil {
  63520. return nil, err
  63521. }
  63522. ret := &NodeTemplateList{
  63523. ServerResponse: googleapi.ServerResponse{
  63524. Header: res.Header,
  63525. HTTPStatusCode: res.StatusCode,
  63526. },
  63527. }
  63528. target := &ret
  63529. if err := gensupport.DecodeResponse(target, res); err != nil {
  63530. return nil, err
  63531. }
  63532. return ret, nil
  63533. // {
  63534. // "description": "Retrieves a list of node templates available to the specified project.",
  63535. // "httpMethod": "GET",
  63536. // "id": "compute.nodeTemplates.list",
  63537. // "parameterOrder": [
  63538. // "project",
  63539. // "region"
  63540. // ],
  63541. // "parameters": {
  63542. // "filter": {
  63543. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  63544. // "location": "query",
  63545. // "type": "string"
  63546. // },
  63547. // "maxResults": {
  63548. // "default": "500",
  63549. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  63550. // "format": "uint32",
  63551. // "location": "query",
  63552. // "minimum": "0",
  63553. // "type": "integer"
  63554. // },
  63555. // "orderBy": {
  63556. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  63557. // "location": "query",
  63558. // "type": "string"
  63559. // },
  63560. // "pageToken": {
  63561. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  63562. // "location": "query",
  63563. // "type": "string"
  63564. // },
  63565. // "project": {
  63566. // "description": "Project ID for this request.",
  63567. // "location": "path",
  63568. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63569. // "required": true,
  63570. // "type": "string"
  63571. // },
  63572. // "region": {
  63573. // "description": "The name of the region for this request.",
  63574. // "location": "path",
  63575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63576. // "required": true,
  63577. // "type": "string"
  63578. // }
  63579. // },
  63580. // "path": "{project}/regions/{region}/nodeTemplates",
  63581. // "response": {
  63582. // "$ref": "NodeTemplateList"
  63583. // },
  63584. // "scopes": [
  63585. // "https://www.googleapis.com/auth/cloud-platform",
  63586. // "https://www.googleapis.com/auth/compute",
  63587. // "https://www.googleapis.com/auth/compute.readonly"
  63588. // ]
  63589. // }
  63590. }
  63591. // Pages invokes f for each page of results.
  63592. // A non-nil error returned from f will halt the iteration.
  63593. // The provided context supersedes any context provided to the Context method.
  63594. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  63595. c.ctx_ = ctx
  63596. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63597. for {
  63598. x, err := c.Do()
  63599. if err != nil {
  63600. return err
  63601. }
  63602. if err := f(x); err != nil {
  63603. return err
  63604. }
  63605. if x.NextPageToken == "" {
  63606. return nil
  63607. }
  63608. c.PageToken(x.NextPageToken)
  63609. }
  63610. }
  63611. // method id "compute.nodeTemplates.setIamPolicy":
  63612. type NodeTemplatesSetIamPolicyCall struct {
  63613. s *Service
  63614. project string
  63615. region string
  63616. resource string
  63617. regionsetpolicyrequest *RegionSetPolicyRequest
  63618. urlParams_ gensupport.URLParams
  63619. ctx_ context.Context
  63620. header_ http.Header
  63621. }
  63622. // SetIamPolicy: Sets the access control policy on the specified
  63623. // resource. Replaces any existing policy.
  63624. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  63625. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63626. c.project = project
  63627. c.region = region
  63628. c.resource = resource
  63629. c.regionsetpolicyrequest = regionsetpolicyrequest
  63630. return c
  63631. }
  63632. // Fields allows partial responses to be retrieved. See
  63633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63634. // for more information.
  63635. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  63636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63637. return c
  63638. }
  63639. // Context sets the context to be used in this call's Do method. Any
  63640. // pending HTTP request will be aborted if the provided context is
  63641. // canceled.
  63642. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  63643. c.ctx_ = ctx
  63644. return c
  63645. }
  63646. // Header returns an http.Header that can be modified by the caller to
  63647. // add HTTP headers to the request.
  63648. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  63649. if c.header_ == nil {
  63650. c.header_ = make(http.Header)
  63651. }
  63652. return c.header_
  63653. }
  63654. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  63655. reqHeaders := make(http.Header)
  63656. for k, v := range c.header_ {
  63657. reqHeaders[k] = v
  63658. }
  63659. reqHeaders.Set("User-Agent", c.s.userAgent())
  63660. var body io.Reader = nil
  63661. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  63662. if err != nil {
  63663. return nil, err
  63664. }
  63665. reqHeaders.Set("Content-Type", "application/json")
  63666. c.urlParams_.Set("alt", alt)
  63667. c.urlParams_.Set("prettyPrint", "false")
  63668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  63669. urls += "?" + c.urlParams_.Encode()
  63670. req, err := http.NewRequest("POST", urls, body)
  63671. if err != nil {
  63672. return nil, err
  63673. }
  63674. req.Header = reqHeaders
  63675. googleapi.Expand(req.URL, map[string]string{
  63676. "project": c.project,
  63677. "region": c.region,
  63678. "resource": c.resource,
  63679. })
  63680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63681. }
  63682. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  63683. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  63684. // code is an error. Response headers are in either
  63685. // *Policy.ServerResponse.Header or (if a response was returned at all)
  63686. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63687. // check whether the returned error was because http.StatusNotModified
  63688. // was returned.
  63689. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  63690. gensupport.SetOptions(c.urlParams_, opts...)
  63691. res, err := c.doRequest("json")
  63692. if res != nil && res.StatusCode == http.StatusNotModified {
  63693. if res.Body != nil {
  63694. res.Body.Close()
  63695. }
  63696. return nil, &googleapi.Error{
  63697. Code: res.StatusCode,
  63698. Header: res.Header,
  63699. }
  63700. }
  63701. if err != nil {
  63702. return nil, err
  63703. }
  63704. defer googleapi.CloseBody(res)
  63705. if err := googleapi.CheckResponse(res); err != nil {
  63706. return nil, err
  63707. }
  63708. ret := &Policy{
  63709. ServerResponse: googleapi.ServerResponse{
  63710. Header: res.Header,
  63711. HTTPStatusCode: res.StatusCode,
  63712. },
  63713. }
  63714. target := &ret
  63715. if err := gensupport.DecodeResponse(target, res); err != nil {
  63716. return nil, err
  63717. }
  63718. return ret, nil
  63719. // {
  63720. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  63721. // "httpMethod": "POST",
  63722. // "id": "compute.nodeTemplates.setIamPolicy",
  63723. // "parameterOrder": [
  63724. // "project",
  63725. // "region",
  63726. // "resource"
  63727. // ],
  63728. // "parameters": {
  63729. // "project": {
  63730. // "description": "Project ID for this request.",
  63731. // "location": "path",
  63732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63733. // "required": true,
  63734. // "type": "string"
  63735. // },
  63736. // "region": {
  63737. // "description": "The name of the region for this request.",
  63738. // "location": "path",
  63739. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63740. // "required": true,
  63741. // "type": "string"
  63742. // },
  63743. // "resource": {
  63744. // "description": "Name or id of the resource for this request.",
  63745. // "location": "path",
  63746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63747. // "required": true,
  63748. // "type": "string"
  63749. // }
  63750. // },
  63751. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  63752. // "request": {
  63753. // "$ref": "RegionSetPolicyRequest"
  63754. // },
  63755. // "response": {
  63756. // "$ref": "Policy"
  63757. // },
  63758. // "scopes": [
  63759. // "https://www.googleapis.com/auth/cloud-platform",
  63760. // "https://www.googleapis.com/auth/compute"
  63761. // ]
  63762. // }
  63763. }
  63764. // method id "compute.nodeTemplates.testIamPermissions":
  63765. type NodeTemplatesTestIamPermissionsCall struct {
  63766. s *Service
  63767. project string
  63768. region string
  63769. resource string
  63770. testpermissionsrequest *TestPermissionsRequest
  63771. urlParams_ gensupport.URLParams
  63772. ctx_ context.Context
  63773. header_ http.Header
  63774. }
  63775. // TestIamPermissions: Returns permissions that a caller has on the
  63776. // specified resource.
  63777. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  63778. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63779. c.project = project
  63780. c.region = region
  63781. c.resource = resource
  63782. c.testpermissionsrequest = testpermissionsrequest
  63783. return c
  63784. }
  63785. // Fields allows partial responses to be retrieved. See
  63786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63787. // for more information.
  63788. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  63789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63790. return c
  63791. }
  63792. // Context sets the context to be used in this call's Do method. Any
  63793. // pending HTTP request will be aborted if the provided context is
  63794. // canceled.
  63795. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  63796. c.ctx_ = ctx
  63797. return c
  63798. }
  63799. // Header returns an http.Header that can be modified by the caller to
  63800. // add HTTP headers to the request.
  63801. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  63802. if c.header_ == nil {
  63803. c.header_ = make(http.Header)
  63804. }
  63805. return c.header_
  63806. }
  63807. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  63808. reqHeaders := make(http.Header)
  63809. for k, v := range c.header_ {
  63810. reqHeaders[k] = v
  63811. }
  63812. reqHeaders.Set("User-Agent", c.s.userAgent())
  63813. var body io.Reader = nil
  63814. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  63815. if err != nil {
  63816. return nil, err
  63817. }
  63818. reqHeaders.Set("Content-Type", "application/json")
  63819. c.urlParams_.Set("alt", alt)
  63820. c.urlParams_.Set("prettyPrint", "false")
  63821. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  63822. urls += "?" + c.urlParams_.Encode()
  63823. req, err := http.NewRequest("POST", urls, body)
  63824. if err != nil {
  63825. return nil, err
  63826. }
  63827. req.Header = reqHeaders
  63828. googleapi.Expand(req.URL, map[string]string{
  63829. "project": c.project,
  63830. "region": c.region,
  63831. "resource": c.resource,
  63832. })
  63833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63834. }
  63835. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  63836. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  63837. // non-2xx status code is an error. Response headers are in either
  63838. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  63839. // returned at all) in error.(*googleapi.Error).Header. Use
  63840. // googleapi.IsNotModified to check whether the returned error was
  63841. // because http.StatusNotModified was returned.
  63842. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  63843. gensupport.SetOptions(c.urlParams_, opts...)
  63844. res, err := c.doRequest("json")
  63845. if res != nil && res.StatusCode == http.StatusNotModified {
  63846. if res.Body != nil {
  63847. res.Body.Close()
  63848. }
  63849. return nil, &googleapi.Error{
  63850. Code: res.StatusCode,
  63851. Header: res.Header,
  63852. }
  63853. }
  63854. if err != nil {
  63855. return nil, err
  63856. }
  63857. defer googleapi.CloseBody(res)
  63858. if err := googleapi.CheckResponse(res); err != nil {
  63859. return nil, err
  63860. }
  63861. ret := &TestPermissionsResponse{
  63862. ServerResponse: googleapi.ServerResponse{
  63863. Header: res.Header,
  63864. HTTPStatusCode: res.StatusCode,
  63865. },
  63866. }
  63867. target := &ret
  63868. if err := gensupport.DecodeResponse(target, res); err != nil {
  63869. return nil, err
  63870. }
  63871. return ret, nil
  63872. // {
  63873. // "description": "Returns permissions that a caller has on the specified resource.",
  63874. // "httpMethod": "POST",
  63875. // "id": "compute.nodeTemplates.testIamPermissions",
  63876. // "parameterOrder": [
  63877. // "project",
  63878. // "region",
  63879. // "resource"
  63880. // ],
  63881. // "parameters": {
  63882. // "project": {
  63883. // "description": "Project ID for this request.",
  63884. // "location": "path",
  63885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63886. // "required": true,
  63887. // "type": "string"
  63888. // },
  63889. // "region": {
  63890. // "description": "The name of the region for this request.",
  63891. // "location": "path",
  63892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63893. // "required": true,
  63894. // "type": "string"
  63895. // },
  63896. // "resource": {
  63897. // "description": "Name or id of the resource for this request.",
  63898. // "location": "path",
  63899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63900. // "required": true,
  63901. // "type": "string"
  63902. // }
  63903. // },
  63904. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  63905. // "request": {
  63906. // "$ref": "TestPermissionsRequest"
  63907. // },
  63908. // "response": {
  63909. // "$ref": "TestPermissionsResponse"
  63910. // },
  63911. // "scopes": [
  63912. // "https://www.googleapis.com/auth/cloud-platform",
  63913. // "https://www.googleapis.com/auth/compute",
  63914. // "https://www.googleapis.com/auth/compute.readonly"
  63915. // ]
  63916. // }
  63917. }
  63918. // method id "compute.nodeTypes.aggregatedList":
  63919. type NodeTypesAggregatedListCall struct {
  63920. s *Service
  63921. project string
  63922. urlParams_ gensupport.URLParams
  63923. ifNoneMatch_ string
  63924. ctx_ context.Context
  63925. header_ http.Header
  63926. }
  63927. // AggregatedList: Retrieves an aggregated list of node types.
  63928. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  63929. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63930. c.project = project
  63931. return c
  63932. }
  63933. // Filter sets the optional parameter "filter": A filter expression that
  63934. // filters resources listed in the response. The expression must specify
  63935. // the field name, a comparison operator, and the value that you want to
  63936. // use for filtering. The value must be a string, a number, or a
  63937. // boolean. The comparison operator must be either =, !=, >, or <.
  63938. //
  63939. // For example, if you are filtering Compute Engine instances, you can
  63940. // exclude instances named example-instance by specifying name !=
  63941. // example-instance.
  63942. //
  63943. // You can also filter nested fields. For example, you could specify
  63944. // scheduling.automaticRestart = false to include instances only if they
  63945. // are not scheduled for automatic restarts. You can use filtering on
  63946. // nested fields to filter based on resource labels.
  63947. //
  63948. // To filter on multiple expressions, provide each separate expression
  63949. // within parentheses. For example, (scheduling.automaticRestart = true)
  63950. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63951. // AND expression. However, you can include AND and OR expressions
  63952. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63953. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63954. // true).
  63955. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  63956. c.urlParams_.Set("filter", filter)
  63957. return c
  63958. }
  63959. // MaxResults sets the optional parameter "maxResults": The maximum
  63960. // number of results per page that should be returned. If the number of
  63961. // available results is larger than maxResults, Compute Engine returns a
  63962. // nextPageToken that can be used to get the next page of results in
  63963. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63964. // (Default: 500)
  63965. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  63966. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63967. return c
  63968. }
  63969. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63970. // a certain order. By default, results are returned in alphanumerical
  63971. // order based on the resource name.
  63972. //
  63973. // You can also sort results in descending order based on the creation
  63974. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63975. // based on the creationTimestamp field in reverse chronological order
  63976. // (newest result first). Use this to sort resources like operations so
  63977. // that the newest operation is returned first.
  63978. //
  63979. // Currently, only sorting by name or creationTimestamp desc is
  63980. // supported.
  63981. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  63982. c.urlParams_.Set("orderBy", orderBy)
  63983. return c
  63984. }
  63985. // PageToken sets the optional parameter "pageToken": Specifies a page
  63986. // token to use. Set pageToken to the nextPageToken returned by a
  63987. // previous list request to get the next page of results.
  63988. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  63989. c.urlParams_.Set("pageToken", pageToken)
  63990. return c
  63991. }
  63992. // Fields allows partial responses to be retrieved. See
  63993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63994. // for more information.
  63995. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  63996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63997. return c
  63998. }
  63999. // IfNoneMatch sets the optional parameter which makes the operation
  64000. // fail if the object's ETag matches the given value. This is useful for
  64001. // getting updates only after the object has changed since the last
  64002. // request. Use googleapi.IsNotModified to check whether the response
  64003. // error from Do is the result of In-None-Match.
  64004. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  64005. c.ifNoneMatch_ = entityTag
  64006. return c
  64007. }
  64008. // Context sets the context to be used in this call's Do method. Any
  64009. // pending HTTP request will be aborted if the provided context is
  64010. // canceled.
  64011. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  64012. c.ctx_ = ctx
  64013. return c
  64014. }
  64015. // Header returns an http.Header that can be modified by the caller to
  64016. // add HTTP headers to the request.
  64017. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  64018. if c.header_ == nil {
  64019. c.header_ = make(http.Header)
  64020. }
  64021. return c.header_
  64022. }
  64023. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  64024. reqHeaders := make(http.Header)
  64025. for k, v := range c.header_ {
  64026. reqHeaders[k] = v
  64027. }
  64028. reqHeaders.Set("User-Agent", c.s.userAgent())
  64029. if c.ifNoneMatch_ != "" {
  64030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64031. }
  64032. var body io.Reader = nil
  64033. c.urlParams_.Set("alt", alt)
  64034. c.urlParams_.Set("prettyPrint", "false")
  64035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  64036. urls += "?" + c.urlParams_.Encode()
  64037. req, err := http.NewRequest("GET", urls, body)
  64038. if err != nil {
  64039. return nil, err
  64040. }
  64041. req.Header = reqHeaders
  64042. googleapi.Expand(req.URL, map[string]string{
  64043. "project": c.project,
  64044. })
  64045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64046. }
  64047. // Do executes the "compute.nodeTypes.aggregatedList" call.
  64048. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  64049. // non-2xx status code is an error. Response headers are in either
  64050. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  64051. // returned at all) in error.(*googleapi.Error).Header. Use
  64052. // googleapi.IsNotModified to check whether the returned error was
  64053. // because http.StatusNotModified was returned.
  64054. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  64055. gensupport.SetOptions(c.urlParams_, opts...)
  64056. res, err := c.doRequest("json")
  64057. if res != nil && res.StatusCode == http.StatusNotModified {
  64058. if res.Body != nil {
  64059. res.Body.Close()
  64060. }
  64061. return nil, &googleapi.Error{
  64062. Code: res.StatusCode,
  64063. Header: res.Header,
  64064. }
  64065. }
  64066. if err != nil {
  64067. return nil, err
  64068. }
  64069. defer googleapi.CloseBody(res)
  64070. if err := googleapi.CheckResponse(res); err != nil {
  64071. return nil, err
  64072. }
  64073. ret := &NodeTypeAggregatedList{
  64074. ServerResponse: googleapi.ServerResponse{
  64075. Header: res.Header,
  64076. HTTPStatusCode: res.StatusCode,
  64077. },
  64078. }
  64079. target := &ret
  64080. if err := gensupport.DecodeResponse(target, res); err != nil {
  64081. return nil, err
  64082. }
  64083. return ret, nil
  64084. // {
  64085. // "description": "Retrieves an aggregated list of node types.",
  64086. // "httpMethod": "GET",
  64087. // "id": "compute.nodeTypes.aggregatedList",
  64088. // "parameterOrder": [
  64089. // "project"
  64090. // ],
  64091. // "parameters": {
  64092. // "filter": {
  64093. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64094. // "location": "query",
  64095. // "type": "string"
  64096. // },
  64097. // "maxResults": {
  64098. // "default": "500",
  64099. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64100. // "format": "uint32",
  64101. // "location": "query",
  64102. // "minimum": "0",
  64103. // "type": "integer"
  64104. // },
  64105. // "orderBy": {
  64106. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64107. // "location": "query",
  64108. // "type": "string"
  64109. // },
  64110. // "pageToken": {
  64111. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64112. // "location": "query",
  64113. // "type": "string"
  64114. // },
  64115. // "project": {
  64116. // "description": "Project ID for this request.",
  64117. // "location": "path",
  64118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64119. // "required": true,
  64120. // "type": "string"
  64121. // }
  64122. // },
  64123. // "path": "{project}/aggregated/nodeTypes",
  64124. // "response": {
  64125. // "$ref": "NodeTypeAggregatedList"
  64126. // },
  64127. // "scopes": [
  64128. // "https://www.googleapis.com/auth/cloud-platform",
  64129. // "https://www.googleapis.com/auth/compute",
  64130. // "https://www.googleapis.com/auth/compute.readonly"
  64131. // ]
  64132. // }
  64133. }
  64134. // Pages invokes f for each page of results.
  64135. // A non-nil error returned from f will halt the iteration.
  64136. // The provided context supersedes any context provided to the Context method.
  64137. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  64138. c.ctx_ = ctx
  64139. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64140. for {
  64141. x, err := c.Do()
  64142. if err != nil {
  64143. return err
  64144. }
  64145. if err := f(x); err != nil {
  64146. return err
  64147. }
  64148. if x.NextPageToken == "" {
  64149. return nil
  64150. }
  64151. c.PageToken(x.NextPageToken)
  64152. }
  64153. }
  64154. // method id "compute.nodeTypes.get":
  64155. type NodeTypesGetCall struct {
  64156. s *Service
  64157. project string
  64158. zone string
  64159. nodeType string
  64160. urlParams_ gensupport.URLParams
  64161. ifNoneMatch_ string
  64162. ctx_ context.Context
  64163. header_ http.Header
  64164. }
  64165. // Get: Returns the specified node type. Gets a list of available node
  64166. // types by making a list() request.
  64167. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  64168. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64169. c.project = project
  64170. c.zone = zone
  64171. c.nodeType = nodeType
  64172. return c
  64173. }
  64174. // Fields allows partial responses to be retrieved. See
  64175. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64176. // for more information.
  64177. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  64178. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64179. return c
  64180. }
  64181. // IfNoneMatch sets the optional parameter which makes the operation
  64182. // fail if the object's ETag matches the given value. This is useful for
  64183. // getting updates only after the object has changed since the last
  64184. // request. Use googleapi.IsNotModified to check whether the response
  64185. // error from Do is the result of In-None-Match.
  64186. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  64187. c.ifNoneMatch_ = entityTag
  64188. return c
  64189. }
  64190. // Context sets the context to be used in this call's Do method. Any
  64191. // pending HTTP request will be aborted if the provided context is
  64192. // canceled.
  64193. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  64194. c.ctx_ = ctx
  64195. return c
  64196. }
  64197. // Header returns an http.Header that can be modified by the caller to
  64198. // add HTTP headers to the request.
  64199. func (c *NodeTypesGetCall) Header() http.Header {
  64200. if c.header_ == nil {
  64201. c.header_ = make(http.Header)
  64202. }
  64203. return c.header_
  64204. }
  64205. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  64206. reqHeaders := make(http.Header)
  64207. for k, v := range c.header_ {
  64208. reqHeaders[k] = v
  64209. }
  64210. reqHeaders.Set("User-Agent", c.s.userAgent())
  64211. if c.ifNoneMatch_ != "" {
  64212. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64213. }
  64214. var body io.Reader = nil
  64215. c.urlParams_.Set("alt", alt)
  64216. c.urlParams_.Set("prettyPrint", "false")
  64217. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  64218. urls += "?" + c.urlParams_.Encode()
  64219. req, err := http.NewRequest("GET", urls, body)
  64220. if err != nil {
  64221. return nil, err
  64222. }
  64223. req.Header = reqHeaders
  64224. googleapi.Expand(req.URL, map[string]string{
  64225. "project": c.project,
  64226. "zone": c.zone,
  64227. "nodeType": c.nodeType,
  64228. })
  64229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64230. }
  64231. // Do executes the "compute.nodeTypes.get" call.
  64232. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  64233. // code is an error. Response headers are in either
  64234. // *NodeType.ServerResponse.Header or (if a response was returned at
  64235. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64236. // to check whether the returned error was because
  64237. // http.StatusNotModified was returned.
  64238. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  64239. gensupport.SetOptions(c.urlParams_, opts...)
  64240. res, err := c.doRequest("json")
  64241. if res != nil && res.StatusCode == http.StatusNotModified {
  64242. if res.Body != nil {
  64243. res.Body.Close()
  64244. }
  64245. return nil, &googleapi.Error{
  64246. Code: res.StatusCode,
  64247. Header: res.Header,
  64248. }
  64249. }
  64250. if err != nil {
  64251. return nil, err
  64252. }
  64253. defer googleapi.CloseBody(res)
  64254. if err := googleapi.CheckResponse(res); err != nil {
  64255. return nil, err
  64256. }
  64257. ret := &NodeType{
  64258. ServerResponse: googleapi.ServerResponse{
  64259. Header: res.Header,
  64260. HTTPStatusCode: res.StatusCode,
  64261. },
  64262. }
  64263. target := &ret
  64264. if err := gensupport.DecodeResponse(target, res); err != nil {
  64265. return nil, err
  64266. }
  64267. return ret, nil
  64268. // {
  64269. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  64270. // "httpMethod": "GET",
  64271. // "id": "compute.nodeTypes.get",
  64272. // "parameterOrder": [
  64273. // "project",
  64274. // "zone",
  64275. // "nodeType"
  64276. // ],
  64277. // "parameters": {
  64278. // "nodeType": {
  64279. // "description": "Name of the node type to return.",
  64280. // "location": "path",
  64281. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64282. // "required": true,
  64283. // "type": "string"
  64284. // },
  64285. // "project": {
  64286. // "description": "Project ID for this request.",
  64287. // "location": "path",
  64288. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64289. // "required": true,
  64290. // "type": "string"
  64291. // },
  64292. // "zone": {
  64293. // "description": "The name of the zone for this request.",
  64294. // "location": "path",
  64295. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64296. // "required": true,
  64297. // "type": "string"
  64298. // }
  64299. // },
  64300. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  64301. // "response": {
  64302. // "$ref": "NodeType"
  64303. // },
  64304. // "scopes": [
  64305. // "https://www.googleapis.com/auth/cloud-platform",
  64306. // "https://www.googleapis.com/auth/compute",
  64307. // "https://www.googleapis.com/auth/compute.readonly"
  64308. // ]
  64309. // }
  64310. }
  64311. // method id "compute.nodeTypes.list":
  64312. type NodeTypesListCall struct {
  64313. s *Service
  64314. project string
  64315. zone string
  64316. urlParams_ gensupport.URLParams
  64317. ifNoneMatch_ string
  64318. ctx_ context.Context
  64319. header_ http.Header
  64320. }
  64321. // List: Retrieves a list of node types available to the specified
  64322. // project.
  64323. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  64324. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64325. c.project = project
  64326. c.zone = zone
  64327. return c
  64328. }
  64329. // Filter sets the optional parameter "filter": A filter expression that
  64330. // filters resources listed in the response. The expression must specify
  64331. // the field name, a comparison operator, and the value that you want to
  64332. // use for filtering. The value must be a string, a number, or a
  64333. // boolean. The comparison operator must be either =, !=, >, or <.
  64334. //
  64335. // For example, if you are filtering Compute Engine instances, you can
  64336. // exclude instances named example-instance by specifying name !=
  64337. // example-instance.
  64338. //
  64339. // You can also filter nested fields. For example, you could specify
  64340. // scheduling.automaticRestart = false to include instances only if they
  64341. // are not scheduled for automatic restarts. You can use filtering on
  64342. // nested fields to filter based on resource labels.
  64343. //
  64344. // To filter on multiple expressions, provide each separate expression
  64345. // within parentheses. For example, (scheduling.automaticRestart = true)
  64346. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64347. // AND expression. However, you can include AND and OR expressions
  64348. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64349. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64350. // true).
  64351. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  64352. c.urlParams_.Set("filter", filter)
  64353. return c
  64354. }
  64355. // MaxResults sets the optional parameter "maxResults": The maximum
  64356. // number of results per page that should be returned. If the number of
  64357. // available results is larger than maxResults, Compute Engine returns a
  64358. // nextPageToken that can be used to get the next page of results in
  64359. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64360. // (Default: 500)
  64361. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  64362. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64363. return c
  64364. }
  64365. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64366. // a certain order. By default, results are returned in alphanumerical
  64367. // order based on the resource name.
  64368. //
  64369. // You can also sort results in descending order based on the creation
  64370. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64371. // based on the creationTimestamp field in reverse chronological order
  64372. // (newest result first). Use this to sort resources like operations so
  64373. // that the newest operation is returned first.
  64374. //
  64375. // Currently, only sorting by name or creationTimestamp desc is
  64376. // supported.
  64377. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  64378. c.urlParams_.Set("orderBy", orderBy)
  64379. return c
  64380. }
  64381. // PageToken sets the optional parameter "pageToken": Specifies a page
  64382. // token to use. Set pageToken to the nextPageToken returned by a
  64383. // previous list request to get the next page of results.
  64384. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  64385. c.urlParams_.Set("pageToken", pageToken)
  64386. return c
  64387. }
  64388. // Fields allows partial responses to be retrieved. See
  64389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64390. // for more information.
  64391. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  64392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64393. return c
  64394. }
  64395. // IfNoneMatch sets the optional parameter which makes the operation
  64396. // fail if the object's ETag matches the given value. This is useful for
  64397. // getting updates only after the object has changed since the last
  64398. // request. Use googleapi.IsNotModified to check whether the response
  64399. // error from Do is the result of In-None-Match.
  64400. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  64401. c.ifNoneMatch_ = entityTag
  64402. return c
  64403. }
  64404. // Context sets the context to be used in this call's Do method. Any
  64405. // pending HTTP request will be aborted if the provided context is
  64406. // canceled.
  64407. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  64408. c.ctx_ = ctx
  64409. return c
  64410. }
  64411. // Header returns an http.Header that can be modified by the caller to
  64412. // add HTTP headers to the request.
  64413. func (c *NodeTypesListCall) Header() http.Header {
  64414. if c.header_ == nil {
  64415. c.header_ = make(http.Header)
  64416. }
  64417. return c.header_
  64418. }
  64419. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  64420. reqHeaders := make(http.Header)
  64421. for k, v := range c.header_ {
  64422. reqHeaders[k] = v
  64423. }
  64424. reqHeaders.Set("User-Agent", c.s.userAgent())
  64425. if c.ifNoneMatch_ != "" {
  64426. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64427. }
  64428. var body io.Reader = nil
  64429. c.urlParams_.Set("alt", alt)
  64430. c.urlParams_.Set("prettyPrint", "false")
  64431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  64432. urls += "?" + c.urlParams_.Encode()
  64433. req, err := http.NewRequest("GET", urls, body)
  64434. if err != nil {
  64435. return nil, err
  64436. }
  64437. req.Header = reqHeaders
  64438. googleapi.Expand(req.URL, map[string]string{
  64439. "project": c.project,
  64440. "zone": c.zone,
  64441. })
  64442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64443. }
  64444. // Do executes the "compute.nodeTypes.list" call.
  64445. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  64446. // status code is an error. Response headers are in either
  64447. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  64448. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64449. // to check whether the returned error was because
  64450. // http.StatusNotModified was returned.
  64451. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  64452. gensupport.SetOptions(c.urlParams_, opts...)
  64453. res, err := c.doRequest("json")
  64454. if res != nil && res.StatusCode == http.StatusNotModified {
  64455. if res.Body != nil {
  64456. res.Body.Close()
  64457. }
  64458. return nil, &googleapi.Error{
  64459. Code: res.StatusCode,
  64460. Header: res.Header,
  64461. }
  64462. }
  64463. if err != nil {
  64464. return nil, err
  64465. }
  64466. defer googleapi.CloseBody(res)
  64467. if err := googleapi.CheckResponse(res); err != nil {
  64468. return nil, err
  64469. }
  64470. ret := &NodeTypeList{
  64471. ServerResponse: googleapi.ServerResponse{
  64472. Header: res.Header,
  64473. HTTPStatusCode: res.StatusCode,
  64474. },
  64475. }
  64476. target := &ret
  64477. if err := gensupport.DecodeResponse(target, res); err != nil {
  64478. return nil, err
  64479. }
  64480. return ret, nil
  64481. // {
  64482. // "description": "Retrieves a list of node types available to the specified project.",
  64483. // "httpMethod": "GET",
  64484. // "id": "compute.nodeTypes.list",
  64485. // "parameterOrder": [
  64486. // "project",
  64487. // "zone"
  64488. // ],
  64489. // "parameters": {
  64490. // "filter": {
  64491. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64492. // "location": "query",
  64493. // "type": "string"
  64494. // },
  64495. // "maxResults": {
  64496. // "default": "500",
  64497. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64498. // "format": "uint32",
  64499. // "location": "query",
  64500. // "minimum": "0",
  64501. // "type": "integer"
  64502. // },
  64503. // "orderBy": {
  64504. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64505. // "location": "query",
  64506. // "type": "string"
  64507. // },
  64508. // "pageToken": {
  64509. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64510. // "location": "query",
  64511. // "type": "string"
  64512. // },
  64513. // "project": {
  64514. // "description": "Project ID for this request.",
  64515. // "location": "path",
  64516. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64517. // "required": true,
  64518. // "type": "string"
  64519. // },
  64520. // "zone": {
  64521. // "description": "The name of the zone for this request.",
  64522. // "location": "path",
  64523. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64524. // "required": true,
  64525. // "type": "string"
  64526. // }
  64527. // },
  64528. // "path": "{project}/zones/{zone}/nodeTypes",
  64529. // "response": {
  64530. // "$ref": "NodeTypeList"
  64531. // },
  64532. // "scopes": [
  64533. // "https://www.googleapis.com/auth/cloud-platform",
  64534. // "https://www.googleapis.com/auth/compute",
  64535. // "https://www.googleapis.com/auth/compute.readonly"
  64536. // ]
  64537. // }
  64538. }
  64539. // Pages invokes f for each page of results.
  64540. // A non-nil error returned from f will halt the iteration.
  64541. // The provided context supersedes any context provided to the Context method.
  64542. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  64543. c.ctx_ = ctx
  64544. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64545. for {
  64546. x, err := c.Do()
  64547. if err != nil {
  64548. return err
  64549. }
  64550. if err := f(x); err != nil {
  64551. return err
  64552. }
  64553. if x.NextPageToken == "" {
  64554. return nil
  64555. }
  64556. c.PageToken(x.NextPageToken)
  64557. }
  64558. }
  64559. // method id "compute.projects.disableXpnHost":
  64560. type ProjectsDisableXpnHostCall struct {
  64561. s *Service
  64562. project string
  64563. urlParams_ gensupport.URLParams
  64564. ctx_ context.Context
  64565. header_ http.Header
  64566. }
  64567. // DisableXpnHost: Disable this project as a shared VPC host project.
  64568. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  64569. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64570. c.project = project
  64571. return c
  64572. }
  64573. // RequestId sets the optional parameter "requestId": An optional
  64574. // request ID to identify requests. Specify a unique request ID so that
  64575. // if you must retry your request, the server will know to ignore the
  64576. // request if it has already been completed.
  64577. //
  64578. // For example, consider a situation where you make an initial request
  64579. // and the request times out. If you make the request again with the
  64580. // same request ID, the server can check if original operation with the
  64581. // same request ID was received, and if so, will ignore the second
  64582. // request. This prevents clients from accidentally creating duplicate
  64583. // commitments.
  64584. //
  64585. // The request ID must be a valid UUID with the exception that zero UUID
  64586. // is not supported (00000000-0000-0000-0000-000000000000).
  64587. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  64588. c.urlParams_.Set("requestId", requestId)
  64589. return c
  64590. }
  64591. // Fields allows partial responses to be retrieved. See
  64592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64593. // for more information.
  64594. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  64595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64596. return c
  64597. }
  64598. // Context sets the context to be used in this call's Do method. Any
  64599. // pending HTTP request will be aborted if the provided context is
  64600. // canceled.
  64601. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  64602. c.ctx_ = ctx
  64603. return c
  64604. }
  64605. // Header returns an http.Header that can be modified by the caller to
  64606. // add HTTP headers to the request.
  64607. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  64608. if c.header_ == nil {
  64609. c.header_ = make(http.Header)
  64610. }
  64611. return c.header_
  64612. }
  64613. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  64614. reqHeaders := make(http.Header)
  64615. for k, v := range c.header_ {
  64616. reqHeaders[k] = v
  64617. }
  64618. reqHeaders.Set("User-Agent", c.s.userAgent())
  64619. var body io.Reader = nil
  64620. c.urlParams_.Set("alt", alt)
  64621. c.urlParams_.Set("prettyPrint", "false")
  64622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  64623. urls += "?" + c.urlParams_.Encode()
  64624. req, err := http.NewRequest("POST", urls, body)
  64625. if err != nil {
  64626. return nil, err
  64627. }
  64628. req.Header = reqHeaders
  64629. googleapi.Expand(req.URL, map[string]string{
  64630. "project": c.project,
  64631. })
  64632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64633. }
  64634. // Do executes the "compute.projects.disableXpnHost" call.
  64635. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64636. // status code is an error. Response headers are in either
  64637. // *Operation.ServerResponse.Header or (if a response was returned at
  64638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64639. // to check whether the returned error was because
  64640. // http.StatusNotModified was returned.
  64641. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64642. gensupport.SetOptions(c.urlParams_, opts...)
  64643. res, err := c.doRequest("json")
  64644. if res != nil && res.StatusCode == http.StatusNotModified {
  64645. if res.Body != nil {
  64646. res.Body.Close()
  64647. }
  64648. return nil, &googleapi.Error{
  64649. Code: res.StatusCode,
  64650. Header: res.Header,
  64651. }
  64652. }
  64653. if err != nil {
  64654. return nil, err
  64655. }
  64656. defer googleapi.CloseBody(res)
  64657. if err := googleapi.CheckResponse(res); err != nil {
  64658. return nil, err
  64659. }
  64660. ret := &Operation{
  64661. ServerResponse: googleapi.ServerResponse{
  64662. Header: res.Header,
  64663. HTTPStatusCode: res.StatusCode,
  64664. },
  64665. }
  64666. target := &ret
  64667. if err := gensupport.DecodeResponse(target, res); err != nil {
  64668. return nil, err
  64669. }
  64670. return ret, nil
  64671. // {
  64672. // "description": "Disable this project as a shared VPC host project.",
  64673. // "httpMethod": "POST",
  64674. // "id": "compute.projects.disableXpnHost",
  64675. // "parameterOrder": [
  64676. // "project"
  64677. // ],
  64678. // "parameters": {
  64679. // "project": {
  64680. // "description": "Project ID for this request.",
  64681. // "location": "path",
  64682. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64683. // "required": true,
  64684. // "type": "string"
  64685. // },
  64686. // "requestId": {
  64687. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64688. // "location": "query",
  64689. // "type": "string"
  64690. // }
  64691. // },
  64692. // "path": "{project}/disableXpnHost",
  64693. // "response": {
  64694. // "$ref": "Operation"
  64695. // },
  64696. // "scopes": [
  64697. // "https://www.googleapis.com/auth/cloud-platform",
  64698. // "https://www.googleapis.com/auth/compute"
  64699. // ]
  64700. // }
  64701. }
  64702. // method id "compute.projects.disableXpnResource":
  64703. type ProjectsDisableXpnResourceCall struct {
  64704. s *Service
  64705. project string
  64706. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  64707. urlParams_ gensupport.URLParams
  64708. ctx_ context.Context
  64709. header_ http.Header
  64710. }
  64711. // DisableXpnResource: Disable a serivce resource (a.k.a service
  64712. // project) associated with this host project.
  64713. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  64714. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64715. c.project = project
  64716. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  64717. return c
  64718. }
  64719. // RequestId sets the optional parameter "requestId": An optional
  64720. // request ID to identify requests. Specify a unique request ID so that
  64721. // if you must retry your request, the server will know to ignore the
  64722. // request if it has already been completed.
  64723. //
  64724. // For example, consider a situation where you make an initial request
  64725. // and the request times out. If you make the request again with the
  64726. // same request ID, the server can check if original operation with the
  64727. // same request ID was received, and if so, will ignore the second
  64728. // request. This prevents clients from accidentally creating duplicate
  64729. // commitments.
  64730. //
  64731. // The request ID must be a valid UUID with the exception that zero UUID
  64732. // is not supported (00000000-0000-0000-0000-000000000000).
  64733. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  64734. c.urlParams_.Set("requestId", requestId)
  64735. return c
  64736. }
  64737. // Fields allows partial responses to be retrieved. See
  64738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64739. // for more information.
  64740. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  64741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64742. return c
  64743. }
  64744. // Context sets the context to be used in this call's Do method. Any
  64745. // pending HTTP request will be aborted if the provided context is
  64746. // canceled.
  64747. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  64748. c.ctx_ = ctx
  64749. return c
  64750. }
  64751. // Header returns an http.Header that can be modified by the caller to
  64752. // add HTTP headers to the request.
  64753. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  64754. if c.header_ == nil {
  64755. c.header_ = make(http.Header)
  64756. }
  64757. return c.header_
  64758. }
  64759. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  64760. reqHeaders := make(http.Header)
  64761. for k, v := range c.header_ {
  64762. reqHeaders[k] = v
  64763. }
  64764. reqHeaders.Set("User-Agent", c.s.userAgent())
  64765. var body io.Reader = nil
  64766. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  64767. if err != nil {
  64768. return nil, err
  64769. }
  64770. reqHeaders.Set("Content-Type", "application/json")
  64771. c.urlParams_.Set("alt", alt)
  64772. c.urlParams_.Set("prettyPrint", "false")
  64773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  64774. urls += "?" + c.urlParams_.Encode()
  64775. req, err := http.NewRequest("POST", urls, body)
  64776. if err != nil {
  64777. return nil, err
  64778. }
  64779. req.Header = reqHeaders
  64780. googleapi.Expand(req.URL, map[string]string{
  64781. "project": c.project,
  64782. })
  64783. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64784. }
  64785. // Do executes the "compute.projects.disableXpnResource" call.
  64786. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64787. // status code is an error. Response headers are in either
  64788. // *Operation.ServerResponse.Header or (if a response was returned at
  64789. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64790. // to check whether the returned error was because
  64791. // http.StatusNotModified was returned.
  64792. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64793. gensupport.SetOptions(c.urlParams_, opts...)
  64794. res, err := c.doRequest("json")
  64795. if res != nil && res.StatusCode == http.StatusNotModified {
  64796. if res.Body != nil {
  64797. res.Body.Close()
  64798. }
  64799. return nil, &googleapi.Error{
  64800. Code: res.StatusCode,
  64801. Header: res.Header,
  64802. }
  64803. }
  64804. if err != nil {
  64805. return nil, err
  64806. }
  64807. defer googleapi.CloseBody(res)
  64808. if err := googleapi.CheckResponse(res); err != nil {
  64809. return nil, err
  64810. }
  64811. ret := &Operation{
  64812. ServerResponse: googleapi.ServerResponse{
  64813. Header: res.Header,
  64814. HTTPStatusCode: res.StatusCode,
  64815. },
  64816. }
  64817. target := &ret
  64818. if err := gensupport.DecodeResponse(target, res); err != nil {
  64819. return nil, err
  64820. }
  64821. return ret, nil
  64822. // {
  64823. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  64824. // "httpMethod": "POST",
  64825. // "id": "compute.projects.disableXpnResource",
  64826. // "parameterOrder": [
  64827. // "project"
  64828. // ],
  64829. // "parameters": {
  64830. // "project": {
  64831. // "description": "Project ID for this request.",
  64832. // "location": "path",
  64833. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64834. // "required": true,
  64835. // "type": "string"
  64836. // },
  64837. // "requestId": {
  64838. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64839. // "location": "query",
  64840. // "type": "string"
  64841. // }
  64842. // },
  64843. // "path": "{project}/disableXpnResource",
  64844. // "request": {
  64845. // "$ref": "ProjectsDisableXpnResourceRequest"
  64846. // },
  64847. // "response": {
  64848. // "$ref": "Operation"
  64849. // },
  64850. // "scopes": [
  64851. // "https://www.googleapis.com/auth/cloud-platform",
  64852. // "https://www.googleapis.com/auth/compute"
  64853. // ]
  64854. // }
  64855. }
  64856. // method id "compute.projects.enableXpnHost":
  64857. type ProjectsEnableXpnHostCall struct {
  64858. s *Service
  64859. project string
  64860. urlParams_ gensupport.URLParams
  64861. ctx_ context.Context
  64862. header_ http.Header
  64863. }
  64864. // EnableXpnHost: Enable this project as a shared VPC host project.
  64865. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  64866. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64867. c.project = project
  64868. return c
  64869. }
  64870. // RequestId sets the optional parameter "requestId": An optional
  64871. // request ID to identify requests. Specify a unique request ID so that
  64872. // if you must retry your request, the server will know to ignore the
  64873. // request if it has already been completed.
  64874. //
  64875. // For example, consider a situation where you make an initial request
  64876. // and the request times out. If you make the request again with the
  64877. // same request ID, the server can check if original operation with the
  64878. // same request ID was received, and if so, will ignore the second
  64879. // request. This prevents clients from accidentally creating duplicate
  64880. // commitments.
  64881. //
  64882. // The request ID must be a valid UUID with the exception that zero UUID
  64883. // is not supported (00000000-0000-0000-0000-000000000000).
  64884. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  64885. c.urlParams_.Set("requestId", requestId)
  64886. return c
  64887. }
  64888. // Fields allows partial responses to be retrieved. See
  64889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64890. // for more information.
  64891. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  64892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64893. return c
  64894. }
  64895. // Context sets the context to be used in this call's Do method. Any
  64896. // pending HTTP request will be aborted if the provided context is
  64897. // canceled.
  64898. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  64899. c.ctx_ = ctx
  64900. return c
  64901. }
  64902. // Header returns an http.Header that can be modified by the caller to
  64903. // add HTTP headers to the request.
  64904. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  64905. if c.header_ == nil {
  64906. c.header_ = make(http.Header)
  64907. }
  64908. return c.header_
  64909. }
  64910. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  64911. reqHeaders := make(http.Header)
  64912. for k, v := range c.header_ {
  64913. reqHeaders[k] = v
  64914. }
  64915. reqHeaders.Set("User-Agent", c.s.userAgent())
  64916. var body io.Reader = nil
  64917. c.urlParams_.Set("alt", alt)
  64918. c.urlParams_.Set("prettyPrint", "false")
  64919. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  64920. urls += "?" + c.urlParams_.Encode()
  64921. req, err := http.NewRequest("POST", urls, body)
  64922. if err != nil {
  64923. return nil, err
  64924. }
  64925. req.Header = reqHeaders
  64926. googleapi.Expand(req.URL, map[string]string{
  64927. "project": c.project,
  64928. })
  64929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64930. }
  64931. // Do executes the "compute.projects.enableXpnHost" call.
  64932. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64933. // status code is an error. Response headers are in either
  64934. // *Operation.ServerResponse.Header or (if a response was returned at
  64935. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64936. // to check whether the returned error was because
  64937. // http.StatusNotModified was returned.
  64938. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64939. gensupport.SetOptions(c.urlParams_, opts...)
  64940. res, err := c.doRequest("json")
  64941. if res != nil && res.StatusCode == http.StatusNotModified {
  64942. if res.Body != nil {
  64943. res.Body.Close()
  64944. }
  64945. return nil, &googleapi.Error{
  64946. Code: res.StatusCode,
  64947. Header: res.Header,
  64948. }
  64949. }
  64950. if err != nil {
  64951. return nil, err
  64952. }
  64953. defer googleapi.CloseBody(res)
  64954. if err := googleapi.CheckResponse(res); err != nil {
  64955. return nil, err
  64956. }
  64957. ret := &Operation{
  64958. ServerResponse: googleapi.ServerResponse{
  64959. Header: res.Header,
  64960. HTTPStatusCode: res.StatusCode,
  64961. },
  64962. }
  64963. target := &ret
  64964. if err := gensupport.DecodeResponse(target, res); err != nil {
  64965. return nil, err
  64966. }
  64967. return ret, nil
  64968. // {
  64969. // "description": "Enable this project as a shared VPC host project.",
  64970. // "httpMethod": "POST",
  64971. // "id": "compute.projects.enableXpnHost",
  64972. // "parameterOrder": [
  64973. // "project"
  64974. // ],
  64975. // "parameters": {
  64976. // "project": {
  64977. // "description": "Project ID for this request.",
  64978. // "location": "path",
  64979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64980. // "required": true,
  64981. // "type": "string"
  64982. // },
  64983. // "requestId": {
  64984. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64985. // "location": "query",
  64986. // "type": "string"
  64987. // }
  64988. // },
  64989. // "path": "{project}/enableXpnHost",
  64990. // "response": {
  64991. // "$ref": "Operation"
  64992. // },
  64993. // "scopes": [
  64994. // "https://www.googleapis.com/auth/cloud-platform",
  64995. // "https://www.googleapis.com/auth/compute"
  64996. // ]
  64997. // }
  64998. }
  64999. // method id "compute.projects.enableXpnResource":
  65000. type ProjectsEnableXpnResourceCall struct {
  65001. s *Service
  65002. project string
  65003. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  65004. urlParams_ gensupport.URLParams
  65005. ctx_ context.Context
  65006. header_ http.Header
  65007. }
  65008. // EnableXpnResource: Enable service resource (a.k.a service project)
  65009. // for a host project, so that subnets in the host project can be used
  65010. // by instances in the service project.
  65011. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  65012. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65013. c.project = project
  65014. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  65015. return c
  65016. }
  65017. // RequestId sets the optional parameter "requestId": An optional
  65018. // request ID to identify requests. Specify a unique request ID so that
  65019. // if you must retry your request, the server will know to ignore the
  65020. // request if it has already been completed.
  65021. //
  65022. // For example, consider a situation where you make an initial request
  65023. // and the request times out. If you make the request again with the
  65024. // same request ID, the server can check if original operation with the
  65025. // same request ID was received, and if so, will ignore the second
  65026. // request. This prevents clients from accidentally creating duplicate
  65027. // commitments.
  65028. //
  65029. // The request ID must be a valid UUID with the exception that zero UUID
  65030. // is not supported (00000000-0000-0000-0000-000000000000).
  65031. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  65032. c.urlParams_.Set("requestId", requestId)
  65033. return c
  65034. }
  65035. // Fields allows partial responses to be retrieved. See
  65036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65037. // for more information.
  65038. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  65039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65040. return c
  65041. }
  65042. // Context sets the context to be used in this call's Do method. Any
  65043. // pending HTTP request will be aborted if the provided context is
  65044. // canceled.
  65045. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  65046. c.ctx_ = ctx
  65047. return c
  65048. }
  65049. // Header returns an http.Header that can be modified by the caller to
  65050. // add HTTP headers to the request.
  65051. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  65052. if c.header_ == nil {
  65053. c.header_ = make(http.Header)
  65054. }
  65055. return c.header_
  65056. }
  65057. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  65058. reqHeaders := make(http.Header)
  65059. for k, v := range c.header_ {
  65060. reqHeaders[k] = v
  65061. }
  65062. reqHeaders.Set("User-Agent", c.s.userAgent())
  65063. var body io.Reader = nil
  65064. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  65065. if err != nil {
  65066. return nil, err
  65067. }
  65068. reqHeaders.Set("Content-Type", "application/json")
  65069. c.urlParams_.Set("alt", alt)
  65070. c.urlParams_.Set("prettyPrint", "false")
  65071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  65072. urls += "?" + c.urlParams_.Encode()
  65073. req, err := http.NewRequest("POST", urls, body)
  65074. if err != nil {
  65075. return nil, err
  65076. }
  65077. req.Header = reqHeaders
  65078. googleapi.Expand(req.URL, map[string]string{
  65079. "project": c.project,
  65080. })
  65081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65082. }
  65083. // Do executes the "compute.projects.enableXpnResource" call.
  65084. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65085. // status code is an error. Response headers are in either
  65086. // *Operation.ServerResponse.Header or (if a response was returned at
  65087. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65088. // to check whether the returned error was because
  65089. // http.StatusNotModified was returned.
  65090. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65091. gensupport.SetOptions(c.urlParams_, opts...)
  65092. res, err := c.doRequest("json")
  65093. if res != nil && res.StatusCode == http.StatusNotModified {
  65094. if res.Body != nil {
  65095. res.Body.Close()
  65096. }
  65097. return nil, &googleapi.Error{
  65098. Code: res.StatusCode,
  65099. Header: res.Header,
  65100. }
  65101. }
  65102. if err != nil {
  65103. return nil, err
  65104. }
  65105. defer googleapi.CloseBody(res)
  65106. if err := googleapi.CheckResponse(res); err != nil {
  65107. return nil, err
  65108. }
  65109. ret := &Operation{
  65110. ServerResponse: googleapi.ServerResponse{
  65111. Header: res.Header,
  65112. HTTPStatusCode: res.StatusCode,
  65113. },
  65114. }
  65115. target := &ret
  65116. if err := gensupport.DecodeResponse(target, res); err != nil {
  65117. return nil, err
  65118. }
  65119. return ret, nil
  65120. // {
  65121. // "description": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.",
  65122. // "httpMethod": "POST",
  65123. // "id": "compute.projects.enableXpnResource",
  65124. // "parameterOrder": [
  65125. // "project"
  65126. // ],
  65127. // "parameters": {
  65128. // "project": {
  65129. // "description": "Project ID for this request.",
  65130. // "location": "path",
  65131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65132. // "required": true,
  65133. // "type": "string"
  65134. // },
  65135. // "requestId": {
  65136. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65137. // "location": "query",
  65138. // "type": "string"
  65139. // }
  65140. // },
  65141. // "path": "{project}/enableXpnResource",
  65142. // "request": {
  65143. // "$ref": "ProjectsEnableXpnResourceRequest"
  65144. // },
  65145. // "response": {
  65146. // "$ref": "Operation"
  65147. // },
  65148. // "scopes": [
  65149. // "https://www.googleapis.com/auth/cloud-platform",
  65150. // "https://www.googleapis.com/auth/compute"
  65151. // ]
  65152. // }
  65153. }
  65154. // method id "compute.projects.get":
  65155. type ProjectsGetCall struct {
  65156. s *Service
  65157. project string
  65158. urlParams_ gensupport.URLParams
  65159. ifNoneMatch_ string
  65160. ctx_ context.Context
  65161. header_ http.Header
  65162. }
  65163. // Get: Returns the specified Project resource.
  65164. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  65165. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  65166. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65167. c.project = project
  65168. return c
  65169. }
  65170. // Fields allows partial responses to be retrieved. See
  65171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65172. // for more information.
  65173. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  65174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65175. return c
  65176. }
  65177. // IfNoneMatch sets the optional parameter which makes the operation
  65178. // fail if the object's ETag matches the given value. This is useful for
  65179. // getting updates only after the object has changed since the last
  65180. // request. Use googleapi.IsNotModified to check whether the response
  65181. // error from Do is the result of In-None-Match.
  65182. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  65183. c.ifNoneMatch_ = entityTag
  65184. return c
  65185. }
  65186. // Context sets the context to be used in this call's Do method. Any
  65187. // pending HTTP request will be aborted if the provided context is
  65188. // canceled.
  65189. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  65190. c.ctx_ = ctx
  65191. return c
  65192. }
  65193. // Header returns an http.Header that can be modified by the caller to
  65194. // add HTTP headers to the request.
  65195. func (c *ProjectsGetCall) Header() http.Header {
  65196. if c.header_ == nil {
  65197. c.header_ = make(http.Header)
  65198. }
  65199. return c.header_
  65200. }
  65201. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  65202. reqHeaders := make(http.Header)
  65203. for k, v := range c.header_ {
  65204. reqHeaders[k] = v
  65205. }
  65206. reqHeaders.Set("User-Agent", c.s.userAgent())
  65207. if c.ifNoneMatch_ != "" {
  65208. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65209. }
  65210. var body io.Reader = nil
  65211. c.urlParams_.Set("alt", alt)
  65212. c.urlParams_.Set("prettyPrint", "false")
  65213. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  65214. urls += "?" + c.urlParams_.Encode()
  65215. req, err := http.NewRequest("GET", urls, body)
  65216. if err != nil {
  65217. return nil, err
  65218. }
  65219. req.Header = reqHeaders
  65220. googleapi.Expand(req.URL, map[string]string{
  65221. "project": c.project,
  65222. })
  65223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65224. }
  65225. // Do executes the "compute.projects.get" call.
  65226. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  65227. // code is an error. Response headers are in either
  65228. // *Project.ServerResponse.Header or (if a response was returned at all)
  65229. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65230. // check whether the returned error was because http.StatusNotModified
  65231. // was returned.
  65232. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  65233. gensupport.SetOptions(c.urlParams_, opts...)
  65234. res, err := c.doRequest("json")
  65235. if res != nil && res.StatusCode == http.StatusNotModified {
  65236. if res.Body != nil {
  65237. res.Body.Close()
  65238. }
  65239. return nil, &googleapi.Error{
  65240. Code: res.StatusCode,
  65241. Header: res.Header,
  65242. }
  65243. }
  65244. if err != nil {
  65245. return nil, err
  65246. }
  65247. defer googleapi.CloseBody(res)
  65248. if err := googleapi.CheckResponse(res); err != nil {
  65249. return nil, err
  65250. }
  65251. ret := &Project{
  65252. ServerResponse: googleapi.ServerResponse{
  65253. Header: res.Header,
  65254. HTTPStatusCode: res.StatusCode,
  65255. },
  65256. }
  65257. target := &ret
  65258. if err := gensupport.DecodeResponse(target, res); err != nil {
  65259. return nil, err
  65260. }
  65261. return ret, nil
  65262. // {
  65263. // "description": "Returns the specified Project resource.",
  65264. // "httpMethod": "GET",
  65265. // "id": "compute.projects.get",
  65266. // "parameterOrder": [
  65267. // "project"
  65268. // ],
  65269. // "parameters": {
  65270. // "project": {
  65271. // "description": "Project ID for this request.",
  65272. // "location": "path",
  65273. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65274. // "required": true,
  65275. // "type": "string"
  65276. // }
  65277. // },
  65278. // "path": "{project}",
  65279. // "response": {
  65280. // "$ref": "Project"
  65281. // },
  65282. // "scopes": [
  65283. // "https://www.googleapis.com/auth/cloud-platform",
  65284. // "https://www.googleapis.com/auth/compute",
  65285. // "https://www.googleapis.com/auth/compute.readonly"
  65286. // ]
  65287. // }
  65288. }
  65289. // method id "compute.projects.getXpnHost":
  65290. type ProjectsGetXpnHostCall struct {
  65291. s *Service
  65292. project string
  65293. urlParams_ gensupport.URLParams
  65294. ifNoneMatch_ string
  65295. ctx_ context.Context
  65296. header_ http.Header
  65297. }
  65298. // GetXpnHost: Gets the shared VPC host project that this project links
  65299. // to. May be empty if no link exists.
  65300. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  65301. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65302. c.project = project
  65303. return c
  65304. }
  65305. // Fields allows partial responses to be retrieved. See
  65306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65307. // for more information.
  65308. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  65309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65310. return c
  65311. }
  65312. // IfNoneMatch sets the optional parameter which makes the operation
  65313. // fail if the object's ETag matches the given value. This is useful for
  65314. // getting updates only after the object has changed since the last
  65315. // request. Use googleapi.IsNotModified to check whether the response
  65316. // error from Do is the result of In-None-Match.
  65317. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  65318. c.ifNoneMatch_ = entityTag
  65319. return c
  65320. }
  65321. // Context sets the context to be used in this call's Do method. Any
  65322. // pending HTTP request will be aborted if the provided context is
  65323. // canceled.
  65324. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  65325. c.ctx_ = ctx
  65326. return c
  65327. }
  65328. // Header returns an http.Header that can be modified by the caller to
  65329. // add HTTP headers to the request.
  65330. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  65331. if c.header_ == nil {
  65332. c.header_ = make(http.Header)
  65333. }
  65334. return c.header_
  65335. }
  65336. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  65337. reqHeaders := make(http.Header)
  65338. for k, v := range c.header_ {
  65339. reqHeaders[k] = v
  65340. }
  65341. reqHeaders.Set("User-Agent", c.s.userAgent())
  65342. if c.ifNoneMatch_ != "" {
  65343. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65344. }
  65345. var body io.Reader = nil
  65346. c.urlParams_.Set("alt", alt)
  65347. c.urlParams_.Set("prettyPrint", "false")
  65348. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  65349. urls += "?" + c.urlParams_.Encode()
  65350. req, err := http.NewRequest("GET", urls, body)
  65351. if err != nil {
  65352. return nil, err
  65353. }
  65354. req.Header = reqHeaders
  65355. googleapi.Expand(req.URL, map[string]string{
  65356. "project": c.project,
  65357. })
  65358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65359. }
  65360. // Do executes the "compute.projects.getXpnHost" call.
  65361. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  65362. // code is an error. Response headers are in either
  65363. // *Project.ServerResponse.Header or (if a response was returned at all)
  65364. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65365. // check whether the returned error was because http.StatusNotModified
  65366. // was returned.
  65367. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  65368. gensupport.SetOptions(c.urlParams_, opts...)
  65369. res, err := c.doRequest("json")
  65370. if res != nil && res.StatusCode == http.StatusNotModified {
  65371. if res.Body != nil {
  65372. res.Body.Close()
  65373. }
  65374. return nil, &googleapi.Error{
  65375. Code: res.StatusCode,
  65376. Header: res.Header,
  65377. }
  65378. }
  65379. if err != nil {
  65380. return nil, err
  65381. }
  65382. defer googleapi.CloseBody(res)
  65383. if err := googleapi.CheckResponse(res); err != nil {
  65384. return nil, err
  65385. }
  65386. ret := &Project{
  65387. ServerResponse: googleapi.ServerResponse{
  65388. Header: res.Header,
  65389. HTTPStatusCode: res.StatusCode,
  65390. },
  65391. }
  65392. target := &ret
  65393. if err := gensupport.DecodeResponse(target, res); err != nil {
  65394. return nil, err
  65395. }
  65396. return ret, nil
  65397. // {
  65398. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  65399. // "httpMethod": "GET",
  65400. // "id": "compute.projects.getXpnHost",
  65401. // "parameterOrder": [
  65402. // "project"
  65403. // ],
  65404. // "parameters": {
  65405. // "project": {
  65406. // "description": "Project ID for this request.",
  65407. // "location": "path",
  65408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65409. // "required": true,
  65410. // "type": "string"
  65411. // }
  65412. // },
  65413. // "path": "{project}/getXpnHost",
  65414. // "response": {
  65415. // "$ref": "Project"
  65416. // },
  65417. // "scopes": [
  65418. // "https://www.googleapis.com/auth/cloud-platform",
  65419. // "https://www.googleapis.com/auth/compute"
  65420. // ]
  65421. // }
  65422. }
  65423. // method id "compute.projects.getXpnResources":
  65424. type ProjectsGetXpnResourcesCall struct {
  65425. s *Service
  65426. project string
  65427. urlParams_ gensupport.URLParams
  65428. ifNoneMatch_ string
  65429. ctx_ context.Context
  65430. header_ http.Header
  65431. }
  65432. // GetXpnResources: Gets service resources (a.k.a service project)
  65433. // associated with this host project.
  65434. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  65435. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65436. c.project = project
  65437. return c
  65438. }
  65439. // Filter sets the optional parameter "filter": A filter expression that
  65440. // filters resources listed in the response. The expression must specify
  65441. // the field name, a comparison operator, and the value that you want to
  65442. // use for filtering. The value must be a string, a number, or a
  65443. // boolean. The comparison operator must be either =, !=, >, or <.
  65444. //
  65445. // For example, if you are filtering Compute Engine instances, you can
  65446. // exclude instances named example-instance by specifying name !=
  65447. // example-instance.
  65448. //
  65449. // You can also filter nested fields. For example, you could specify
  65450. // scheduling.automaticRestart = false to include instances only if they
  65451. // are not scheduled for automatic restarts. You can use filtering on
  65452. // nested fields to filter based on resource labels.
  65453. //
  65454. // To filter on multiple expressions, provide each separate expression
  65455. // within parentheses. For example, (scheduling.automaticRestart = true)
  65456. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65457. // AND expression. However, you can include AND and OR expressions
  65458. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65459. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65460. // true).
  65461. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  65462. c.urlParams_.Set("filter", filter)
  65463. return c
  65464. }
  65465. // MaxResults sets the optional parameter "maxResults": The maximum
  65466. // number of results per page that should be returned. If the number of
  65467. // available results is larger than maxResults, Compute Engine returns a
  65468. // nextPageToken that can be used to get the next page of results in
  65469. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65470. // (Default: 500)
  65471. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  65472. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65473. return c
  65474. }
  65475. // OrderBy sets the optional parameter "order_by": Sorts list results by
  65476. // a certain order. By default, results are returned in alphanumerical
  65477. // order based on the resource name.
  65478. //
  65479. // You can also sort results in descending order based on the creation
  65480. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65481. // based on the creationTimestamp field in reverse chronological order
  65482. // (newest result first). Use this to sort resources like operations so
  65483. // that the newest operation is returned first.
  65484. //
  65485. // Currently, only sorting by name or creationTimestamp desc is
  65486. // supported.
  65487. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  65488. c.urlParams_.Set("order_by", orderBy)
  65489. return c
  65490. }
  65491. // PageToken sets the optional parameter "pageToken": Specifies a page
  65492. // token to use. Set pageToken to the nextPageToken returned by a
  65493. // previous list request to get the next page of results.
  65494. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  65495. c.urlParams_.Set("pageToken", pageToken)
  65496. return c
  65497. }
  65498. // Fields allows partial responses to be retrieved. See
  65499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65500. // for more information.
  65501. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  65502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65503. return c
  65504. }
  65505. // IfNoneMatch sets the optional parameter which makes the operation
  65506. // fail if the object's ETag matches the given value. This is useful for
  65507. // getting updates only after the object has changed since the last
  65508. // request. Use googleapi.IsNotModified to check whether the response
  65509. // error from Do is the result of In-None-Match.
  65510. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  65511. c.ifNoneMatch_ = entityTag
  65512. return c
  65513. }
  65514. // Context sets the context to be used in this call's Do method. Any
  65515. // pending HTTP request will be aborted if the provided context is
  65516. // canceled.
  65517. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  65518. c.ctx_ = ctx
  65519. return c
  65520. }
  65521. // Header returns an http.Header that can be modified by the caller to
  65522. // add HTTP headers to the request.
  65523. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  65524. if c.header_ == nil {
  65525. c.header_ = make(http.Header)
  65526. }
  65527. return c.header_
  65528. }
  65529. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  65530. reqHeaders := make(http.Header)
  65531. for k, v := range c.header_ {
  65532. reqHeaders[k] = v
  65533. }
  65534. reqHeaders.Set("User-Agent", c.s.userAgent())
  65535. if c.ifNoneMatch_ != "" {
  65536. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65537. }
  65538. var body io.Reader = nil
  65539. c.urlParams_.Set("alt", alt)
  65540. c.urlParams_.Set("prettyPrint", "false")
  65541. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  65542. urls += "?" + c.urlParams_.Encode()
  65543. req, err := http.NewRequest("GET", urls, body)
  65544. if err != nil {
  65545. return nil, err
  65546. }
  65547. req.Header = reqHeaders
  65548. googleapi.Expand(req.URL, map[string]string{
  65549. "project": c.project,
  65550. })
  65551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65552. }
  65553. // Do executes the "compute.projects.getXpnResources" call.
  65554. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  65555. // non-2xx status code is an error. Response headers are in either
  65556. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  65557. // returned at all) in error.(*googleapi.Error).Header. Use
  65558. // googleapi.IsNotModified to check whether the returned error was
  65559. // because http.StatusNotModified was returned.
  65560. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  65561. gensupport.SetOptions(c.urlParams_, opts...)
  65562. res, err := c.doRequest("json")
  65563. if res != nil && res.StatusCode == http.StatusNotModified {
  65564. if res.Body != nil {
  65565. res.Body.Close()
  65566. }
  65567. return nil, &googleapi.Error{
  65568. Code: res.StatusCode,
  65569. Header: res.Header,
  65570. }
  65571. }
  65572. if err != nil {
  65573. return nil, err
  65574. }
  65575. defer googleapi.CloseBody(res)
  65576. if err := googleapi.CheckResponse(res); err != nil {
  65577. return nil, err
  65578. }
  65579. ret := &ProjectsGetXpnResources{
  65580. ServerResponse: googleapi.ServerResponse{
  65581. Header: res.Header,
  65582. HTTPStatusCode: res.StatusCode,
  65583. },
  65584. }
  65585. target := &ret
  65586. if err := gensupport.DecodeResponse(target, res); err != nil {
  65587. return nil, err
  65588. }
  65589. return ret, nil
  65590. // {
  65591. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  65592. // "httpMethod": "GET",
  65593. // "id": "compute.projects.getXpnResources",
  65594. // "parameterOrder": [
  65595. // "project"
  65596. // ],
  65597. // "parameters": {
  65598. // "filter": {
  65599. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  65600. // "location": "query",
  65601. // "type": "string"
  65602. // },
  65603. // "maxResults": {
  65604. // "default": "500",
  65605. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  65606. // "format": "uint32",
  65607. // "location": "query",
  65608. // "minimum": "0",
  65609. // "type": "integer"
  65610. // },
  65611. // "order_by": {
  65612. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  65613. // "location": "query",
  65614. // "type": "string"
  65615. // },
  65616. // "pageToken": {
  65617. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  65618. // "location": "query",
  65619. // "type": "string"
  65620. // },
  65621. // "project": {
  65622. // "description": "Project ID for this request.",
  65623. // "location": "path",
  65624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65625. // "required": true,
  65626. // "type": "string"
  65627. // }
  65628. // },
  65629. // "path": "{project}/getXpnResources",
  65630. // "response": {
  65631. // "$ref": "ProjectsGetXpnResources"
  65632. // },
  65633. // "scopes": [
  65634. // "https://www.googleapis.com/auth/cloud-platform",
  65635. // "https://www.googleapis.com/auth/compute"
  65636. // ]
  65637. // }
  65638. }
  65639. // Pages invokes f for each page of results.
  65640. // A non-nil error returned from f will halt the iteration.
  65641. // The provided context supersedes any context provided to the Context method.
  65642. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  65643. c.ctx_ = ctx
  65644. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65645. for {
  65646. x, err := c.Do()
  65647. if err != nil {
  65648. return err
  65649. }
  65650. if err := f(x); err != nil {
  65651. return err
  65652. }
  65653. if x.NextPageToken == "" {
  65654. return nil
  65655. }
  65656. c.PageToken(x.NextPageToken)
  65657. }
  65658. }
  65659. // method id "compute.projects.listXpnHosts":
  65660. type ProjectsListXpnHostsCall struct {
  65661. s *Service
  65662. project string
  65663. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  65664. urlParams_ gensupport.URLParams
  65665. ctx_ context.Context
  65666. header_ http.Header
  65667. }
  65668. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  65669. // in an organization.
  65670. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  65671. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65672. c.project = project
  65673. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  65674. return c
  65675. }
  65676. // Filter sets the optional parameter "filter": A filter expression that
  65677. // filters resources listed in the response. The expression must specify
  65678. // the field name, a comparison operator, and the value that you want to
  65679. // use for filtering. The value must be a string, a number, or a
  65680. // boolean. The comparison operator must be either =, !=, >, or <.
  65681. //
  65682. // For example, if you are filtering Compute Engine instances, you can
  65683. // exclude instances named example-instance by specifying name !=
  65684. // example-instance.
  65685. //
  65686. // You can also filter nested fields. For example, you could specify
  65687. // scheduling.automaticRestart = false to include instances only if they
  65688. // are not scheduled for automatic restarts. You can use filtering on
  65689. // nested fields to filter based on resource labels.
  65690. //
  65691. // To filter on multiple expressions, provide each separate expression
  65692. // within parentheses. For example, (scheduling.automaticRestart = true)
  65693. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65694. // AND expression. However, you can include AND and OR expressions
  65695. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65696. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65697. // true).
  65698. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  65699. c.urlParams_.Set("filter", filter)
  65700. return c
  65701. }
  65702. // MaxResults sets the optional parameter "maxResults": The maximum
  65703. // number of results per page that should be returned. If the number of
  65704. // available results is larger than maxResults, Compute Engine returns a
  65705. // nextPageToken that can be used to get the next page of results in
  65706. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65707. // (Default: 500)
  65708. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  65709. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65710. return c
  65711. }
  65712. // OrderBy sets the optional parameter "order_by": Sorts list results by
  65713. // a certain order. By default, results are returned in alphanumerical
  65714. // order based on the resource name.
  65715. //
  65716. // You can also sort results in descending order based on the creation
  65717. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65718. // based on the creationTimestamp field in reverse chronological order
  65719. // (newest result first). Use this to sort resources like operations so
  65720. // that the newest operation is returned first.
  65721. //
  65722. // Currently, only sorting by name or creationTimestamp desc is
  65723. // supported.
  65724. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  65725. c.urlParams_.Set("order_by", orderBy)
  65726. return c
  65727. }
  65728. // PageToken sets the optional parameter "pageToken": Specifies a page
  65729. // token to use. Set pageToken to the nextPageToken returned by a
  65730. // previous list request to get the next page of results.
  65731. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  65732. c.urlParams_.Set("pageToken", pageToken)
  65733. return c
  65734. }
  65735. // Fields allows partial responses to be retrieved. See
  65736. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65737. // for more information.
  65738. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  65739. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65740. return c
  65741. }
  65742. // Context sets the context to be used in this call's Do method. Any
  65743. // pending HTTP request will be aborted if the provided context is
  65744. // canceled.
  65745. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  65746. c.ctx_ = ctx
  65747. return c
  65748. }
  65749. // Header returns an http.Header that can be modified by the caller to
  65750. // add HTTP headers to the request.
  65751. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  65752. if c.header_ == nil {
  65753. c.header_ = make(http.Header)
  65754. }
  65755. return c.header_
  65756. }
  65757. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  65758. reqHeaders := make(http.Header)
  65759. for k, v := range c.header_ {
  65760. reqHeaders[k] = v
  65761. }
  65762. reqHeaders.Set("User-Agent", c.s.userAgent())
  65763. var body io.Reader = nil
  65764. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  65765. if err != nil {
  65766. return nil, err
  65767. }
  65768. reqHeaders.Set("Content-Type", "application/json")
  65769. c.urlParams_.Set("alt", alt)
  65770. c.urlParams_.Set("prettyPrint", "false")
  65771. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  65772. urls += "?" + c.urlParams_.Encode()
  65773. req, err := http.NewRequest("POST", urls, body)
  65774. if err != nil {
  65775. return nil, err
  65776. }
  65777. req.Header = reqHeaders
  65778. googleapi.Expand(req.URL, map[string]string{
  65779. "project": c.project,
  65780. })
  65781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65782. }
  65783. // Do executes the "compute.projects.listXpnHosts" call.
  65784. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  65785. // status code is an error. Response headers are in either
  65786. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  65787. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65788. // to check whether the returned error was because
  65789. // http.StatusNotModified was returned.
  65790. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  65791. gensupport.SetOptions(c.urlParams_, opts...)
  65792. res, err := c.doRequest("json")
  65793. if res != nil && res.StatusCode == http.StatusNotModified {
  65794. if res.Body != nil {
  65795. res.Body.Close()
  65796. }
  65797. return nil, &googleapi.Error{
  65798. Code: res.StatusCode,
  65799. Header: res.Header,
  65800. }
  65801. }
  65802. if err != nil {
  65803. return nil, err
  65804. }
  65805. defer googleapi.CloseBody(res)
  65806. if err := googleapi.CheckResponse(res); err != nil {
  65807. return nil, err
  65808. }
  65809. ret := &XpnHostList{
  65810. ServerResponse: googleapi.ServerResponse{
  65811. Header: res.Header,
  65812. HTTPStatusCode: res.StatusCode,
  65813. },
  65814. }
  65815. target := &ret
  65816. if err := gensupport.DecodeResponse(target, res); err != nil {
  65817. return nil, err
  65818. }
  65819. return ret, nil
  65820. // {
  65821. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  65822. // "httpMethod": "POST",
  65823. // "id": "compute.projects.listXpnHosts",
  65824. // "parameterOrder": [
  65825. // "project"
  65826. // ],
  65827. // "parameters": {
  65828. // "filter": {
  65829. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  65830. // "location": "query",
  65831. // "type": "string"
  65832. // },
  65833. // "maxResults": {
  65834. // "default": "500",
  65835. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  65836. // "format": "uint32",
  65837. // "location": "query",
  65838. // "minimum": "0",
  65839. // "type": "integer"
  65840. // },
  65841. // "order_by": {
  65842. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  65843. // "location": "query",
  65844. // "type": "string"
  65845. // },
  65846. // "pageToken": {
  65847. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  65848. // "location": "query",
  65849. // "type": "string"
  65850. // },
  65851. // "project": {
  65852. // "description": "Project ID for this request.",
  65853. // "location": "path",
  65854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65855. // "required": true,
  65856. // "type": "string"
  65857. // }
  65858. // },
  65859. // "path": "{project}/listXpnHosts",
  65860. // "request": {
  65861. // "$ref": "ProjectsListXpnHostsRequest"
  65862. // },
  65863. // "response": {
  65864. // "$ref": "XpnHostList"
  65865. // },
  65866. // "scopes": [
  65867. // "https://www.googleapis.com/auth/cloud-platform",
  65868. // "https://www.googleapis.com/auth/compute"
  65869. // ]
  65870. // }
  65871. }
  65872. // Pages invokes f for each page of results.
  65873. // A non-nil error returned from f will halt the iteration.
  65874. // The provided context supersedes any context provided to the Context method.
  65875. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  65876. c.ctx_ = ctx
  65877. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65878. for {
  65879. x, err := c.Do()
  65880. if err != nil {
  65881. return err
  65882. }
  65883. if err := f(x); err != nil {
  65884. return err
  65885. }
  65886. if x.NextPageToken == "" {
  65887. return nil
  65888. }
  65889. c.PageToken(x.NextPageToken)
  65890. }
  65891. }
  65892. // method id "compute.projects.moveDisk":
  65893. type ProjectsMoveDiskCall struct {
  65894. s *Service
  65895. project string
  65896. diskmoverequest *DiskMoveRequest
  65897. urlParams_ gensupport.URLParams
  65898. ctx_ context.Context
  65899. header_ http.Header
  65900. }
  65901. // MoveDisk: Moves a persistent disk from one zone to another.
  65902. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  65903. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65904. c.project = project
  65905. c.diskmoverequest = diskmoverequest
  65906. return c
  65907. }
  65908. // RequestId sets the optional parameter "requestId": An optional
  65909. // request ID to identify requests. Specify a unique request ID so that
  65910. // if you must retry your request, the server will know to ignore the
  65911. // request if it has already been completed.
  65912. //
  65913. // For example, consider a situation where you make an initial request
  65914. // and the request times out. If you make the request again with the
  65915. // same request ID, the server can check if original operation with the
  65916. // same request ID was received, and if so, will ignore the second
  65917. // request. This prevents clients from accidentally creating duplicate
  65918. // commitments.
  65919. //
  65920. // The request ID must be a valid UUID with the exception that zero UUID
  65921. // is not supported (00000000-0000-0000-0000-000000000000).
  65922. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  65923. c.urlParams_.Set("requestId", requestId)
  65924. return c
  65925. }
  65926. // Fields allows partial responses to be retrieved. See
  65927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65928. // for more information.
  65929. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  65930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65931. return c
  65932. }
  65933. // Context sets the context to be used in this call's Do method. Any
  65934. // pending HTTP request will be aborted if the provided context is
  65935. // canceled.
  65936. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  65937. c.ctx_ = ctx
  65938. return c
  65939. }
  65940. // Header returns an http.Header that can be modified by the caller to
  65941. // add HTTP headers to the request.
  65942. func (c *ProjectsMoveDiskCall) Header() http.Header {
  65943. if c.header_ == nil {
  65944. c.header_ = make(http.Header)
  65945. }
  65946. return c.header_
  65947. }
  65948. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  65949. reqHeaders := make(http.Header)
  65950. for k, v := range c.header_ {
  65951. reqHeaders[k] = v
  65952. }
  65953. reqHeaders.Set("User-Agent", c.s.userAgent())
  65954. var body io.Reader = nil
  65955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  65956. if err != nil {
  65957. return nil, err
  65958. }
  65959. reqHeaders.Set("Content-Type", "application/json")
  65960. c.urlParams_.Set("alt", alt)
  65961. c.urlParams_.Set("prettyPrint", "false")
  65962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  65963. urls += "?" + c.urlParams_.Encode()
  65964. req, err := http.NewRequest("POST", urls, body)
  65965. if err != nil {
  65966. return nil, err
  65967. }
  65968. req.Header = reqHeaders
  65969. googleapi.Expand(req.URL, map[string]string{
  65970. "project": c.project,
  65971. })
  65972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65973. }
  65974. // Do executes the "compute.projects.moveDisk" call.
  65975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65976. // status code is an error. Response headers are in either
  65977. // *Operation.ServerResponse.Header or (if a response was returned at
  65978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65979. // to check whether the returned error was because
  65980. // http.StatusNotModified was returned.
  65981. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65982. gensupport.SetOptions(c.urlParams_, opts...)
  65983. res, err := c.doRequest("json")
  65984. if res != nil && res.StatusCode == http.StatusNotModified {
  65985. if res.Body != nil {
  65986. res.Body.Close()
  65987. }
  65988. return nil, &googleapi.Error{
  65989. Code: res.StatusCode,
  65990. Header: res.Header,
  65991. }
  65992. }
  65993. if err != nil {
  65994. return nil, err
  65995. }
  65996. defer googleapi.CloseBody(res)
  65997. if err := googleapi.CheckResponse(res); err != nil {
  65998. return nil, err
  65999. }
  66000. ret := &Operation{
  66001. ServerResponse: googleapi.ServerResponse{
  66002. Header: res.Header,
  66003. HTTPStatusCode: res.StatusCode,
  66004. },
  66005. }
  66006. target := &ret
  66007. if err := gensupport.DecodeResponse(target, res); err != nil {
  66008. return nil, err
  66009. }
  66010. return ret, nil
  66011. // {
  66012. // "description": "Moves a persistent disk from one zone to another.",
  66013. // "httpMethod": "POST",
  66014. // "id": "compute.projects.moveDisk",
  66015. // "parameterOrder": [
  66016. // "project"
  66017. // ],
  66018. // "parameters": {
  66019. // "project": {
  66020. // "description": "Project ID for this request.",
  66021. // "location": "path",
  66022. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66023. // "required": true,
  66024. // "type": "string"
  66025. // },
  66026. // "requestId": {
  66027. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66028. // "location": "query",
  66029. // "type": "string"
  66030. // }
  66031. // },
  66032. // "path": "{project}/moveDisk",
  66033. // "request": {
  66034. // "$ref": "DiskMoveRequest"
  66035. // },
  66036. // "response": {
  66037. // "$ref": "Operation"
  66038. // },
  66039. // "scopes": [
  66040. // "https://www.googleapis.com/auth/cloud-platform",
  66041. // "https://www.googleapis.com/auth/compute"
  66042. // ]
  66043. // }
  66044. }
  66045. // method id "compute.projects.moveInstance":
  66046. type ProjectsMoveInstanceCall struct {
  66047. s *Service
  66048. project string
  66049. instancemoverequest *InstanceMoveRequest
  66050. urlParams_ gensupport.URLParams
  66051. ctx_ context.Context
  66052. header_ http.Header
  66053. }
  66054. // MoveInstance: Moves an instance and its attached persistent disks
  66055. // from one zone to another.
  66056. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  66057. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66058. c.project = project
  66059. c.instancemoverequest = instancemoverequest
  66060. return c
  66061. }
  66062. // RequestId sets the optional parameter "requestId": An optional
  66063. // request ID to identify requests. Specify a unique request ID so that
  66064. // if you must retry your request, the server will know to ignore the
  66065. // request if it has already been completed.
  66066. //
  66067. // For example, consider a situation where you make an initial request
  66068. // and the request times out. If you make the request again with the
  66069. // same request ID, the server can check if original operation with the
  66070. // same request ID was received, and if so, will ignore the second
  66071. // request. This prevents clients from accidentally creating duplicate
  66072. // commitments.
  66073. //
  66074. // The request ID must be a valid UUID with the exception that zero UUID
  66075. // is not supported (00000000-0000-0000-0000-000000000000).
  66076. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  66077. c.urlParams_.Set("requestId", requestId)
  66078. return c
  66079. }
  66080. // Fields allows partial responses to be retrieved. See
  66081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66082. // for more information.
  66083. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  66084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66085. return c
  66086. }
  66087. // Context sets the context to be used in this call's Do method. Any
  66088. // pending HTTP request will be aborted if the provided context is
  66089. // canceled.
  66090. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  66091. c.ctx_ = ctx
  66092. return c
  66093. }
  66094. // Header returns an http.Header that can be modified by the caller to
  66095. // add HTTP headers to the request.
  66096. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  66097. if c.header_ == nil {
  66098. c.header_ = make(http.Header)
  66099. }
  66100. return c.header_
  66101. }
  66102. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  66103. reqHeaders := make(http.Header)
  66104. for k, v := range c.header_ {
  66105. reqHeaders[k] = v
  66106. }
  66107. reqHeaders.Set("User-Agent", c.s.userAgent())
  66108. var body io.Reader = nil
  66109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  66110. if err != nil {
  66111. return nil, err
  66112. }
  66113. reqHeaders.Set("Content-Type", "application/json")
  66114. c.urlParams_.Set("alt", alt)
  66115. c.urlParams_.Set("prettyPrint", "false")
  66116. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  66117. urls += "?" + c.urlParams_.Encode()
  66118. req, err := http.NewRequest("POST", urls, body)
  66119. if err != nil {
  66120. return nil, err
  66121. }
  66122. req.Header = reqHeaders
  66123. googleapi.Expand(req.URL, map[string]string{
  66124. "project": c.project,
  66125. })
  66126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66127. }
  66128. // Do executes the "compute.projects.moveInstance" call.
  66129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66130. // status code is an error. Response headers are in either
  66131. // *Operation.ServerResponse.Header or (if a response was returned at
  66132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66133. // to check whether the returned error was because
  66134. // http.StatusNotModified was returned.
  66135. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66136. gensupport.SetOptions(c.urlParams_, opts...)
  66137. res, err := c.doRequest("json")
  66138. if res != nil && res.StatusCode == http.StatusNotModified {
  66139. if res.Body != nil {
  66140. res.Body.Close()
  66141. }
  66142. return nil, &googleapi.Error{
  66143. Code: res.StatusCode,
  66144. Header: res.Header,
  66145. }
  66146. }
  66147. if err != nil {
  66148. return nil, err
  66149. }
  66150. defer googleapi.CloseBody(res)
  66151. if err := googleapi.CheckResponse(res); err != nil {
  66152. return nil, err
  66153. }
  66154. ret := &Operation{
  66155. ServerResponse: googleapi.ServerResponse{
  66156. Header: res.Header,
  66157. HTTPStatusCode: res.StatusCode,
  66158. },
  66159. }
  66160. target := &ret
  66161. if err := gensupport.DecodeResponse(target, res); err != nil {
  66162. return nil, err
  66163. }
  66164. return ret, nil
  66165. // {
  66166. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  66167. // "httpMethod": "POST",
  66168. // "id": "compute.projects.moveInstance",
  66169. // "parameterOrder": [
  66170. // "project"
  66171. // ],
  66172. // "parameters": {
  66173. // "project": {
  66174. // "description": "Project ID for this request.",
  66175. // "location": "path",
  66176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66177. // "required": true,
  66178. // "type": "string"
  66179. // },
  66180. // "requestId": {
  66181. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66182. // "location": "query",
  66183. // "type": "string"
  66184. // }
  66185. // },
  66186. // "path": "{project}/moveInstance",
  66187. // "request": {
  66188. // "$ref": "InstanceMoveRequest"
  66189. // },
  66190. // "response": {
  66191. // "$ref": "Operation"
  66192. // },
  66193. // "scopes": [
  66194. // "https://www.googleapis.com/auth/cloud-platform",
  66195. // "https://www.googleapis.com/auth/compute"
  66196. // ]
  66197. // }
  66198. }
  66199. // method id "compute.projects.setCommonInstanceMetadata":
  66200. type ProjectsSetCommonInstanceMetadataCall struct {
  66201. s *Service
  66202. project string
  66203. metadata *Metadata
  66204. urlParams_ gensupport.URLParams
  66205. ctx_ context.Context
  66206. header_ http.Header
  66207. }
  66208. // SetCommonInstanceMetadata: Sets metadata common to all instances
  66209. // within the specified project using the data included in the request.
  66210. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  66211. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  66212. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66213. c.project = project
  66214. c.metadata = metadata
  66215. return c
  66216. }
  66217. // RequestId sets the optional parameter "requestId": An optional
  66218. // request ID to identify requests. Specify a unique request ID so that
  66219. // if you must retry your request, the server will know to ignore the
  66220. // request if it has already been completed.
  66221. //
  66222. // For example, consider a situation where you make an initial request
  66223. // and the request times out. If you make the request again with the
  66224. // same request ID, the server can check if original operation with the
  66225. // same request ID was received, and if so, will ignore the second
  66226. // request. This prevents clients from accidentally creating duplicate
  66227. // commitments.
  66228. //
  66229. // The request ID must be a valid UUID with the exception that zero UUID
  66230. // is not supported (00000000-0000-0000-0000-000000000000).
  66231. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  66232. c.urlParams_.Set("requestId", requestId)
  66233. return c
  66234. }
  66235. // Fields allows partial responses to be retrieved. See
  66236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66237. // for more information.
  66238. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  66239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66240. return c
  66241. }
  66242. // Context sets the context to be used in this call's Do method. Any
  66243. // pending HTTP request will be aborted if the provided context is
  66244. // canceled.
  66245. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  66246. c.ctx_ = ctx
  66247. return c
  66248. }
  66249. // Header returns an http.Header that can be modified by the caller to
  66250. // add HTTP headers to the request.
  66251. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  66252. if c.header_ == nil {
  66253. c.header_ = make(http.Header)
  66254. }
  66255. return c.header_
  66256. }
  66257. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  66258. reqHeaders := make(http.Header)
  66259. for k, v := range c.header_ {
  66260. reqHeaders[k] = v
  66261. }
  66262. reqHeaders.Set("User-Agent", c.s.userAgent())
  66263. var body io.Reader = nil
  66264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  66265. if err != nil {
  66266. return nil, err
  66267. }
  66268. reqHeaders.Set("Content-Type", "application/json")
  66269. c.urlParams_.Set("alt", alt)
  66270. c.urlParams_.Set("prettyPrint", "false")
  66271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  66272. urls += "?" + c.urlParams_.Encode()
  66273. req, err := http.NewRequest("POST", urls, body)
  66274. if err != nil {
  66275. return nil, err
  66276. }
  66277. req.Header = reqHeaders
  66278. googleapi.Expand(req.URL, map[string]string{
  66279. "project": c.project,
  66280. })
  66281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66282. }
  66283. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  66284. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66285. // status code is an error. Response headers are in either
  66286. // *Operation.ServerResponse.Header or (if a response was returned at
  66287. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66288. // to check whether the returned error was because
  66289. // http.StatusNotModified was returned.
  66290. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66291. gensupport.SetOptions(c.urlParams_, opts...)
  66292. res, err := c.doRequest("json")
  66293. if res != nil && res.StatusCode == http.StatusNotModified {
  66294. if res.Body != nil {
  66295. res.Body.Close()
  66296. }
  66297. return nil, &googleapi.Error{
  66298. Code: res.StatusCode,
  66299. Header: res.Header,
  66300. }
  66301. }
  66302. if err != nil {
  66303. return nil, err
  66304. }
  66305. defer googleapi.CloseBody(res)
  66306. if err := googleapi.CheckResponse(res); err != nil {
  66307. return nil, err
  66308. }
  66309. ret := &Operation{
  66310. ServerResponse: googleapi.ServerResponse{
  66311. Header: res.Header,
  66312. HTTPStatusCode: res.StatusCode,
  66313. },
  66314. }
  66315. target := &ret
  66316. if err := gensupport.DecodeResponse(target, res); err != nil {
  66317. return nil, err
  66318. }
  66319. return ret, nil
  66320. // {
  66321. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  66322. // "httpMethod": "POST",
  66323. // "id": "compute.projects.setCommonInstanceMetadata",
  66324. // "parameterOrder": [
  66325. // "project"
  66326. // ],
  66327. // "parameters": {
  66328. // "project": {
  66329. // "description": "Project ID for this request.",
  66330. // "location": "path",
  66331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66332. // "required": true,
  66333. // "type": "string"
  66334. // },
  66335. // "requestId": {
  66336. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66337. // "location": "query",
  66338. // "type": "string"
  66339. // }
  66340. // },
  66341. // "path": "{project}/setCommonInstanceMetadata",
  66342. // "request": {
  66343. // "$ref": "Metadata"
  66344. // },
  66345. // "response": {
  66346. // "$ref": "Operation"
  66347. // },
  66348. // "scopes": [
  66349. // "https://www.googleapis.com/auth/cloud-platform",
  66350. // "https://www.googleapis.com/auth/compute"
  66351. // ]
  66352. // }
  66353. }
  66354. // method id "compute.projects.setDefaultNetworkTier":
  66355. type ProjectsSetDefaultNetworkTierCall struct {
  66356. s *Service
  66357. project string
  66358. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  66359. urlParams_ gensupport.URLParams
  66360. ctx_ context.Context
  66361. header_ http.Header
  66362. }
  66363. // SetDefaultNetworkTier: Sets the default network tier of the project.
  66364. // The default network tier is used when an
  66365. // address/forwardingRule/instance is created without specifying the
  66366. // network tier field.
  66367. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  66368. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66369. c.project = project
  66370. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  66371. return c
  66372. }
  66373. // RequestId sets the optional parameter "requestId": An optional
  66374. // request ID to identify requests. Specify a unique request ID so that
  66375. // if you must retry your request, the server will know to ignore the
  66376. // request if it has already been completed.
  66377. //
  66378. // For example, consider a situation where you make an initial request
  66379. // and the request times out. If you make the request again with the
  66380. // same request ID, the server can check if original operation with the
  66381. // same request ID was received, and if so, will ignore the second
  66382. // request. This prevents clients from accidentally creating duplicate
  66383. // commitments.
  66384. //
  66385. // The request ID must be a valid UUID with the exception that zero UUID
  66386. // is not supported (00000000-0000-0000-0000-000000000000).
  66387. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  66388. c.urlParams_.Set("requestId", requestId)
  66389. return c
  66390. }
  66391. // Fields allows partial responses to be retrieved. See
  66392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66393. // for more information.
  66394. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  66395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66396. return c
  66397. }
  66398. // Context sets the context to be used in this call's Do method. Any
  66399. // pending HTTP request will be aborted if the provided context is
  66400. // canceled.
  66401. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  66402. c.ctx_ = ctx
  66403. return c
  66404. }
  66405. // Header returns an http.Header that can be modified by the caller to
  66406. // add HTTP headers to the request.
  66407. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  66408. if c.header_ == nil {
  66409. c.header_ = make(http.Header)
  66410. }
  66411. return c.header_
  66412. }
  66413. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  66414. reqHeaders := make(http.Header)
  66415. for k, v := range c.header_ {
  66416. reqHeaders[k] = v
  66417. }
  66418. reqHeaders.Set("User-Agent", c.s.userAgent())
  66419. var body io.Reader = nil
  66420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  66421. if err != nil {
  66422. return nil, err
  66423. }
  66424. reqHeaders.Set("Content-Type", "application/json")
  66425. c.urlParams_.Set("alt", alt)
  66426. c.urlParams_.Set("prettyPrint", "false")
  66427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  66428. urls += "?" + c.urlParams_.Encode()
  66429. req, err := http.NewRequest("POST", urls, body)
  66430. if err != nil {
  66431. return nil, err
  66432. }
  66433. req.Header = reqHeaders
  66434. googleapi.Expand(req.URL, map[string]string{
  66435. "project": c.project,
  66436. })
  66437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66438. }
  66439. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  66440. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66441. // status code is an error. Response headers are in either
  66442. // *Operation.ServerResponse.Header or (if a response was returned at
  66443. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66444. // to check whether the returned error was because
  66445. // http.StatusNotModified was returned.
  66446. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66447. gensupport.SetOptions(c.urlParams_, opts...)
  66448. res, err := c.doRequest("json")
  66449. if res != nil && res.StatusCode == http.StatusNotModified {
  66450. if res.Body != nil {
  66451. res.Body.Close()
  66452. }
  66453. return nil, &googleapi.Error{
  66454. Code: res.StatusCode,
  66455. Header: res.Header,
  66456. }
  66457. }
  66458. if err != nil {
  66459. return nil, err
  66460. }
  66461. defer googleapi.CloseBody(res)
  66462. if err := googleapi.CheckResponse(res); err != nil {
  66463. return nil, err
  66464. }
  66465. ret := &Operation{
  66466. ServerResponse: googleapi.ServerResponse{
  66467. Header: res.Header,
  66468. HTTPStatusCode: res.StatusCode,
  66469. },
  66470. }
  66471. target := &ret
  66472. if err := gensupport.DecodeResponse(target, res); err != nil {
  66473. return nil, err
  66474. }
  66475. return ret, nil
  66476. // {
  66477. // "description": "Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.",
  66478. // "httpMethod": "POST",
  66479. // "id": "compute.projects.setDefaultNetworkTier",
  66480. // "parameterOrder": [
  66481. // "project"
  66482. // ],
  66483. // "parameters": {
  66484. // "project": {
  66485. // "description": "Project ID for this request.",
  66486. // "location": "path",
  66487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66488. // "required": true,
  66489. // "type": "string"
  66490. // },
  66491. // "requestId": {
  66492. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66493. // "location": "query",
  66494. // "type": "string"
  66495. // }
  66496. // },
  66497. // "path": "{project}/setDefaultNetworkTier",
  66498. // "request": {
  66499. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  66500. // },
  66501. // "response": {
  66502. // "$ref": "Operation"
  66503. // },
  66504. // "scopes": [
  66505. // "https://www.googleapis.com/auth/cloud-platform",
  66506. // "https://www.googleapis.com/auth/compute"
  66507. // ]
  66508. // }
  66509. }
  66510. // method id "compute.projects.setUsageExportBucket":
  66511. type ProjectsSetUsageExportBucketCall struct {
  66512. s *Service
  66513. project string
  66514. usageexportlocation *UsageExportLocation
  66515. urlParams_ gensupport.URLParams
  66516. ctx_ context.Context
  66517. header_ http.Header
  66518. }
  66519. // SetUsageExportBucket: Enables the usage export feature and sets the
  66520. // usage export bucket where reports are stored. If you provide an empty
  66521. // request body using this method, the usage export feature will be
  66522. // disabled.
  66523. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  66524. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  66525. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66526. c.project = project
  66527. c.usageexportlocation = usageexportlocation
  66528. return c
  66529. }
  66530. // RequestId sets the optional parameter "requestId": An optional
  66531. // request ID to identify requests. Specify a unique request ID so that
  66532. // if you must retry your request, the server will know to ignore the
  66533. // request if it has already been completed.
  66534. //
  66535. // For example, consider a situation where you make an initial request
  66536. // and the request times out. If you make the request again with the
  66537. // same request ID, the server can check if original operation with the
  66538. // same request ID was received, and if so, will ignore the second
  66539. // request. This prevents clients from accidentally creating duplicate
  66540. // commitments.
  66541. //
  66542. // The request ID must be a valid UUID with the exception that zero UUID
  66543. // is not supported (00000000-0000-0000-0000-000000000000).
  66544. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  66545. c.urlParams_.Set("requestId", requestId)
  66546. return c
  66547. }
  66548. // Fields allows partial responses to be retrieved. See
  66549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66550. // for more information.
  66551. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  66552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66553. return c
  66554. }
  66555. // Context sets the context to be used in this call's Do method. Any
  66556. // pending HTTP request will be aborted if the provided context is
  66557. // canceled.
  66558. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  66559. c.ctx_ = ctx
  66560. return c
  66561. }
  66562. // Header returns an http.Header that can be modified by the caller to
  66563. // add HTTP headers to the request.
  66564. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  66565. if c.header_ == nil {
  66566. c.header_ = make(http.Header)
  66567. }
  66568. return c.header_
  66569. }
  66570. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  66571. reqHeaders := make(http.Header)
  66572. for k, v := range c.header_ {
  66573. reqHeaders[k] = v
  66574. }
  66575. reqHeaders.Set("User-Agent", c.s.userAgent())
  66576. var body io.Reader = nil
  66577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  66578. if err != nil {
  66579. return nil, err
  66580. }
  66581. reqHeaders.Set("Content-Type", "application/json")
  66582. c.urlParams_.Set("alt", alt)
  66583. c.urlParams_.Set("prettyPrint", "false")
  66584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  66585. urls += "?" + c.urlParams_.Encode()
  66586. req, err := http.NewRequest("POST", urls, body)
  66587. if err != nil {
  66588. return nil, err
  66589. }
  66590. req.Header = reqHeaders
  66591. googleapi.Expand(req.URL, map[string]string{
  66592. "project": c.project,
  66593. })
  66594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66595. }
  66596. // Do executes the "compute.projects.setUsageExportBucket" call.
  66597. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66598. // status code is an error. Response headers are in either
  66599. // *Operation.ServerResponse.Header or (if a response was returned at
  66600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66601. // to check whether the returned error was because
  66602. // http.StatusNotModified was returned.
  66603. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66604. gensupport.SetOptions(c.urlParams_, opts...)
  66605. res, err := c.doRequest("json")
  66606. if res != nil && res.StatusCode == http.StatusNotModified {
  66607. if res.Body != nil {
  66608. res.Body.Close()
  66609. }
  66610. return nil, &googleapi.Error{
  66611. Code: res.StatusCode,
  66612. Header: res.Header,
  66613. }
  66614. }
  66615. if err != nil {
  66616. return nil, err
  66617. }
  66618. defer googleapi.CloseBody(res)
  66619. if err := googleapi.CheckResponse(res); err != nil {
  66620. return nil, err
  66621. }
  66622. ret := &Operation{
  66623. ServerResponse: googleapi.ServerResponse{
  66624. Header: res.Header,
  66625. HTTPStatusCode: res.StatusCode,
  66626. },
  66627. }
  66628. target := &ret
  66629. if err := gensupport.DecodeResponse(target, res); err != nil {
  66630. return nil, err
  66631. }
  66632. return ret, nil
  66633. // {
  66634. // "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.",
  66635. // "httpMethod": "POST",
  66636. // "id": "compute.projects.setUsageExportBucket",
  66637. // "parameterOrder": [
  66638. // "project"
  66639. // ],
  66640. // "parameters": {
  66641. // "project": {
  66642. // "description": "Project ID for this request.",
  66643. // "location": "path",
  66644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66645. // "required": true,
  66646. // "type": "string"
  66647. // },
  66648. // "requestId": {
  66649. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66650. // "location": "query",
  66651. // "type": "string"
  66652. // }
  66653. // },
  66654. // "path": "{project}/setUsageExportBucket",
  66655. // "request": {
  66656. // "$ref": "UsageExportLocation"
  66657. // },
  66658. // "response": {
  66659. // "$ref": "Operation"
  66660. // },
  66661. // "scopes": [
  66662. // "https://www.googleapis.com/auth/cloud-platform",
  66663. // "https://www.googleapis.com/auth/compute",
  66664. // "https://www.googleapis.com/auth/devstorage.full_control",
  66665. // "https://www.googleapis.com/auth/devstorage.read_only",
  66666. // "https://www.googleapis.com/auth/devstorage.read_write"
  66667. // ]
  66668. // }
  66669. }
  66670. // method id "compute.regionAutoscalers.delete":
  66671. type RegionAutoscalersDeleteCall struct {
  66672. s *Service
  66673. project string
  66674. region string
  66675. autoscaler string
  66676. urlParams_ gensupport.URLParams
  66677. ctx_ context.Context
  66678. header_ http.Header
  66679. }
  66680. // Delete: Deletes the specified autoscaler.
  66681. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  66682. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66683. c.project = project
  66684. c.region = region
  66685. c.autoscaler = autoscaler
  66686. return c
  66687. }
  66688. // RequestId sets the optional parameter "requestId": An optional
  66689. // request ID to identify requests. Specify a unique request ID so that
  66690. // if you must retry your request, the server will know to ignore the
  66691. // request if it has already been completed.
  66692. //
  66693. // For example, consider a situation where you make an initial request
  66694. // and the request times out. If you make the request again with the
  66695. // same request ID, the server can check if original operation with the
  66696. // same request ID was received, and if so, will ignore the second
  66697. // request. This prevents clients from accidentally creating duplicate
  66698. // commitments.
  66699. //
  66700. // The request ID must be a valid UUID with the exception that zero UUID
  66701. // is not supported (00000000-0000-0000-0000-000000000000).
  66702. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  66703. c.urlParams_.Set("requestId", requestId)
  66704. return c
  66705. }
  66706. // Fields allows partial responses to be retrieved. See
  66707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66708. // for more information.
  66709. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  66710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66711. return c
  66712. }
  66713. // Context sets the context to be used in this call's Do method. Any
  66714. // pending HTTP request will be aborted if the provided context is
  66715. // canceled.
  66716. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  66717. c.ctx_ = ctx
  66718. return c
  66719. }
  66720. // Header returns an http.Header that can be modified by the caller to
  66721. // add HTTP headers to the request.
  66722. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  66723. if c.header_ == nil {
  66724. c.header_ = make(http.Header)
  66725. }
  66726. return c.header_
  66727. }
  66728. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  66729. reqHeaders := make(http.Header)
  66730. for k, v := range c.header_ {
  66731. reqHeaders[k] = v
  66732. }
  66733. reqHeaders.Set("User-Agent", c.s.userAgent())
  66734. var body io.Reader = nil
  66735. c.urlParams_.Set("alt", alt)
  66736. c.urlParams_.Set("prettyPrint", "false")
  66737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  66738. urls += "?" + c.urlParams_.Encode()
  66739. req, err := http.NewRequest("DELETE", urls, body)
  66740. if err != nil {
  66741. return nil, err
  66742. }
  66743. req.Header = reqHeaders
  66744. googleapi.Expand(req.URL, map[string]string{
  66745. "project": c.project,
  66746. "region": c.region,
  66747. "autoscaler": c.autoscaler,
  66748. })
  66749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66750. }
  66751. // Do executes the "compute.regionAutoscalers.delete" call.
  66752. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66753. // status code is an error. Response headers are in either
  66754. // *Operation.ServerResponse.Header or (if a response was returned at
  66755. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66756. // to check whether the returned error was because
  66757. // http.StatusNotModified was returned.
  66758. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66759. gensupport.SetOptions(c.urlParams_, opts...)
  66760. res, err := c.doRequest("json")
  66761. if res != nil && res.StatusCode == http.StatusNotModified {
  66762. if res.Body != nil {
  66763. res.Body.Close()
  66764. }
  66765. return nil, &googleapi.Error{
  66766. Code: res.StatusCode,
  66767. Header: res.Header,
  66768. }
  66769. }
  66770. if err != nil {
  66771. return nil, err
  66772. }
  66773. defer googleapi.CloseBody(res)
  66774. if err := googleapi.CheckResponse(res); err != nil {
  66775. return nil, err
  66776. }
  66777. ret := &Operation{
  66778. ServerResponse: googleapi.ServerResponse{
  66779. Header: res.Header,
  66780. HTTPStatusCode: res.StatusCode,
  66781. },
  66782. }
  66783. target := &ret
  66784. if err := gensupport.DecodeResponse(target, res); err != nil {
  66785. return nil, err
  66786. }
  66787. return ret, nil
  66788. // {
  66789. // "description": "Deletes the specified autoscaler.",
  66790. // "httpMethod": "DELETE",
  66791. // "id": "compute.regionAutoscalers.delete",
  66792. // "parameterOrder": [
  66793. // "project",
  66794. // "region",
  66795. // "autoscaler"
  66796. // ],
  66797. // "parameters": {
  66798. // "autoscaler": {
  66799. // "description": "Name of the autoscaler to delete.",
  66800. // "location": "path",
  66801. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66802. // "required": true,
  66803. // "type": "string"
  66804. // },
  66805. // "project": {
  66806. // "description": "Project ID for this request.",
  66807. // "location": "path",
  66808. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66809. // "required": true,
  66810. // "type": "string"
  66811. // },
  66812. // "region": {
  66813. // "description": "Name of the region scoping this request.",
  66814. // "location": "path",
  66815. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66816. // "required": true,
  66817. // "type": "string"
  66818. // },
  66819. // "requestId": {
  66820. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66821. // "location": "query",
  66822. // "type": "string"
  66823. // }
  66824. // },
  66825. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  66826. // "response": {
  66827. // "$ref": "Operation"
  66828. // },
  66829. // "scopes": [
  66830. // "https://www.googleapis.com/auth/cloud-platform",
  66831. // "https://www.googleapis.com/auth/compute"
  66832. // ]
  66833. // }
  66834. }
  66835. // method id "compute.regionAutoscalers.get":
  66836. type RegionAutoscalersGetCall struct {
  66837. s *Service
  66838. project string
  66839. region string
  66840. autoscaler string
  66841. urlParams_ gensupport.URLParams
  66842. ifNoneMatch_ string
  66843. ctx_ context.Context
  66844. header_ http.Header
  66845. }
  66846. // Get: Returns the specified autoscaler.
  66847. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  66848. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66849. c.project = project
  66850. c.region = region
  66851. c.autoscaler = autoscaler
  66852. return c
  66853. }
  66854. // Fields allows partial responses to be retrieved. See
  66855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66856. // for more information.
  66857. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  66858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66859. return c
  66860. }
  66861. // IfNoneMatch sets the optional parameter which makes the operation
  66862. // fail if the object's ETag matches the given value. This is useful for
  66863. // getting updates only after the object has changed since the last
  66864. // request. Use googleapi.IsNotModified to check whether the response
  66865. // error from Do is the result of In-None-Match.
  66866. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  66867. c.ifNoneMatch_ = entityTag
  66868. return c
  66869. }
  66870. // Context sets the context to be used in this call's Do method. Any
  66871. // pending HTTP request will be aborted if the provided context is
  66872. // canceled.
  66873. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  66874. c.ctx_ = ctx
  66875. return c
  66876. }
  66877. // Header returns an http.Header that can be modified by the caller to
  66878. // add HTTP headers to the request.
  66879. func (c *RegionAutoscalersGetCall) Header() http.Header {
  66880. if c.header_ == nil {
  66881. c.header_ = make(http.Header)
  66882. }
  66883. return c.header_
  66884. }
  66885. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  66886. reqHeaders := make(http.Header)
  66887. for k, v := range c.header_ {
  66888. reqHeaders[k] = v
  66889. }
  66890. reqHeaders.Set("User-Agent", c.s.userAgent())
  66891. if c.ifNoneMatch_ != "" {
  66892. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66893. }
  66894. var body io.Reader = nil
  66895. c.urlParams_.Set("alt", alt)
  66896. c.urlParams_.Set("prettyPrint", "false")
  66897. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  66898. urls += "?" + c.urlParams_.Encode()
  66899. req, err := http.NewRequest("GET", urls, body)
  66900. if err != nil {
  66901. return nil, err
  66902. }
  66903. req.Header = reqHeaders
  66904. googleapi.Expand(req.URL, map[string]string{
  66905. "project": c.project,
  66906. "region": c.region,
  66907. "autoscaler": c.autoscaler,
  66908. })
  66909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66910. }
  66911. // Do executes the "compute.regionAutoscalers.get" call.
  66912. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  66913. // status code is an error. Response headers are in either
  66914. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  66915. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66916. // to check whether the returned error was because
  66917. // http.StatusNotModified was returned.
  66918. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  66919. gensupport.SetOptions(c.urlParams_, opts...)
  66920. res, err := c.doRequest("json")
  66921. if res != nil && res.StatusCode == http.StatusNotModified {
  66922. if res.Body != nil {
  66923. res.Body.Close()
  66924. }
  66925. return nil, &googleapi.Error{
  66926. Code: res.StatusCode,
  66927. Header: res.Header,
  66928. }
  66929. }
  66930. if err != nil {
  66931. return nil, err
  66932. }
  66933. defer googleapi.CloseBody(res)
  66934. if err := googleapi.CheckResponse(res); err != nil {
  66935. return nil, err
  66936. }
  66937. ret := &Autoscaler{
  66938. ServerResponse: googleapi.ServerResponse{
  66939. Header: res.Header,
  66940. HTTPStatusCode: res.StatusCode,
  66941. },
  66942. }
  66943. target := &ret
  66944. if err := gensupport.DecodeResponse(target, res); err != nil {
  66945. return nil, err
  66946. }
  66947. return ret, nil
  66948. // {
  66949. // "description": "Returns the specified autoscaler.",
  66950. // "httpMethod": "GET",
  66951. // "id": "compute.regionAutoscalers.get",
  66952. // "parameterOrder": [
  66953. // "project",
  66954. // "region",
  66955. // "autoscaler"
  66956. // ],
  66957. // "parameters": {
  66958. // "autoscaler": {
  66959. // "description": "Name of the autoscaler to return.",
  66960. // "location": "path",
  66961. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66962. // "required": true,
  66963. // "type": "string"
  66964. // },
  66965. // "project": {
  66966. // "description": "Project ID for this request.",
  66967. // "location": "path",
  66968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66969. // "required": true,
  66970. // "type": "string"
  66971. // },
  66972. // "region": {
  66973. // "description": "Name of the region scoping this request.",
  66974. // "location": "path",
  66975. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66976. // "required": true,
  66977. // "type": "string"
  66978. // }
  66979. // },
  66980. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  66981. // "response": {
  66982. // "$ref": "Autoscaler"
  66983. // },
  66984. // "scopes": [
  66985. // "https://www.googleapis.com/auth/cloud-platform",
  66986. // "https://www.googleapis.com/auth/compute",
  66987. // "https://www.googleapis.com/auth/compute.readonly"
  66988. // ]
  66989. // }
  66990. }
  66991. // method id "compute.regionAutoscalers.insert":
  66992. type RegionAutoscalersInsertCall struct {
  66993. s *Service
  66994. project string
  66995. region string
  66996. autoscaler *Autoscaler
  66997. urlParams_ gensupport.URLParams
  66998. ctx_ context.Context
  66999. header_ http.Header
  67000. }
  67001. // Insert: Creates an autoscaler in the specified project using the data
  67002. // included in the request.
  67003. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  67004. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67005. c.project = project
  67006. c.region = region
  67007. c.autoscaler = autoscaler
  67008. return c
  67009. }
  67010. // RequestId sets the optional parameter "requestId": An optional
  67011. // request ID to identify requests. Specify a unique request ID so that
  67012. // if you must retry your request, the server will know to ignore the
  67013. // request if it has already been completed.
  67014. //
  67015. // For example, consider a situation where you make an initial request
  67016. // and the request times out. If you make the request again with the
  67017. // same request ID, the server can check if original operation with the
  67018. // same request ID was received, and if so, will ignore the second
  67019. // request. This prevents clients from accidentally creating duplicate
  67020. // commitments.
  67021. //
  67022. // The request ID must be a valid UUID with the exception that zero UUID
  67023. // is not supported (00000000-0000-0000-0000-000000000000).
  67024. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  67025. c.urlParams_.Set("requestId", requestId)
  67026. return c
  67027. }
  67028. // Fields allows partial responses to be retrieved. See
  67029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67030. // for more information.
  67031. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  67032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67033. return c
  67034. }
  67035. // Context sets the context to be used in this call's Do method. Any
  67036. // pending HTTP request will be aborted if the provided context is
  67037. // canceled.
  67038. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  67039. c.ctx_ = ctx
  67040. return c
  67041. }
  67042. // Header returns an http.Header that can be modified by the caller to
  67043. // add HTTP headers to the request.
  67044. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  67045. if c.header_ == nil {
  67046. c.header_ = make(http.Header)
  67047. }
  67048. return c.header_
  67049. }
  67050. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  67051. reqHeaders := make(http.Header)
  67052. for k, v := range c.header_ {
  67053. reqHeaders[k] = v
  67054. }
  67055. reqHeaders.Set("User-Agent", c.s.userAgent())
  67056. var body io.Reader = nil
  67057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  67058. if err != nil {
  67059. return nil, err
  67060. }
  67061. reqHeaders.Set("Content-Type", "application/json")
  67062. c.urlParams_.Set("alt", alt)
  67063. c.urlParams_.Set("prettyPrint", "false")
  67064. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67065. urls += "?" + c.urlParams_.Encode()
  67066. req, err := http.NewRequest("POST", urls, body)
  67067. if err != nil {
  67068. return nil, err
  67069. }
  67070. req.Header = reqHeaders
  67071. googleapi.Expand(req.URL, map[string]string{
  67072. "project": c.project,
  67073. "region": c.region,
  67074. })
  67075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67076. }
  67077. // Do executes the "compute.regionAutoscalers.insert" call.
  67078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67079. // status code is an error. Response headers are in either
  67080. // *Operation.ServerResponse.Header or (if a response was returned at
  67081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67082. // to check whether the returned error was because
  67083. // http.StatusNotModified was returned.
  67084. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67085. gensupport.SetOptions(c.urlParams_, opts...)
  67086. res, err := c.doRequest("json")
  67087. if res != nil && res.StatusCode == http.StatusNotModified {
  67088. if res.Body != nil {
  67089. res.Body.Close()
  67090. }
  67091. return nil, &googleapi.Error{
  67092. Code: res.StatusCode,
  67093. Header: res.Header,
  67094. }
  67095. }
  67096. if err != nil {
  67097. return nil, err
  67098. }
  67099. defer googleapi.CloseBody(res)
  67100. if err := googleapi.CheckResponse(res); err != nil {
  67101. return nil, err
  67102. }
  67103. ret := &Operation{
  67104. ServerResponse: googleapi.ServerResponse{
  67105. Header: res.Header,
  67106. HTTPStatusCode: res.StatusCode,
  67107. },
  67108. }
  67109. target := &ret
  67110. if err := gensupport.DecodeResponse(target, res); err != nil {
  67111. return nil, err
  67112. }
  67113. return ret, nil
  67114. // {
  67115. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  67116. // "httpMethod": "POST",
  67117. // "id": "compute.regionAutoscalers.insert",
  67118. // "parameterOrder": [
  67119. // "project",
  67120. // "region"
  67121. // ],
  67122. // "parameters": {
  67123. // "project": {
  67124. // "description": "Project ID for this request.",
  67125. // "location": "path",
  67126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67127. // "required": true,
  67128. // "type": "string"
  67129. // },
  67130. // "region": {
  67131. // "description": "Name of the region scoping this request.",
  67132. // "location": "path",
  67133. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67134. // "required": true,
  67135. // "type": "string"
  67136. // },
  67137. // "requestId": {
  67138. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67139. // "location": "query",
  67140. // "type": "string"
  67141. // }
  67142. // },
  67143. // "path": "{project}/regions/{region}/autoscalers",
  67144. // "request": {
  67145. // "$ref": "Autoscaler"
  67146. // },
  67147. // "response": {
  67148. // "$ref": "Operation"
  67149. // },
  67150. // "scopes": [
  67151. // "https://www.googleapis.com/auth/cloud-platform",
  67152. // "https://www.googleapis.com/auth/compute"
  67153. // ]
  67154. // }
  67155. }
  67156. // method id "compute.regionAutoscalers.list":
  67157. type RegionAutoscalersListCall struct {
  67158. s *Service
  67159. project string
  67160. region string
  67161. urlParams_ gensupport.URLParams
  67162. ifNoneMatch_ string
  67163. ctx_ context.Context
  67164. header_ http.Header
  67165. }
  67166. // List: Retrieves a list of autoscalers contained within the specified
  67167. // region.
  67168. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  67169. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67170. c.project = project
  67171. c.region = region
  67172. return c
  67173. }
  67174. // Filter sets the optional parameter "filter": A filter expression that
  67175. // filters resources listed in the response. The expression must specify
  67176. // the field name, a comparison operator, and the value that you want to
  67177. // use for filtering. The value must be a string, a number, or a
  67178. // boolean. The comparison operator must be either =, !=, >, or <.
  67179. //
  67180. // For example, if you are filtering Compute Engine instances, you can
  67181. // exclude instances named example-instance by specifying name !=
  67182. // example-instance.
  67183. //
  67184. // You can also filter nested fields. For example, you could specify
  67185. // scheduling.automaticRestart = false to include instances only if they
  67186. // are not scheduled for automatic restarts. You can use filtering on
  67187. // nested fields to filter based on resource labels.
  67188. //
  67189. // To filter on multiple expressions, provide each separate expression
  67190. // within parentheses. For example, (scheduling.automaticRestart = true)
  67191. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67192. // AND expression. However, you can include AND and OR expressions
  67193. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67194. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67195. // true).
  67196. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  67197. c.urlParams_.Set("filter", filter)
  67198. return c
  67199. }
  67200. // MaxResults sets the optional parameter "maxResults": The maximum
  67201. // number of results per page that should be returned. If the number of
  67202. // available results is larger than maxResults, Compute Engine returns a
  67203. // nextPageToken that can be used to get the next page of results in
  67204. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67205. // (Default: 500)
  67206. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  67207. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67208. return c
  67209. }
  67210. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67211. // a certain order. By default, results are returned in alphanumerical
  67212. // order based on the resource name.
  67213. //
  67214. // You can also sort results in descending order based on the creation
  67215. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67216. // based on the creationTimestamp field in reverse chronological order
  67217. // (newest result first). Use this to sort resources like operations so
  67218. // that the newest operation is returned first.
  67219. //
  67220. // Currently, only sorting by name or creationTimestamp desc is
  67221. // supported.
  67222. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  67223. c.urlParams_.Set("orderBy", orderBy)
  67224. return c
  67225. }
  67226. // PageToken sets the optional parameter "pageToken": Specifies a page
  67227. // token to use. Set pageToken to the nextPageToken returned by a
  67228. // previous list request to get the next page of results.
  67229. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  67230. c.urlParams_.Set("pageToken", pageToken)
  67231. return c
  67232. }
  67233. // Fields allows partial responses to be retrieved. See
  67234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67235. // for more information.
  67236. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  67237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67238. return c
  67239. }
  67240. // IfNoneMatch sets the optional parameter which makes the operation
  67241. // fail if the object's ETag matches the given value. This is useful for
  67242. // getting updates only after the object has changed since the last
  67243. // request. Use googleapi.IsNotModified to check whether the response
  67244. // error from Do is the result of In-None-Match.
  67245. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  67246. c.ifNoneMatch_ = entityTag
  67247. return c
  67248. }
  67249. // Context sets the context to be used in this call's Do method. Any
  67250. // pending HTTP request will be aborted if the provided context is
  67251. // canceled.
  67252. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  67253. c.ctx_ = ctx
  67254. return c
  67255. }
  67256. // Header returns an http.Header that can be modified by the caller to
  67257. // add HTTP headers to the request.
  67258. func (c *RegionAutoscalersListCall) Header() http.Header {
  67259. if c.header_ == nil {
  67260. c.header_ = make(http.Header)
  67261. }
  67262. return c.header_
  67263. }
  67264. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  67265. reqHeaders := make(http.Header)
  67266. for k, v := range c.header_ {
  67267. reqHeaders[k] = v
  67268. }
  67269. reqHeaders.Set("User-Agent", c.s.userAgent())
  67270. if c.ifNoneMatch_ != "" {
  67271. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67272. }
  67273. var body io.Reader = nil
  67274. c.urlParams_.Set("alt", alt)
  67275. c.urlParams_.Set("prettyPrint", "false")
  67276. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67277. urls += "?" + c.urlParams_.Encode()
  67278. req, err := http.NewRequest("GET", urls, body)
  67279. if err != nil {
  67280. return nil, err
  67281. }
  67282. req.Header = reqHeaders
  67283. googleapi.Expand(req.URL, map[string]string{
  67284. "project": c.project,
  67285. "region": c.region,
  67286. })
  67287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67288. }
  67289. // Do executes the "compute.regionAutoscalers.list" call.
  67290. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  67291. // non-2xx status code is an error. Response headers are in either
  67292. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  67293. // returned at all) in error.(*googleapi.Error).Header. Use
  67294. // googleapi.IsNotModified to check whether the returned error was
  67295. // because http.StatusNotModified was returned.
  67296. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  67297. gensupport.SetOptions(c.urlParams_, opts...)
  67298. res, err := c.doRequest("json")
  67299. if res != nil && res.StatusCode == http.StatusNotModified {
  67300. if res.Body != nil {
  67301. res.Body.Close()
  67302. }
  67303. return nil, &googleapi.Error{
  67304. Code: res.StatusCode,
  67305. Header: res.Header,
  67306. }
  67307. }
  67308. if err != nil {
  67309. return nil, err
  67310. }
  67311. defer googleapi.CloseBody(res)
  67312. if err := googleapi.CheckResponse(res); err != nil {
  67313. return nil, err
  67314. }
  67315. ret := &RegionAutoscalerList{
  67316. ServerResponse: googleapi.ServerResponse{
  67317. Header: res.Header,
  67318. HTTPStatusCode: res.StatusCode,
  67319. },
  67320. }
  67321. target := &ret
  67322. if err := gensupport.DecodeResponse(target, res); err != nil {
  67323. return nil, err
  67324. }
  67325. return ret, nil
  67326. // {
  67327. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  67328. // "httpMethod": "GET",
  67329. // "id": "compute.regionAutoscalers.list",
  67330. // "parameterOrder": [
  67331. // "project",
  67332. // "region"
  67333. // ],
  67334. // "parameters": {
  67335. // "filter": {
  67336. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67337. // "location": "query",
  67338. // "type": "string"
  67339. // },
  67340. // "maxResults": {
  67341. // "default": "500",
  67342. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67343. // "format": "uint32",
  67344. // "location": "query",
  67345. // "minimum": "0",
  67346. // "type": "integer"
  67347. // },
  67348. // "orderBy": {
  67349. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67350. // "location": "query",
  67351. // "type": "string"
  67352. // },
  67353. // "pageToken": {
  67354. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67355. // "location": "query",
  67356. // "type": "string"
  67357. // },
  67358. // "project": {
  67359. // "description": "Project ID for this request.",
  67360. // "location": "path",
  67361. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67362. // "required": true,
  67363. // "type": "string"
  67364. // },
  67365. // "region": {
  67366. // "description": "Name of the region scoping this request.",
  67367. // "location": "path",
  67368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67369. // "required": true,
  67370. // "type": "string"
  67371. // }
  67372. // },
  67373. // "path": "{project}/regions/{region}/autoscalers",
  67374. // "response": {
  67375. // "$ref": "RegionAutoscalerList"
  67376. // },
  67377. // "scopes": [
  67378. // "https://www.googleapis.com/auth/cloud-platform",
  67379. // "https://www.googleapis.com/auth/compute",
  67380. // "https://www.googleapis.com/auth/compute.readonly"
  67381. // ]
  67382. // }
  67383. }
  67384. // Pages invokes f for each page of results.
  67385. // A non-nil error returned from f will halt the iteration.
  67386. // The provided context supersedes any context provided to the Context method.
  67387. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  67388. c.ctx_ = ctx
  67389. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67390. for {
  67391. x, err := c.Do()
  67392. if err != nil {
  67393. return err
  67394. }
  67395. if err := f(x); err != nil {
  67396. return err
  67397. }
  67398. if x.NextPageToken == "" {
  67399. return nil
  67400. }
  67401. c.PageToken(x.NextPageToken)
  67402. }
  67403. }
  67404. // method id "compute.regionAutoscalers.patch":
  67405. type RegionAutoscalersPatchCall struct {
  67406. s *Service
  67407. project string
  67408. region string
  67409. autoscaler *Autoscaler
  67410. urlParams_ gensupport.URLParams
  67411. ctx_ context.Context
  67412. header_ http.Header
  67413. }
  67414. // Patch: Updates an autoscaler in the specified project using the data
  67415. // included in the request. This method supports PATCH semantics and
  67416. // uses the JSON merge patch format and processing rules.
  67417. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  67418. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67419. c.project = project
  67420. c.region = region
  67421. c.autoscaler = autoscaler
  67422. return c
  67423. }
  67424. // Autoscaler sets the optional parameter "autoscaler": Name of the
  67425. // autoscaler to patch.
  67426. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  67427. c.urlParams_.Set("autoscaler", autoscaler)
  67428. return c
  67429. }
  67430. // RequestId sets the optional parameter "requestId": An optional
  67431. // request ID to identify requests. Specify a unique request ID so that
  67432. // if you must retry your request, the server will know to ignore the
  67433. // request if it has already been completed.
  67434. //
  67435. // For example, consider a situation where you make an initial request
  67436. // and the request times out. If you make the request again with the
  67437. // same request ID, the server can check if original operation with the
  67438. // same request ID was received, and if so, will ignore the second
  67439. // request. This prevents clients from accidentally creating duplicate
  67440. // commitments.
  67441. //
  67442. // The request ID must be a valid UUID with the exception that zero UUID
  67443. // is not supported (00000000-0000-0000-0000-000000000000).
  67444. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  67445. c.urlParams_.Set("requestId", requestId)
  67446. return c
  67447. }
  67448. // Fields allows partial responses to be retrieved. See
  67449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67450. // for more information.
  67451. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  67452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67453. return c
  67454. }
  67455. // Context sets the context to be used in this call's Do method. Any
  67456. // pending HTTP request will be aborted if the provided context is
  67457. // canceled.
  67458. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  67459. c.ctx_ = ctx
  67460. return c
  67461. }
  67462. // Header returns an http.Header that can be modified by the caller to
  67463. // add HTTP headers to the request.
  67464. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  67465. if c.header_ == nil {
  67466. c.header_ = make(http.Header)
  67467. }
  67468. return c.header_
  67469. }
  67470. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  67471. reqHeaders := make(http.Header)
  67472. for k, v := range c.header_ {
  67473. reqHeaders[k] = v
  67474. }
  67475. reqHeaders.Set("User-Agent", c.s.userAgent())
  67476. var body io.Reader = nil
  67477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  67478. if err != nil {
  67479. return nil, err
  67480. }
  67481. reqHeaders.Set("Content-Type", "application/json")
  67482. c.urlParams_.Set("alt", alt)
  67483. c.urlParams_.Set("prettyPrint", "false")
  67484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67485. urls += "?" + c.urlParams_.Encode()
  67486. req, err := http.NewRequest("PATCH", urls, body)
  67487. if err != nil {
  67488. return nil, err
  67489. }
  67490. req.Header = reqHeaders
  67491. googleapi.Expand(req.URL, map[string]string{
  67492. "project": c.project,
  67493. "region": c.region,
  67494. })
  67495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67496. }
  67497. // Do executes the "compute.regionAutoscalers.patch" call.
  67498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67499. // status code is an error. Response headers are in either
  67500. // *Operation.ServerResponse.Header or (if a response was returned at
  67501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67502. // to check whether the returned error was because
  67503. // http.StatusNotModified was returned.
  67504. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67505. gensupport.SetOptions(c.urlParams_, opts...)
  67506. res, err := c.doRequest("json")
  67507. if res != nil && res.StatusCode == http.StatusNotModified {
  67508. if res.Body != nil {
  67509. res.Body.Close()
  67510. }
  67511. return nil, &googleapi.Error{
  67512. Code: res.StatusCode,
  67513. Header: res.Header,
  67514. }
  67515. }
  67516. if err != nil {
  67517. return nil, err
  67518. }
  67519. defer googleapi.CloseBody(res)
  67520. if err := googleapi.CheckResponse(res); err != nil {
  67521. return nil, err
  67522. }
  67523. ret := &Operation{
  67524. ServerResponse: googleapi.ServerResponse{
  67525. Header: res.Header,
  67526. HTTPStatusCode: res.StatusCode,
  67527. },
  67528. }
  67529. target := &ret
  67530. if err := gensupport.DecodeResponse(target, res); err != nil {
  67531. return nil, err
  67532. }
  67533. return ret, nil
  67534. // {
  67535. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  67536. // "httpMethod": "PATCH",
  67537. // "id": "compute.regionAutoscalers.patch",
  67538. // "parameterOrder": [
  67539. // "project",
  67540. // "region"
  67541. // ],
  67542. // "parameters": {
  67543. // "autoscaler": {
  67544. // "description": "Name of the autoscaler to patch.",
  67545. // "location": "query",
  67546. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67547. // "type": "string"
  67548. // },
  67549. // "project": {
  67550. // "description": "Project ID for this request.",
  67551. // "location": "path",
  67552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67553. // "required": true,
  67554. // "type": "string"
  67555. // },
  67556. // "region": {
  67557. // "description": "Name of the region scoping this request.",
  67558. // "location": "path",
  67559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67560. // "required": true,
  67561. // "type": "string"
  67562. // },
  67563. // "requestId": {
  67564. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67565. // "location": "query",
  67566. // "type": "string"
  67567. // }
  67568. // },
  67569. // "path": "{project}/regions/{region}/autoscalers",
  67570. // "request": {
  67571. // "$ref": "Autoscaler"
  67572. // },
  67573. // "response": {
  67574. // "$ref": "Operation"
  67575. // },
  67576. // "scopes": [
  67577. // "https://www.googleapis.com/auth/cloud-platform",
  67578. // "https://www.googleapis.com/auth/compute"
  67579. // ]
  67580. // }
  67581. }
  67582. // method id "compute.regionAutoscalers.update":
  67583. type RegionAutoscalersUpdateCall struct {
  67584. s *Service
  67585. project string
  67586. region string
  67587. autoscaler *Autoscaler
  67588. urlParams_ gensupport.URLParams
  67589. ctx_ context.Context
  67590. header_ http.Header
  67591. }
  67592. // Update: Updates an autoscaler in the specified project using the data
  67593. // included in the request.
  67594. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  67595. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67596. c.project = project
  67597. c.region = region
  67598. c.autoscaler = autoscaler
  67599. return c
  67600. }
  67601. // Autoscaler sets the optional parameter "autoscaler": Name of the
  67602. // autoscaler to update.
  67603. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  67604. c.urlParams_.Set("autoscaler", autoscaler)
  67605. return c
  67606. }
  67607. // RequestId sets the optional parameter "requestId": An optional
  67608. // request ID to identify requests. Specify a unique request ID so that
  67609. // if you must retry your request, the server will know to ignore the
  67610. // request if it has already been completed.
  67611. //
  67612. // For example, consider a situation where you make an initial request
  67613. // and the request times out. If you make the request again with the
  67614. // same request ID, the server can check if original operation with the
  67615. // same request ID was received, and if so, will ignore the second
  67616. // request. This prevents clients from accidentally creating duplicate
  67617. // commitments.
  67618. //
  67619. // The request ID must be a valid UUID with the exception that zero UUID
  67620. // is not supported (00000000-0000-0000-0000-000000000000).
  67621. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  67622. c.urlParams_.Set("requestId", requestId)
  67623. return c
  67624. }
  67625. // Fields allows partial responses to be retrieved. See
  67626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67627. // for more information.
  67628. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  67629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67630. return c
  67631. }
  67632. // Context sets the context to be used in this call's Do method. Any
  67633. // pending HTTP request will be aborted if the provided context is
  67634. // canceled.
  67635. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  67636. c.ctx_ = ctx
  67637. return c
  67638. }
  67639. // Header returns an http.Header that can be modified by the caller to
  67640. // add HTTP headers to the request.
  67641. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  67642. if c.header_ == nil {
  67643. c.header_ = make(http.Header)
  67644. }
  67645. return c.header_
  67646. }
  67647. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  67648. reqHeaders := make(http.Header)
  67649. for k, v := range c.header_ {
  67650. reqHeaders[k] = v
  67651. }
  67652. reqHeaders.Set("User-Agent", c.s.userAgent())
  67653. var body io.Reader = nil
  67654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  67655. if err != nil {
  67656. return nil, err
  67657. }
  67658. reqHeaders.Set("Content-Type", "application/json")
  67659. c.urlParams_.Set("alt", alt)
  67660. c.urlParams_.Set("prettyPrint", "false")
  67661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  67662. urls += "?" + c.urlParams_.Encode()
  67663. req, err := http.NewRequest("PUT", urls, body)
  67664. if err != nil {
  67665. return nil, err
  67666. }
  67667. req.Header = reqHeaders
  67668. googleapi.Expand(req.URL, map[string]string{
  67669. "project": c.project,
  67670. "region": c.region,
  67671. })
  67672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67673. }
  67674. // Do executes the "compute.regionAutoscalers.update" call.
  67675. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67676. // status code is an error. Response headers are in either
  67677. // *Operation.ServerResponse.Header or (if a response was returned at
  67678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67679. // to check whether the returned error was because
  67680. // http.StatusNotModified was returned.
  67681. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67682. gensupport.SetOptions(c.urlParams_, opts...)
  67683. res, err := c.doRequest("json")
  67684. if res != nil && res.StatusCode == http.StatusNotModified {
  67685. if res.Body != nil {
  67686. res.Body.Close()
  67687. }
  67688. return nil, &googleapi.Error{
  67689. Code: res.StatusCode,
  67690. Header: res.Header,
  67691. }
  67692. }
  67693. if err != nil {
  67694. return nil, err
  67695. }
  67696. defer googleapi.CloseBody(res)
  67697. if err := googleapi.CheckResponse(res); err != nil {
  67698. return nil, err
  67699. }
  67700. ret := &Operation{
  67701. ServerResponse: googleapi.ServerResponse{
  67702. Header: res.Header,
  67703. HTTPStatusCode: res.StatusCode,
  67704. },
  67705. }
  67706. target := &ret
  67707. if err := gensupport.DecodeResponse(target, res); err != nil {
  67708. return nil, err
  67709. }
  67710. return ret, nil
  67711. // {
  67712. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  67713. // "httpMethod": "PUT",
  67714. // "id": "compute.regionAutoscalers.update",
  67715. // "parameterOrder": [
  67716. // "project",
  67717. // "region"
  67718. // ],
  67719. // "parameters": {
  67720. // "autoscaler": {
  67721. // "description": "Name of the autoscaler to update.",
  67722. // "location": "query",
  67723. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67724. // "type": "string"
  67725. // },
  67726. // "project": {
  67727. // "description": "Project ID for this request.",
  67728. // "location": "path",
  67729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67730. // "required": true,
  67731. // "type": "string"
  67732. // },
  67733. // "region": {
  67734. // "description": "Name of the region scoping this request.",
  67735. // "location": "path",
  67736. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67737. // "required": true,
  67738. // "type": "string"
  67739. // },
  67740. // "requestId": {
  67741. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67742. // "location": "query",
  67743. // "type": "string"
  67744. // }
  67745. // },
  67746. // "path": "{project}/regions/{region}/autoscalers",
  67747. // "request": {
  67748. // "$ref": "Autoscaler"
  67749. // },
  67750. // "response": {
  67751. // "$ref": "Operation"
  67752. // },
  67753. // "scopes": [
  67754. // "https://www.googleapis.com/auth/cloud-platform",
  67755. // "https://www.googleapis.com/auth/compute"
  67756. // ]
  67757. // }
  67758. }
  67759. // method id "compute.regionBackendServices.delete":
  67760. type RegionBackendServicesDeleteCall struct {
  67761. s *Service
  67762. project string
  67763. region string
  67764. backendService string
  67765. urlParams_ gensupport.URLParams
  67766. ctx_ context.Context
  67767. header_ http.Header
  67768. }
  67769. // Delete: Deletes the specified regional BackendService resource.
  67770. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  67771. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67772. c.project = project
  67773. c.region = region
  67774. c.backendService = backendService
  67775. return c
  67776. }
  67777. // RequestId sets the optional parameter "requestId": An optional
  67778. // request ID to identify requests. Specify a unique request ID so that
  67779. // if you must retry your request, the server will know to ignore the
  67780. // request if it has already been completed.
  67781. //
  67782. // For example, consider a situation where you make an initial request
  67783. // and the request times out. If you make the request again with the
  67784. // same request ID, the server can check if original operation with the
  67785. // same request ID was received, and if so, will ignore the second
  67786. // request. This prevents clients from accidentally creating duplicate
  67787. // commitments.
  67788. //
  67789. // The request ID must be a valid UUID with the exception that zero UUID
  67790. // is not supported (00000000-0000-0000-0000-000000000000).
  67791. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  67792. c.urlParams_.Set("requestId", requestId)
  67793. return c
  67794. }
  67795. // Fields allows partial responses to be retrieved. See
  67796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67797. // for more information.
  67798. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  67799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67800. return c
  67801. }
  67802. // Context sets the context to be used in this call's Do method. Any
  67803. // pending HTTP request will be aborted if the provided context is
  67804. // canceled.
  67805. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  67806. c.ctx_ = ctx
  67807. return c
  67808. }
  67809. // Header returns an http.Header that can be modified by the caller to
  67810. // add HTTP headers to the request.
  67811. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  67812. if c.header_ == nil {
  67813. c.header_ = make(http.Header)
  67814. }
  67815. return c.header_
  67816. }
  67817. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  67818. reqHeaders := make(http.Header)
  67819. for k, v := range c.header_ {
  67820. reqHeaders[k] = v
  67821. }
  67822. reqHeaders.Set("User-Agent", c.s.userAgent())
  67823. var body io.Reader = nil
  67824. c.urlParams_.Set("alt", alt)
  67825. c.urlParams_.Set("prettyPrint", "false")
  67826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  67827. urls += "?" + c.urlParams_.Encode()
  67828. req, err := http.NewRequest("DELETE", urls, body)
  67829. if err != nil {
  67830. return nil, err
  67831. }
  67832. req.Header = reqHeaders
  67833. googleapi.Expand(req.URL, map[string]string{
  67834. "project": c.project,
  67835. "region": c.region,
  67836. "backendService": c.backendService,
  67837. })
  67838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67839. }
  67840. // Do executes the "compute.regionBackendServices.delete" call.
  67841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67842. // status code is an error. Response headers are in either
  67843. // *Operation.ServerResponse.Header or (if a response was returned at
  67844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67845. // to check whether the returned error was because
  67846. // http.StatusNotModified was returned.
  67847. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67848. gensupport.SetOptions(c.urlParams_, opts...)
  67849. res, err := c.doRequest("json")
  67850. if res != nil && res.StatusCode == http.StatusNotModified {
  67851. if res.Body != nil {
  67852. res.Body.Close()
  67853. }
  67854. return nil, &googleapi.Error{
  67855. Code: res.StatusCode,
  67856. Header: res.Header,
  67857. }
  67858. }
  67859. if err != nil {
  67860. return nil, err
  67861. }
  67862. defer googleapi.CloseBody(res)
  67863. if err := googleapi.CheckResponse(res); err != nil {
  67864. return nil, err
  67865. }
  67866. ret := &Operation{
  67867. ServerResponse: googleapi.ServerResponse{
  67868. Header: res.Header,
  67869. HTTPStatusCode: res.StatusCode,
  67870. },
  67871. }
  67872. target := &ret
  67873. if err := gensupport.DecodeResponse(target, res); err != nil {
  67874. return nil, err
  67875. }
  67876. return ret, nil
  67877. // {
  67878. // "description": "Deletes the specified regional BackendService resource.",
  67879. // "httpMethod": "DELETE",
  67880. // "id": "compute.regionBackendServices.delete",
  67881. // "parameterOrder": [
  67882. // "project",
  67883. // "region",
  67884. // "backendService"
  67885. // ],
  67886. // "parameters": {
  67887. // "backendService": {
  67888. // "description": "Name of the BackendService resource to delete.",
  67889. // "location": "path",
  67890. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67891. // "required": true,
  67892. // "type": "string"
  67893. // },
  67894. // "project": {
  67895. // "description": "Project ID for this request.",
  67896. // "location": "path",
  67897. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67898. // "required": true,
  67899. // "type": "string"
  67900. // },
  67901. // "region": {
  67902. // "description": "Name of the region scoping this request.",
  67903. // "location": "path",
  67904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67905. // "required": true,
  67906. // "type": "string"
  67907. // },
  67908. // "requestId": {
  67909. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67910. // "location": "query",
  67911. // "type": "string"
  67912. // }
  67913. // },
  67914. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  67915. // "response": {
  67916. // "$ref": "Operation"
  67917. // },
  67918. // "scopes": [
  67919. // "https://www.googleapis.com/auth/cloud-platform",
  67920. // "https://www.googleapis.com/auth/compute"
  67921. // ]
  67922. // }
  67923. }
  67924. // method id "compute.regionBackendServices.get":
  67925. type RegionBackendServicesGetCall struct {
  67926. s *Service
  67927. project string
  67928. region string
  67929. backendService string
  67930. urlParams_ gensupport.URLParams
  67931. ifNoneMatch_ string
  67932. ctx_ context.Context
  67933. header_ http.Header
  67934. }
  67935. // Get: Returns the specified regional BackendService resource.
  67936. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  67937. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67938. c.project = project
  67939. c.region = region
  67940. c.backendService = backendService
  67941. return c
  67942. }
  67943. // Fields allows partial responses to be retrieved. See
  67944. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67945. // for more information.
  67946. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  67947. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67948. return c
  67949. }
  67950. // IfNoneMatch sets the optional parameter which makes the operation
  67951. // fail if the object's ETag matches the given value. This is useful for
  67952. // getting updates only after the object has changed since the last
  67953. // request. Use googleapi.IsNotModified to check whether the response
  67954. // error from Do is the result of In-None-Match.
  67955. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  67956. c.ifNoneMatch_ = entityTag
  67957. return c
  67958. }
  67959. // Context sets the context to be used in this call's Do method. Any
  67960. // pending HTTP request will be aborted if the provided context is
  67961. // canceled.
  67962. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  67963. c.ctx_ = ctx
  67964. return c
  67965. }
  67966. // Header returns an http.Header that can be modified by the caller to
  67967. // add HTTP headers to the request.
  67968. func (c *RegionBackendServicesGetCall) Header() http.Header {
  67969. if c.header_ == nil {
  67970. c.header_ = make(http.Header)
  67971. }
  67972. return c.header_
  67973. }
  67974. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  67975. reqHeaders := make(http.Header)
  67976. for k, v := range c.header_ {
  67977. reqHeaders[k] = v
  67978. }
  67979. reqHeaders.Set("User-Agent", c.s.userAgent())
  67980. if c.ifNoneMatch_ != "" {
  67981. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67982. }
  67983. var body io.Reader = nil
  67984. c.urlParams_.Set("alt", alt)
  67985. c.urlParams_.Set("prettyPrint", "false")
  67986. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  67987. urls += "?" + c.urlParams_.Encode()
  67988. req, err := http.NewRequest("GET", urls, body)
  67989. if err != nil {
  67990. return nil, err
  67991. }
  67992. req.Header = reqHeaders
  67993. googleapi.Expand(req.URL, map[string]string{
  67994. "project": c.project,
  67995. "region": c.region,
  67996. "backendService": c.backendService,
  67997. })
  67998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67999. }
  68000. // Do executes the "compute.regionBackendServices.get" call.
  68001. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  68002. // status code is an error. Response headers are in either
  68003. // *BackendService.ServerResponse.Header or (if a response was returned
  68004. // at all) in error.(*googleapi.Error).Header. Use
  68005. // googleapi.IsNotModified to check whether the returned error was
  68006. // because http.StatusNotModified was returned.
  68007. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  68008. gensupport.SetOptions(c.urlParams_, opts...)
  68009. res, err := c.doRequest("json")
  68010. if res != nil && res.StatusCode == http.StatusNotModified {
  68011. if res.Body != nil {
  68012. res.Body.Close()
  68013. }
  68014. return nil, &googleapi.Error{
  68015. Code: res.StatusCode,
  68016. Header: res.Header,
  68017. }
  68018. }
  68019. if err != nil {
  68020. return nil, err
  68021. }
  68022. defer googleapi.CloseBody(res)
  68023. if err := googleapi.CheckResponse(res); err != nil {
  68024. return nil, err
  68025. }
  68026. ret := &BackendService{
  68027. ServerResponse: googleapi.ServerResponse{
  68028. Header: res.Header,
  68029. HTTPStatusCode: res.StatusCode,
  68030. },
  68031. }
  68032. target := &ret
  68033. if err := gensupport.DecodeResponse(target, res); err != nil {
  68034. return nil, err
  68035. }
  68036. return ret, nil
  68037. // {
  68038. // "description": "Returns the specified regional BackendService resource.",
  68039. // "httpMethod": "GET",
  68040. // "id": "compute.regionBackendServices.get",
  68041. // "parameterOrder": [
  68042. // "project",
  68043. // "region",
  68044. // "backendService"
  68045. // ],
  68046. // "parameters": {
  68047. // "backendService": {
  68048. // "description": "Name of the BackendService resource to return.",
  68049. // "location": "path",
  68050. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68051. // "required": true,
  68052. // "type": "string"
  68053. // },
  68054. // "project": {
  68055. // "description": "Project ID for this request.",
  68056. // "location": "path",
  68057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68058. // "required": true,
  68059. // "type": "string"
  68060. // },
  68061. // "region": {
  68062. // "description": "Name of the region scoping this request.",
  68063. // "location": "path",
  68064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68065. // "required": true,
  68066. // "type": "string"
  68067. // }
  68068. // },
  68069. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  68070. // "response": {
  68071. // "$ref": "BackendService"
  68072. // },
  68073. // "scopes": [
  68074. // "https://www.googleapis.com/auth/cloud-platform",
  68075. // "https://www.googleapis.com/auth/compute",
  68076. // "https://www.googleapis.com/auth/compute.readonly"
  68077. // ]
  68078. // }
  68079. }
  68080. // method id "compute.regionBackendServices.getHealth":
  68081. type RegionBackendServicesGetHealthCall struct {
  68082. s *Service
  68083. project string
  68084. region string
  68085. backendService string
  68086. resourcegroupreference *ResourceGroupReference
  68087. urlParams_ gensupport.URLParams
  68088. ctx_ context.Context
  68089. header_ http.Header
  68090. }
  68091. // GetHealth: Gets the most recent health check results for this
  68092. // regional BackendService.
  68093. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  68094. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68095. c.project = project
  68096. c.region = region
  68097. c.backendService = backendService
  68098. c.resourcegroupreference = resourcegroupreference
  68099. return c
  68100. }
  68101. // Fields allows partial responses to be retrieved. See
  68102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68103. // for more information.
  68104. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  68105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68106. return c
  68107. }
  68108. // Context sets the context to be used in this call's Do method. Any
  68109. // pending HTTP request will be aborted if the provided context is
  68110. // canceled.
  68111. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  68112. c.ctx_ = ctx
  68113. return c
  68114. }
  68115. // Header returns an http.Header that can be modified by the caller to
  68116. // add HTTP headers to the request.
  68117. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  68118. if c.header_ == nil {
  68119. c.header_ = make(http.Header)
  68120. }
  68121. return c.header_
  68122. }
  68123. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  68124. reqHeaders := make(http.Header)
  68125. for k, v := range c.header_ {
  68126. reqHeaders[k] = v
  68127. }
  68128. reqHeaders.Set("User-Agent", c.s.userAgent())
  68129. var body io.Reader = nil
  68130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  68131. if err != nil {
  68132. return nil, err
  68133. }
  68134. reqHeaders.Set("Content-Type", "application/json")
  68135. c.urlParams_.Set("alt", alt)
  68136. c.urlParams_.Set("prettyPrint", "false")
  68137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  68138. urls += "?" + c.urlParams_.Encode()
  68139. req, err := http.NewRequest("POST", urls, body)
  68140. if err != nil {
  68141. return nil, err
  68142. }
  68143. req.Header = reqHeaders
  68144. googleapi.Expand(req.URL, map[string]string{
  68145. "project": c.project,
  68146. "region": c.region,
  68147. "backendService": c.backendService,
  68148. })
  68149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68150. }
  68151. // Do executes the "compute.regionBackendServices.getHealth" call.
  68152. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  68153. // Any non-2xx status code is an error. Response headers are in either
  68154. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  68155. // was returned at all) in error.(*googleapi.Error).Header. Use
  68156. // googleapi.IsNotModified to check whether the returned error was
  68157. // because http.StatusNotModified was returned.
  68158. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  68159. gensupport.SetOptions(c.urlParams_, opts...)
  68160. res, err := c.doRequest("json")
  68161. if res != nil && res.StatusCode == http.StatusNotModified {
  68162. if res.Body != nil {
  68163. res.Body.Close()
  68164. }
  68165. return nil, &googleapi.Error{
  68166. Code: res.StatusCode,
  68167. Header: res.Header,
  68168. }
  68169. }
  68170. if err != nil {
  68171. return nil, err
  68172. }
  68173. defer googleapi.CloseBody(res)
  68174. if err := googleapi.CheckResponse(res); err != nil {
  68175. return nil, err
  68176. }
  68177. ret := &BackendServiceGroupHealth{
  68178. ServerResponse: googleapi.ServerResponse{
  68179. Header: res.Header,
  68180. HTTPStatusCode: res.StatusCode,
  68181. },
  68182. }
  68183. target := &ret
  68184. if err := gensupport.DecodeResponse(target, res); err != nil {
  68185. return nil, err
  68186. }
  68187. return ret, nil
  68188. // {
  68189. // "description": "Gets the most recent health check results for this regional BackendService.",
  68190. // "httpMethod": "POST",
  68191. // "id": "compute.regionBackendServices.getHealth",
  68192. // "parameterOrder": [
  68193. // "project",
  68194. // "region",
  68195. // "backendService"
  68196. // ],
  68197. // "parameters": {
  68198. // "backendService": {
  68199. // "description": "Name of the BackendService resource for which to get health.",
  68200. // "location": "path",
  68201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68202. // "required": true,
  68203. // "type": "string"
  68204. // },
  68205. // "project": {
  68206. // "location": "path",
  68207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68208. // "required": true,
  68209. // "type": "string"
  68210. // },
  68211. // "region": {
  68212. // "description": "Name of the region scoping this request.",
  68213. // "location": "path",
  68214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68215. // "required": true,
  68216. // "type": "string"
  68217. // }
  68218. // },
  68219. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  68220. // "request": {
  68221. // "$ref": "ResourceGroupReference"
  68222. // },
  68223. // "response": {
  68224. // "$ref": "BackendServiceGroupHealth"
  68225. // },
  68226. // "scopes": [
  68227. // "https://www.googleapis.com/auth/cloud-platform",
  68228. // "https://www.googleapis.com/auth/compute",
  68229. // "https://www.googleapis.com/auth/compute.readonly"
  68230. // ]
  68231. // }
  68232. }
  68233. // method id "compute.regionBackendServices.insert":
  68234. type RegionBackendServicesInsertCall struct {
  68235. s *Service
  68236. project string
  68237. region string
  68238. backendservice *BackendService
  68239. urlParams_ gensupport.URLParams
  68240. ctx_ context.Context
  68241. header_ http.Header
  68242. }
  68243. // Insert: Creates a regional BackendService resource in the specified
  68244. // project using the data included in the request. There are several
  68245. // restrictions and guidelines to keep in mind when creating a regional
  68246. // backend service. Read Restrictions and Guidelines for more
  68247. // information.
  68248. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  68249. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68250. c.project = project
  68251. c.region = region
  68252. c.backendservice = backendservice
  68253. return c
  68254. }
  68255. // RequestId sets the optional parameter "requestId": An optional
  68256. // request ID to identify requests. Specify a unique request ID so that
  68257. // if you must retry your request, the server will know to ignore the
  68258. // request if it has already been completed.
  68259. //
  68260. // For example, consider a situation where you make an initial request
  68261. // and the request times out. If you make the request again with the
  68262. // same request ID, the server can check if original operation with the
  68263. // same request ID was received, and if so, will ignore the second
  68264. // request. This prevents clients from accidentally creating duplicate
  68265. // commitments.
  68266. //
  68267. // The request ID must be a valid UUID with the exception that zero UUID
  68268. // is not supported (00000000-0000-0000-0000-000000000000).
  68269. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  68270. c.urlParams_.Set("requestId", requestId)
  68271. return c
  68272. }
  68273. // Fields allows partial responses to be retrieved. See
  68274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68275. // for more information.
  68276. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  68277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68278. return c
  68279. }
  68280. // Context sets the context to be used in this call's Do method. Any
  68281. // pending HTTP request will be aborted if the provided context is
  68282. // canceled.
  68283. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  68284. c.ctx_ = ctx
  68285. return c
  68286. }
  68287. // Header returns an http.Header that can be modified by the caller to
  68288. // add HTTP headers to the request.
  68289. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  68290. if c.header_ == nil {
  68291. c.header_ = make(http.Header)
  68292. }
  68293. return c.header_
  68294. }
  68295. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  68296. reqHeaders := make(http.Header)
  68297. for k, v := range c.header_ {
  68298. reqHeaders[k] = v
  68299. }
  68300. reqHeaders.Set("User-Agent", c.s.userAgent())
  68301. var body io.Reader = nil
  68302. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  68303. if err != nil {
  68304. return nil, err
  68305. }
  68306. reqHeaders.Set("Content-Type", "application/json")
  68307. c.urlParams_.Set("alt", alt)
  68308. c.urlParams_.Set("prettyPrint", "false")
  68309. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  68310. urls += "?" + c.urlParams_.Encode()
  68311. req, err := http.NewRequest("POST", urls, body)
  68312. if err != nil {
  68313. return nil, err
  68314. }
  68315. req.Header = reqHeaders
  68316. googleapi.Expand(req.URL, map[string]string{
  68317. "project": c.project,
  68318. "region": c.region,
  68319. })
  68320. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68321. }
  68322. // Do executes the "compute.regionBackendServices.insert" call.
  68323. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68324. // status code is an error. Response headers are in either
  68325. // *Operation.ServerResponse.Header or (if a response was returned at
  68326. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68327. // to check whether the returned error was because
  68328. // http.StatusNotModified was returned.
  68329. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68330. gensupport.SetOptions(c.urlParams_, opts...)
  68331. res, err := c.doRequest("json")
  68332. if res != nil && res.StatusCode == http.StatusNotModified {
  68333. if res.Body != nil {
  68334. res.Body.Close()
  68335. }
  68336. return nil, &googleapi.Error{
  68337. Code: res.StatusCode,
  68338. Header: res.Header,
  68339. }
  68340. }
  68341. if err != nil {
  68342. return nil, err
  68343. }
  68344. defer googleapi.CloseBody(res)
  68345. if err := googleapi.CheckResponse(res); err != nil {
  68346. return nil, err
  68347. }
  68348. ret := &Operation{
  68349. ServerResponse: googleapi.ServerResponse{
  68350. Header: res.Header,
  68351. HTTPStatusCode: res.StatusCode,
  68352. },
  68353. }
  68354. target := &ret
  68355. if err := gensupport.DecodeResponse(target, res); err != nil {
  68356. return nil, err
  68357. }
  68358. return ret, nil
  68359. // {
  68360. // "description": "Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information.",
  68361. // "httpMethod": "POST",
  68362. // "id": "compute.regionBackendServices.insert",
  68363. // "parameterOrder": [
  68364. // "project",
  68365. // "region"
  68366. // ],
  68367. // "parameters": {
  68368. // "project": {
  68369. // "description": "Project ID for this request.",
  68370. // "location": "path",
  68371. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68372. // "required": true,
  68373. // "type": "string"
  68374. // },
  68375. // "region": {
  68376. // "description": "Name of the region scoping this request.",
  68377. // "location": "path",
  68378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68379. // "required": true,
  68380. // "type": "string"
  68381. // },
  68382. // "requestId": {
  68383. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68384. // "location": "query",
  68385. // "type": "string"
  68386. // }
  68387. // },
  68388. // "path": "{project}/regions/{region}/backendServices",
  68389. // "request": {
  68390. // "$ref": "BackendService"
  68391. // },
  68392. // "response": {
  68393. // "$ref": "Operation"
  68394. // },
  68395. // "scopes": [
  68396. // "https://www.googleapis.com/auth/cloud-platform",
  68397. // "https://www.googleapis.com/auth/compute"
  68398. // ]
  68399. // }
  68400. }
  68401. // method id "compute.regionBackendServices.list":
  68402. type RegionBackendServicesListCall struct {
  68403. s *Service
  68404. project string
  68405. region string
  68406. urlParams_ gensupport.URLParams
  68407. ifNoneMatch_ string
  68408. ctx_ context.Context
  68409. header_ http.Header
  68410. }
  68411. // List: Retrieves the list of regional BackendService resources
  68412. // available to the specified project in the given region.
  68413. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  68414. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68415. c.project = project
  68416. c.region = region
  68417. return c
  68418. }
  68419. // Filter sets the optional parameter "filter": A filter expression that
  68420. // filters resources listed in the response. The expression must specify
  68421. // the field name, a comparison operator, and the value that you want to
  68422. // use for filtering. The value must be a string, a number, or a
  68423. // boolean. The comparison operator must be either =, !=, >, or <.
  68424. //
  68425. // For example, if you are filtering Compute Engine instances, you can
  68426. // exclude instances named example-instance by specifying name !=
  68427. // example-instance.
  68428. //
  68429. // You can also filter nested fields. For example, you could specify
  68430. // scheduling.automaticRestart = false to include instances only if they
  68431. // are not scheduled for automatic restarts. You can use filtering on
  68432. // nested fields to filter based on resource labels.
  68433. //
  68434. // To filter on multiple expressions, provide each separate expression
  68435. // within parentheses. For example, (scheduling.automaticRestart = true)
  68436. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68437. // AND expression. However, you can include AND and OR expressions
  68438. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68439. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68440. // true).
  68441. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  68442. c.urlParams_.Set("filter", filter)
  68443. return c
  68444. }
  68445. // MaxResults sets the optional parameter "maxResults": The maximum
  68446. // number of results per page that should be returned. If the number of
  68447. // available results is larger than maxResults, Compute Engine returns a
  68448. // nextPageToken that can be used to get the next page of results in
  68449. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68450. // (Default: 500)
  68451. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  68452. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68453. return c
  68454. }
  68455. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68456. // a certain order. By default, results are returned in alphanumerical
  68457. // order based on the resource name.
  68458. //
  68459. // You can also sort results in descending order based on the creation
  68460. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68461. // based on the creationTimestamp field in reverse chronological order
  68462. // (newest result first). Use this to sort resources like operations so
  68463. // that the newest operation is returned first.
  68464. //
  68465. // Currently, only sorting by name or creationTimestamp desc is
  68466. // supported.
  68467. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  68468. c.urlParams_.Set("orderBy", orderBy)
  68469. return c
  68470. }
  68471. // PageToken sets the optional parameter "pageToken": Specifies a page
  68472. // token to use. Set pageToken to the nextPageToken returned by a
  68473. // previous list request to get the next page of results.
  68474. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  68475. c.urlParams_.Set("pageToken", pageToken)
  68476. return c
  68477. }
  68478. // Fields allows partial responses to be retrieved. See
  68479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68480. // for more information.
  68481. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  68482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68483. return c
  68484. }
  68485. // IfNoneMatch sets the optional parameter which makes the operation
  68486. // fail if the object's ETag matches the given value. This is useful for
  68487. // getting updates only after the object has changed since the last
  68488. // request. Use googleapi.IsNotModified to check whether the response
  68489. // error from Do is the result of In-None-Match.
  68490. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  68491. c.ifNoneMatch_ = entityTag
  68492. return c
  68493. }
  68494. // Context sets the context to be used in this call's Do method. Any
  68495. // pending HTTP request will be aborted if the provided context is
  68496. // canceled.
  68497. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  68498. c.ctx_ = ctx
  68499. return c
  68500. }
  68501. // Header returns an http.Header that can be modified by the caller to
  68502. // add HTTP headers to the request.
  68503. func (c *RegionBackendServicesListCall) Header() http.Header {
  68504. if c.header_ == nil {
  68505. c.header_ = make(http.Header)
  68506. }
  68507. return c.header_
  68508. }
  68509. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  68510. reqHeaders := make(http.Header)
  68511. for k, v := range c.header_ {
  68512. reqHeaders[k] = v
  68513. }
  68514. reqHeaders.Set("User-Agent", c.s.userAgent())
  68515. if c.ifNoneMatch_ != "" {
  68516. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68517. }
  68518. var body io.Reader = nil
  68519. c.urlParams_.Set("alt", alt)
  68520. c.urlParams_.Set("prettyPrint", "false")
  68521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  68522. urls += "?" + c.urlParams_.Encode()
  68523. req, err := http.NewRequest("GET", urls, body)
  68524. if err != nil {
  68525. return nil, err
  68526. }
  68527. req.Header = reqHeaders
  68528. googleapi.Expand(req.URL, map[string]string{
  68529. "project": c.project,
  68530. "region": c.region,
  68531. })
  68532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68533. }
  68534. // Do executes the "compute.regionBackendServices.list" call.
  68535. // Exactly one of *BackendServiceList or error will be non-nil. Any
  68536. // non-2xx status code is an error. Response headers are in either
  68537. // *BackendServiceList.ServerResponse.Header or (if a response was
  68538. // returned at all) in error.(*googleapi.Error).Header. Use
  68539. // googleapi.IsNotModified to check whether the returned error was
  68540. // because http.StatusNotModified was returned.
  68541. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  68542. gensupport.SetOptions(c.urlParams_, opts...)
  68543. res, err := c.doRequest("json")
  68544. if res != nil && res.StatusCode == http.StatusNotModified {
  68545. if res.Body != nil {
  68546. res.Body.Close()
  68547. }
  68548. return nil, &googleapi.Error{
  68549. Code: res.StatusCode,
  68550. Header: res.Header,
  68551. }
  68552. }
  68553. if err != nil {
  68554. return nil, err
  68555. }
  68556. defer googleapi.CloseBody(res)
  68557. if err := googleapi.CheckResponse(res); err != nil {
  68558. return nil, err
  68559. }
  68560. ret := &BackendServiceList{
  68561. ServerResponse: googleapi.ServerResponse{
  68562. Header: res.Header,
  68563. HTTPStatusCode: res.StatusCode,
  68564. },
  68565. }
  68566. target := &ret
  68567. if err := gensupport.DecodeResponse(target, res); err != nil {
  68568. return nil, err
  68569. }
  68570. return ret, nil
  68571. // {
  68572. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  68573. // "httpMethod": "GET",
  68574. // "id": "compute.regionBackendServices.list",
  68575. // "parameterOrder": [
  68576. // "project",
  68577. // "region"
  68578. // ],
  68579. // "parameters": {
  68580. // "filter": {
  68581. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  68582. // "location": "query",
  68583. // "type": "string"
  68584. // },
  68585. // "maxResults": {
  68586. // "default": "500",
  68587. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  68588. // "format": "uint32",
  68589. // "location": "query",
  68590. // "minimum": "0",
  68591. // "type": "integer"
  68592. // },
  68593. // "orderBy": {
  68594. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  68595. // "location": "query",
  68596. // "type": "string"
  68597. // },
  68598. // "pageToken": {
  68599. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  68600. // "location": "query",
  68601. // "type": "string"
  68602. // },
  68603. // "project": {
  68604. // "description": "Project ID for this request.",
  68605. // "location": "path",
  68606. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68607. // "required": true,
  68608. // "type": "string"
  68609. // },
  68610. // "region": {
  68611. // "description": "Name of the region scoping this request.",
  68612. // "location": "path",
  68613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68614. // "required": true,
  68615. // "type": "string"
  68616. // }
  68617. // },
  68618. // "path": "{project}/regions/{region}/backendServices",
  68619. // "response": {
  68620. // "$ref": "BackendServiceList"
  68621. // },
  68622. // "scopes": [
  68623. // "https://www.googleapis.com/auth/cloud-platform",
  68624. // "https://www.googleapis.com/auth/compute",
  68625. // "https://www.googleapis.com/auth/compute.readonly"
  68626. // ]
  68627. // }
  68628. }
  68629. // Pages invokes f for each page of results.
  68630. // A non-nil error returned from f will halt the iteration.
  68631. // The provided context supersedes any context provided to the Context method.
  68632. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  68633. c.ctx_ = ctx
  68634. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68635. for {
  68636. x, err := c.Do()
  68637. if err != nil {
  68638. return err
  68639. }
  68640. if err := f(x); err != nil {
  68641. return err
  68642. }
  68643. if x.NextPageToken == "" {
  68644. return nil
  68645. }
  68646. c.PageToken(x.NextPageToken)
  68647. }
  68648. }
  68649. // method id "compute.regionBackendServices.patch":
  68650. type RegionBackendServicesPatchCall struct {
  68651. s *Service
  68652. project string
  68653. region string
  68654. backendService string
  68655. backendservice *BackendService
  68656. urlParams_ gensupport.URLParams
  68657. ctx_ context.Context
  68658. header_ http.Header
  68659. }
  68660. // Patch: Updates the specified regional BackendService resource with
  68661. // the data included in the request. There are several restrictions and
  68662. // guidelines to keep in mind when updating a backend service. Read
  68663. // Restrictions and Guidelines for more information. This method
  68664. // supports PATCH semantics and uses the JSON merge patch format and
  68665. // processing rules.
  68666. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  68667. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68668. c.project = project
  68669. c.region = region
  68670. c.backendService = backendService
  68671. c.backendservice = backendservice
  68672. return c
  68673. }
  68674. // RequestId sets the optional parameter "requestId": An optional
  68675. // request ID to identify requests. Specify a unique request ID so that
  68676. // if you must retry your request, the server will know to ignore the
  68677. // request if it has already been completed.
  68678. //
  68679. // For example, consider a situation where you make an initial request
  68680. // and the request times out. If you make the request again with the
  68681. // same request ID, the server can check if original operation with the
  68682. // same request ID was received, and if so, will ignore the second
  68683. // request. This prevents clients from accidentally creating duplicate
  68684. // commitments.
  68685. //
  68686. // The request ID must be a valid UUID with the exception that zero UUID
  68687. // is not supported (00000000-0000-0000-0000-000000000000).
  68688. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  68689. c.urlParams_.Set("requestId", requestId)
  68690. return c
  68691. }
  68692. // Fields allows partial responses to be retrieved. See
  68693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68694. // for more information.
  68695. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  68696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68697. return c
  68698. }
  68699. // Context sets the context to be used in this call's Do method. Any
  68700. // pending HTTP request will be aborted if the provided context is
  68701. // canceled.
  68702. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  68703. c.ctx_ = ctx
  68704. return c
  68705. }
  68706. // Header returns an http.Header that can be modified by the caller to
  68707. // add HTTP headers to the request.
  68708. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  68709. if c.header_ == nil {
  68710. c.header_ = make(http.Header)
  68711. }
  68712. return c.header_
  68713. }
  68714. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  68715. reqHeaders := make(http.Header)
  68716. for k, v := range c.header_ {
  68717. reqHeaders[k] = v
  68718. }
  68719. reqHeaders.Set("User-Agent", c.s.userAgent())
  68720. var body io.Reader = nil
  68721. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  68722. if err != nil {
  68723. return nil, err
  68724. }
  68725. reqHeaders.Set("Content-Type", "application/json")
  68726. c.urlParams_.Set("alt", alt)
  68727. c.urlParams_.Set("prettyPrint", "false")
  68728. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  68729. urls += "?" + c.urlParams_.Encode()
  68730. req, err := http.NewRequest("PATCH", urls, body)
  68731. if err != nil {
  68732. return nil, err
  68733. }
  68734. req.Header = reqHeaders
  68735. googleapi.Expand(req.URL, map[string]string{
  68736. "project": c.project,
  68737. "region": c.region,
  68738. "backendService": c.backendService,
  68739. })
  68740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68741. }
  68742. // Do executes the "compute.regionBackendServices.patch" call.
  68743. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68744. // status code is an error. Response headers are in either
  68745. // *Operation.ServerResponse.Header or (if a response was returned at
  68746. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68747. // to check whether the returned error was because
  68748. // http.StatusNotModified was returned.
  68749. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68750. gensupport.SetOptions(c.urlParams_, opts...)
  68751. res, err := c.doRequest("json")
  68752. if res != nil && res.StatusCode == http.StatusNotModified {
  68753. if res.Body != nil {
  68754. res.Body.Close()
  68755. }
  68756. return nil, &googleapi.Error{
  68757. Code: res.StatusCode,
  68758. Header: res.Header,
  68759. }
  68760. }
  68761. if err != nil {
  68762. return nil, err
  68763. }
  68764. defer googleapi.CloseBody(res)
  68765. if err := googleapi.CheckResponse(res); err != nil {
  68766. return nil, err
  68767. }
  68768. ret := &Operation{
  68769. ServerResponse: googleapi.ServerResponse{
  68770. Header: res.Header,
  68771. HTTPStatusCode: res.StatusCode,
  68772. },
  68773. }
  68774. target := &ret
  68775. if err := gensupport.DecodeResponse(target, res); err != nil {
  68776. return nil, err
  68777. }
  68778. return ret, nil
  68779. // {
  68780. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  68781. // "httpMethod": "PATCH",
  68782. // "id": "compute.regionBackendServices.patch",
  68783. // "parameterOrder": [
  68784. // "project",
  68785. // "region",
  68786. // "backendService"
  68787. // ],
  68788. // "parameters": {
  68789. // "backendService": {
  68790. // "description": "Name of the BackendService resource to patch.",
  68791. // "location": "path",
  68792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68793. // "required": true,
  68794. // "type": "string"
  68795. // },
  68796. // "project": {
  68797. // "description": "Project ID for this request.",
  68798. // "location": "path",
  68799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68800. // "required": true,
  68801. // "type": "string"
  68802. // },
  68803. // "region": {
  68804. // "description": "Name of the region scoping this request.",
  68805. // "location": "path",
  68806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68807. // "required": true,
  68808. // "type": "string"
  68809. // },
  68810. // "requestId": {
  68811. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68812. // "location": "query",
  68813. // "type": "string"
  68814. // }
  68815. // },
  68816. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  68817. // "request": {
  68818. // "$ref": "BackendService"
  68819. // },
  68820. // "response": {
  68821. // "$ref": "Operation"
  68822. // },
  68823. // "scopes": [
  68824. // "https://www.googleapis.com/auth/cloud-platform",
  68825. // "https://www.googleapis.com/auth/compute"
  68826. // ]
  68827. // }
  68828. }
  68829. // method id "compute.regionBackendServices.update":
  68830. type RegionBackendServicesUpdateCall struct {
  68831. s *Service
  68832. project string
  68833. region string
  68834. backendService string
  68835. backendservice *BackendService
  68836. urlParams_ gensupport.URLParams
  68837. ctx_ context.Context
  68838. header_ http.Header
  68839. }
  68840. // Update: Updates the specified regional BackendService resource with
  68841. // the data included in the request. There are several restrictions and
  68842. // guidelines to keep in mind when updating a backend service. Read
  68843. // Restrictions and Guidelines for more information.
  68844. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  68845. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68846. c.project = project
  68847. c.region = region
  68848. c.backendService = backendService
  68849. c.backendservice = backendservice
  68850. return c
  68851. }
  68852. // RequestId sets the optional parameter "requestId": An optional
  68853. // request ID to identify requests. Specify a unique request ID so that
  68854. // if you must retry your request, the server will know to ignore the
  68855. // request if it has already been completed.
  68856. //
  68857. // For example, consider a situation where you make an initial request
  68858. // and the request times out. If you make the request again with the
  68859. // same request ID, the server can check if original operation with the
  68860. // same request ID was received, and if so, will ignore the second
  68861. // request. This prevents clients from accidentally creating duplicate
  68862. // commitments.
  68863. //
  68864. // The request ID must be a valid UUID with the exception that zero UUID
  68865. // is not supported (00000000-0000-0000-0000-000000000000).
  68866. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  68867. c.urlParams_.Set("requestId", requestId)
  68868. return c
  68869. }
  68870. // Fields allows partial responses to be retrieved. See
  68871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68872. // for more information.
  68873. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  68874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68875. return c
  68876. }
  68877. // Context sets the context to be used in this call's Do method. Any
  68878. // pending HTTP request will be aborted if the provided context is
  68879. // canceled.
  68880. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  68881. c.ctx_ = ctx
  68882. return c
  68883. }
  68884. // Header returns an http.Header that can be modified by the caller to
  68885. // add HTTP headers to the request.
  68886. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  68887. if c.header_ == nil {
  68888. c.header_ = make(http.Header)
  68889. }
  68890. return c.header_
  68891. }
  68892. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  68893. reqHeaders := make(http.Header)
  68894. for k, v := range c.header_ {
  68895. reqHeaders[k] = v
  68896. }
  68897. reqHeaders.Set("User-Agent", c.s.userAgent())
  68898. var body io.Reader = nil
  68899. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  68900. if err != nil {
  68901. return nil, err
  68902. }
  68903. reqHeaders.Set("Content-Type", "application/json")
  68904. c.urlParams_.Set("alt", alt)
  68905. c.urlParams_.Set("prettyPrint", "false")
  68906. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  68907. urls += "?" + c.urlParams_.Encode()
  68908. req, err := http.NewRequest("PUT", urls, body)
  68909. if err != nil {
  68910. return nil, err
  68911. }
  68912. req.Header = reqHeaders
  68913. googleapi.Expand(req.URL, map[string]string{
  68914. "project": c.project,
  68915. "region": c.region,
  68916. "backendService": c.backendService,
  68917. })
  68918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68919. }
  68920. // Do executes the "compute.regionBackendServices.update" call.
  68921. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68922. // status code is an error. Response headers are in either
  68923. // *Operation.ServerResponse.Header or (if a response was returned at
  68924. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68925. // to check whether the returned error was because
  68926. // http.StatusNotModified was returned.
  68927. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68928. gensupport.SetOptions(c.urlParams_, opts...)
  68929. res, err := c.doRequest("json")
  68930. if res != nil && res.StatusCode == http.StatusNotModified {
  68931. if res.Body != nil {
  68932. res.Body.Close()
  68933. }
  68934. return nil, &googleapi.Error{
  68935. Code: res.StatusCode,
  68936. Header: res.Header,
  68937. }
  68938. }
  68939. if err != nil {
  68940. return nil, err
  68941. }
  68942. defer googleapi.CloseBody(res)
  68943. if err := googleapi.CheckResponse(res); err != nil {
  68944. return nil, err
  68945. }
  68946. ret := &Operation{
  68947. ServerResponse: googleapi.ServerResponse{
  68948. Header: res.Header,
  68949. HTTPStatusCode: res.StatusCode,
  68950. },
  68951. }
  68952. target := &ret
  68953. if err := gensupport.DecodeResponse(target, res); err != nil {
  68954. return nil, err
  68955. }
  68956. return ret, nil
  68957. // {
  68958. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  68959. // "httpMethod": "PUT",
  68960. // "id": "compute.regionBackendServices.update",
  68961. // "parameterOrder": [
  68962. // "project",
  68963. // "region",
  68964. // "backendService"
  68965. // ],
  68966. // "parameters": {
  68967. // "backendService": {
  68968. // "description": "Name of the BackendService resource to update.",
  68969. // "location": "path",
  68970. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68971. // "required": true,
  68972. // "type": "string"
  68973. // },
  68974. // "project": {
  68975. // "description": "Project ID for this request.",
  68976. // "location": "path",
  68977. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68978. // "required": true,
  68979. // "type": "string"
  68980. // },
  68981. // "region": {
  68982. // "description": "Name of the region scoping this request.",
  68983. // "location": "path",
  68984. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68985. // "required": true,
  68986. // "type": "string"
  68987. // },
  68988. // "requestId": {
  68989. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68990. // "location": "query",
  68991. // "type": "string"
  68992. // }
  68993. // },
  68994. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  68995. // "request": {
  68996. // "$ref": "BackendService"
  68997. // },
  68998. // "response": {
  68999. // "$ref": "Operation"
  69000. // },
  69001. // "scopes": [
  69002. // "https://www.googleapis.com/auth/cloud-platform",
  69003. // "https://www.googleapis.com/auth/compute"
  69004. // ]
  69005. // }
  69006. }
  69007. // method id "compute.regionCommitments.aggregatedList":
  69008. type RegionCommitmentsAggregatedListCall struct {
  69009. s *Service
  69010. project string
  69011. urlParams_ gensupport.URLParams
  69012. ifNoneMatch_ string
  69013. ctx_ context.Context
  69014. header_ http.Header
  69015. }
  69016. // AggregatedList: Retrieves an aggregated list of commitments.
  69017. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  69018. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69019. c.project = project
  69020. return c
  69021. }
  69022. // Filter sets the optional parameter "filter": A filter expression that
  69023. // filters resources listed in the response. The expression must specify
  69024. // the field name, a comparison operator, and the value that you want to
  69025. // use for filtering. The value must be a string, a number, or a
  69026. // boolean. The comparison operator must be either =, !=, >, or <.
  69027. //
  69028. // For example, if you are filtering Compute Engine instances, you can
  69029. // exclude instances named example-instance by specifying name !=
  69030. // example-instance.
  69031. //
  69032. // You can also filter nested fields. For example, you could specify
  69033. // scheduling.automaticRestart = false to include instances only if they
  69034. // are not scheduled for automatic restarts. You can use filtering on
  69035. // nested fields to filter based on resource labels.
  69036. //
  69037. // To filter on multiple expressions, provide each separate expression
  69038. // within parentheses. For example, (scheduling.automaticRestart = true)
  69039. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69040. // AND expression. However, you can include AND and OR expressions
  69041. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69042. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69043. // true).
  69044. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  69045. c.urlParams_.Set("filter", filter)
  69046. return c
  69047. }
  69048. // MaxResults sets the optional parameter "maxResults": The maximum
  69049. // number of results per page that should be returned. If the number of
  69050. // available results is larger than maxResults, Compute Engine returns a
  69051. // nextPageToken that can be used to get the next page of results in
  69052. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69053. // (Default: 500)
  69054. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  69055. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69056. return c
  69057. }
  69058. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69059. // a certain order. By default, results are returned in alphanumerical
  69060. // order based on the resource name.
  69061. //
  69062. // You can also sort results in descending order based on the creation
  69063. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69064. // based on the creationTimestamp field in reverse chronological order
  69065. // (newest result first). Use this to sort resources like operations so
  69066. // that the newest operation is returned first.
  69067. //
  69068. // Currently, only sorting by name or creationTimestamp desc is
  69069. // supported.
  69070. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  69071. c.urlParams_.Set("orderBy", orderBy)
  69072. return c
  69073. }
  69074. // PageToken sets the optional parameter "pageToken": Specifies a page
  69075. // token to use. Set pageToken to the nextPageToken returned by a
  69076. // previous list request to get the next page of results.
  69077. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  69078. c.urlParams_.Set("pageToken", pageToken)
  69079. return c
  69080. }
  69081. // Fields allows partial responses to be retrieved. See
  69082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69083. // for more information.
  69084. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  69085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69086. return c
  69087. }
  69088. // IfNoneMatch sets the optional parameter which makes the operation
  69089. // fail if the object's ETag matches the given value. This is useful for
  69090. // getting updates only after the object has changed since the last
  69091. // request. Use googleapi.IsNotModified to check whether the response
  69092. // error from Do is the result of In-None-Match.
  69093. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  69094. c.ifNoneMatch_ = entityTag
  69095. return c
  69096. }
  69097. // Context sets the context to be used in this call's Do method. Any
  69098. // pending HTTP request will be aborted if the provided context is
  69099. // canceled.
  69100. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  69101. c.ctx_ = ctx
  69102. return c
  69103. }
  69104. // Header returns an http.Header that can be modified by the caller to
  69105. // add HTTP headers to the request.
  69106. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  69107. if c.header_ == nil {
  69108. c.header_ = make(http.Header)
  69109. }
  69110. return c.header_
  69111. }
  69112. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  69113. reqHeaders := make(http.Header)
  69114. for k, v := range c.header_ {
  69115. reqHeaders[k] = v
  69116. }
  69117. reqHeaders.Set("User-Agent", c.s.userAgent())
  69118. if c.ifNoneMatch_ != "" {
  69119. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69120. }
  69121. var body io.Reader = nil
  69122. c.urlParams_.Set("alt", alt)
  69123. c.urlParams_.Set("prettyPrint", "false")
  69124. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  69125. urls += "?" + c.urlParams_.Encode()
  69126. req, err := http.NewRequest("GET", urls, body)
  69127. if err != nil {
  69128. return nil, err
  69129. }
  69130. req.Header = reqHeaders
  69131. googleapi.Expand(req.URL, map[string]string{
  69132. "project": c.project,
  69133. })
  69134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69135. }
  69136. // Do executes the "compute.regionCommitments.aggregatedList" call.
  69137. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  69138. // Any non-2xx status code is an error. Response headers are in either
  69139. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  69140. // returned at all) in error.(*googleapi.Error).Header. Use
  69141. // googleapi.IsNotModified to check whether the returned error was
  69142. // because http.StatusNotModified was returned.
  69143. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  69144. gensupport.SetOptions(c.urlParams_, opts...)
  69145. res, err := c.doRequest("json")
  69146. if res != nil && res.StatusCode == http.StatusNotModified {
  69147. if res.Body != nil {
  69148. res.Body.Close()
  69149. }
  69150. return nil, &googleapi.Error{
  69151. Code: res.StatusCode,
  69152. Header: res.Header,
  69153. }
  69154. }
  69155. if err != nil {
  69156. return nil, err
  69157. }
  69158. defer googleapi.CloseBody(res)
  69159. if err := googleapi.CheckResponse(res); err != nil {
  69160. return nil, err
  69161. }
  69162. ret := &CommitmentAggregatedList{
  69163. ServerResponse: googleapi.ServerResponse{
  69164. Header: res.Header,
  69165. HTTPStatusCode: res.StatusCode,
  69166. },
  69167. }
  69168. target := &ret
  69169. if err := gensupport.DecodeResponse(target, res); err != nil {
  69170. return nil, err
  69171. }
  69172. return ret, nil
  69173. // {
  69174. // "description": "Retrieves an aggregated list of commitments.",
  69175. // "httpMethod": "GET",
  69176. // "id": "compute.regionCommitments.aggregatedList",
  69177. // "parameterOrder": [
  69178. // "project"
  69179. // ],
  69180. // "parameters": {
  69181. // "filter": {
  69182. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69183. // "location": "query",
  69184. // "type": "string"
  69185. // },
  69186. // "maxResults": {
  69187. // "default": "500",
  69188. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69189. // "format": "uint32",
  69190. // "location": "query",
  69191. // "minimum": "0",
  69192. // "type": "integer"
  69193. // },
  69194. // "orderBy": {
  69195. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69196. // "location": "query",
  69197. // "type": "string"
  69198. // },
  69199. // "pageToken": {
  69200. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69201. // "location": "query",
  69202. // "type": "string"
  69203. // },
  69204. // "project": {
  69205. // "description": "Project ID for this request.",
  69206. // "location": "path",
  69207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69208. // "required": true,
  69209. // "type": "string"
  69210. // }
  69211. // },
  69212. // "path": "{project}/aggregated/commitments",
  69213. // "response": {
  69214. // "$ref": "CommitmentAggregatedList"
  69215. // },
  69216. // "scopes": [
  69217. // "https://www.googleapis.com/auth/cloud-platform",
  69218. // "https://www.googleapis.com/auth/compute",
  69219. // "https://www.googleapis.com/auth/compute.readonly"
  69220. // ]
  69221. // }
  69222. }
  69223. // Pages invokes f for each page of results.
  69224. // A non-nil error returned from f will halt the iteration.
  69225. // The provided context supersedes any context provided to the Context method.
  69226. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  69227. c.ctx_ = ctx
  69228. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69229. for {
  69230. x, err := c.Do()
  69231. if err != nil {
  69232. return err
  69233. }
  69234. if err := f(x); err != nil {
  69235. return err
  69236. }
  69237. if x.NextPageToken == "" {
  69238. return nil
  69239. }
  69240. c.PageToken(x.NextPageToken)
  69241. }
  69242. }
  69243. // method id "compute.regionCommitments.get":
  69244. type RegionCommitmentsGetCall struct {
  69245. s *Service
  69246. project string
  69247. region string
  69248. commitment string
  69249. urlParams_ gensupport.URLParams
  69250. ifNoneMatch_ string
  69251. ctx_ context.Context
  69252. header_ http.Header
  69253. }
  69254. // Get: Returns the specified commitment resource. Gets a list of
  69255. // available commitments by making a list() request.
  69256. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  69257. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69258. c.project = project
  69259. c.region = region
  69260. c.commitment = commitment
  69261. return c
  69262. }
  69263. // Fields allows partial responses to be retrieved. See
  69264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69265. // for more information.
  69266. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  69267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69268. return c
  69269. }
  69270. // IfNoneMatch sets the optional parameter which makes the operation
  69271. // fail if the object's ETag matches the given value. This is useful for
  69272. // getting updates only after the object has changed since the last
  69273. // request. Use googleapi.IsNotModified to check whether the response
  69274. // error from Do is the result of In-None-Match.
  69275. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  69276. c.ifNoneMatch_ = entityTag
  69277. return c
  69278. }
  69279. // Context sets the context to be used in this call's Do method. Any
  69280. // pending HTTP request will be aborted if the provided context is
  69281. // canceled.
  69282. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  69283. c.ctx_ = ctx
  69284. return c
  69285. }
  69286. // Header returns an http.Header that can be modified by the caller to
  69287. // add HTTP headers to the request.
  69288. func (c *RegionCommitmentsGetCall) Header() http.Header {
  69289. if c.header_ == nil {
  69290. c.header_ = make(http.Header)
  69291. }
  69292. return c.header_
  69293. }
  69294. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  69295. reqHeaders := make(http.Header)
  69296. for k, v := range c.header_ {
  69297. reqHeaders[k] = v
  69298. }
  69299. reqHeaders.Set("User-Agent", c.s.userAgent())
  69300. if c.ifNoneMatch_ != "" {
  69301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69302. }
  69303. var body io.Reader = nil
  69304. c.urlParams_.Set("alt", alt)
  69305. c.urlParams_.Set("prettyPrint", "false")
  69306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  69307. urls += "?" + c.urlParams_.Encode()
  69308. req, err := http.NewRequest("GET", urls, body)
  69309. if err != nil {
  69310. return nil, err
  69311. }
  69312. req.Header = reqHeaders
  69313. googleapi.Expand(req.URL, map[string]string{
  69314. "project": c.project,
  69315. "region": c.region,
  69316. "commitment": c.commitment,
  69317. })
  69318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69319. }
  69320. // Do executes the "compute.regionCommitments.get" call.
  69321. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  69322. // status code is an error. Response headers are in either
  69323. // *Commitment.ServerResponse.Header or (if a response was returned at
  69324. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69325. // to check whether the returned error was because
  69326. // http.StatusNotModified was returned.
  69327. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  69328. gensupport.SetOptions(c.urlParams_, opts...)
  69329. res, err := c.doRequest("json")
  69330. if res != nil && res.StatusCode == http.StatusNotModified {
  69331. if res.Body != nil {
  69332. res.Body.Close()
  69333. }
  69334. return nil, &googleapi.Error{
  69335. Code: res.StatusCode,
  69336. Header: res.Header,
  69337. }
  69338. }
  69339. if err != nil {
  69340. return nil, err
  69341. }
  69342. defer googleapi.CloseBody(res)
  69343. if err := googleapi.CheckResponse(res); err != nil {
  69344. return nil, err
  69345. }
  69346. ret := &Commitment{
  69347. ServerResponse: googleapi.ServerResponse{
  69348. Header: res.Header,
  69349. HTTPStatusCode: res.StatusCode,
  69350. },
  69351. }
  69352. target := &ret
  69353. if err := gensupport.DecodeResponse(target, res); err != nil {
  69354. return nil, err
  69355. }
  69356. return ret, nil
  69357. // {
  69358. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  69359. // "httpMethod": "GET",
  69360. // "id": "compute.regionCommitments.get",
  69361. // "parameterOrder": [
  69362. // "project",
  69363. // "region",
  69364. // "commitment"
  69365. // ],
  69366. // "parameters": {
  69367. // "commitment": {
  69368. // "description": "Name of the commitment to return.",
  69369. // "location": "path",
  69370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69371. // "required": true,
  69372. // "type": "string"
  69373. // },
  69374. // "project": {
  69375. // "description": "Project ID for this request.",
  69376. // "location": "path",
  69377. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69378. // "required": true,
  69379. // "type": "string"
  69380. // },
  69381. // "region": {
  69382. // "description": "Name of the region for this request.",
  69383. // "location": "path",
  69384. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69385. // "required": true,
  69386. // "type": "string"
  69387. // }
  69388. // },
  69389. // "path": "{project}/regions/{region}/commitments/{commitment}",
  69390. // "response": {
  69391. // "$ref": "Commitment"
  69392. // },
  69393. // "scopes": [
  69394. // "https://www.googleapis.com/auth/cloud-platform",
  69395. // "https://www.googleapis.com/auth/compute",
  69396. // "https://www.googleapis.com/auth/compute.readonly"
  69397. // ]
  69398. // }
  69399. }
  69400. // method id "compute.regionCommitments.insert":
  69401. type RegionCommitmentsInsertCall struct {
  69402. s *Service
  69403. project string
  69404. region string
  69405. commitment *Commitment
  69406. urlParams_ gensupport.URLParams
  69407. ctx_ context.Context
  69408. header_ http.Header
  69409. }
  69410. // Insert: Creates a commitment in the specified project using the data
  69411. // included in the request.
  69412. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  69413. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69414. c.project = project
  69415. c.region = region
  69416. c.commitment = commitment
  69417. return c
  69418. }
  69419. // RequestId sets the optional parameter "requestId": An optional
  69420. // request ID to identify requests. Specify a unique request ID so that
  69421. // if you must retry your request, the server will know to ignore the
  69422. // request if it has already been completed.
  69423. //
  69424. // For example, consider a situation where you make an initial request
  69425. // and the request times out. If you make the request again with the
  69426. // same request ID, the server can check if original operation with the
  69427. // same request ID was received, and if so, will ignore the second
  69428. // request. This prevents clients from accidentally creating duplicate
  69429. // commitments.
  69430. //
  69431. // The request ID must be a valid UUID with the exception that zero UUID
  69432. // is not supported (00000000-0000-0000-0000-000000000000).
  69433. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  69434. c.urlParams_.Set("requestId", requestId)
  69435. return c
  69436. }
  69437. // Fields allows partial responses to be retrieved. See
  69438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69439. // for more information.
  69440. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  69441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69442. return c
  69443. }
  69444. // Context sets the context to be used in this call's Do method. Any
  69445. // pending HTTP request will be aborted if the provided context is
  69446. // canceled.
  69447. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  69448. c.ctx_ = ctx
  69449. return c
  69450. }
  69451. // Header returns an http.Header that can be modified by the caller to
  69452. // add HTTP headers to the request.
  69453. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  69454. if c.header_ == nil {
  69455. c.header_ = make(http.Header)
  69456. }
  69457. return c.header_
  69458. }
  69459. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  69460. reqHeaders := make(http.Header)
  69461. for k, v := range c.header_ {
  69462. reqHeaders[k] = v
  69463. }
  69464. reqHeaders.Set("User-Agent", c.s.userAgent())
  69465. var body io.Reader = nil
  69466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  69467. if err != nil {
  69468. return nil, err
  69469. }
  69470. reqHeaders.Set("Content-Type", "application/json")
  69471. c.urlParams_.Set("alt", alt)
  69472. c.urlParams_.Set("prettyPrint", "false")
  69473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  69474. urls += "?" + c.urlParams_.Encode()
  69475. req, err := http.NewRequest("POST", urls, body)
  69476. if err != nil {
  69477. return nil, err
  69478. }
  69479. req.Header = reqHeaders
  69480. googleapi.Expand(req.URL, map[string]string{
  69481. "project": c.project,
  69482. "region": c.region,
  69483. })
  69484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69485. }
  69486. // Do executes the "compute.regionCommitments.insert" call.
  69487. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69488. // status code is an error. Response headers are in either
  69489. // *Operation.ServerResponse.Header or (if a response was returned at
  69490. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69491. // to check whether the returned error was because
  69492. // http.StatusNotModified was returned.
  69493. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69494. gensupport.SetOptions(c.urlParams_, opts...)
  69495. res, err := c.doRequest("json")
  69496. if res != nil && res.StatusCode == http.StatusNotModified {
  69497. if res.Body != nil {
  69498. res.Body.Close()
  69499. }
  69500. return nil, &googleapi.Error{
  69501. Code: res.StatusCode,
  69502. Header: res.Header,
  69503. }
  69504. }
  69505. if err != nil {
  69506. return nil, err
  69507. }
  69508. defer googleapi.CloseBody(res)
  69509. if err := googleapi.CheckResponse(res); err != nil {
  69510. return nil, err
  69511. }
  69512. ret := &Operation{
  69513. ServerResponse: googleapi.ServerResponse{
  69514. Header: res.Header,
  69515. HTTPStatusCode: res.StatusCode,
  69516. },
  69517. }
  69518. target := &ret
  69519. if err := gensupport.DecodeResponse(target, res); err != nil {
  69520. return nil, err
  69521. }
  69522. return ret, nil
  69523. // {
  69524. // "description": "Creates a commitment in the specified project using the data included in the request.",
  69525. // "httpMethod": "POST",
  69526. // "id": "compute.regionCommitments.insert",
  69527. // "parameterOrder": [
  69528. // "project",
  69529. // "region"
  69530. // ],
  69531. // "parameters": {
  69532. // "project": {
  69533. // "description": "Project ID for this request.",
  69534. // "location": "path",
  69535. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69536. // "required": true,
  69537. // "type": "string"
  69538. // },
  69539. // "region": {
  69540. // "description": "Name of the region for this request.",
  69541. // "location": "path",
  69542. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69543. // "required": true,
  69544. // "type": "string"
  69545. // },
  69546. // "requestId": {
  69547. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69548. // "location": "query",
  69549. // "type": "string"
  69550. // }
  69551. // },
  69552. // "path": "{project}/regions/{region}/commitments",
  69553. // "request": {
  69554. // "$ref": "Commitment"
  69555. // },
  69556. // "response": {
  69557. // "$ref": "Operation"
  69558. // },
  69559. // "scopes": [
  69560. // "https://www.googleapis.com/auth/cloud-platform",
  69561. // "https://www.googleapis.com/auth/compute"
  69562. // ]
  69563. // }
  69564. }
  69565. // method id "compute.regionCommitments.list":
  69566. type RegionCommitmentsListCall struct {
  69567. s *Service
  69568. project string
  69569. region string
  69570. urlParams_ gensupport.URLParams
  69571. ifNoneMatch_ string
  69572. ctx_ context.Context
  69573. header_ http.Header
  69574. }
  69575. // List: Retrieves a list of commitments contained within the specified
  69576. // region.
  69577. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  69578. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69579. c.project = project
  69580. c.region = region
  69581. return c
  69582. }
  69583. // Filter sets the optional parameter "filter": A filter expression that
  69584. // filters resources listed in the response. The expression must specify
  69585. // the field name, a comparison operator, and the value that you want to
  69586. // use for filtering. The value must be a string, a number, or a
  69587. // boolean. The comparison operator must be either =, !=, >, or <.
  69588. //
  69589. // For example, if you are filtering Compute Engine instances, you can
  69590. // exclude instances named example-instance by specifying name !=
  69591. // example-instance.
  69592. //
  69593. // You can also filter nested fields. For example, you could specify
  69594. // scheduling.automaticRestart = false to include instances only if they
  69595. // are not scheduled for automatic restarts. You can use filtering on
  69596. // nested fields to filter based on resource labels.
  69597. //
  69598. // To filter on multiple expressions, provide each separate expression
  69599. // within parentheses. For example, (scheduling.automaticRestart = true)
  69600. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69601. // AND expression. However, you can include AND and OR expressions
  69602. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69603. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69604. // true).
  69605. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  69606. c.urlParams_.Set("filter", filter)
  69607. return c
  69608. }
  69609. // MaxResults sets the optional parameter "maxResults": The maximum
  69610. // number of results per page that should be returned. If the number of
  69611. // available results is larger than maxResults, Compute Engine returns a
  69612. // nextPageToken that can be used to get the next page of results in
  69613. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69614. // (Default: 500)
  69615. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  69616. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69617. return c
  69618. }
  69619. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69620. // a certain order. By default, results are returned in alphanumerical
  69621. // order based on the resource name.
  69622. //
  69623. // You can also sort results in descending order based on the creation
  69624. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69625. // based on the creationTimestamp field in reverse chronological order
  69626. // (newest result first). Use this to sort resources like operations so
  69627. // that the newest operation is returned first.
  69628. //
  69629. // Currently, only sorting by name or creationTimestamp desc is
  69630. // supported.
  69631. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  69632. c.urlParams_.Set("orderBy", orderBy)
  69633. return c
  69634. }
  69635. // PageToken sets the optional parameter "pageToken": Specifies a page
  69636. // token to use. Set pageToken to the nextPageToken returned by a
  69637. // previous list request to get the next page of results.
  69638. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  69639. c.urlParams_.Set("pageToken", pageToken)
  69640. return c
  69641. }
  69642. // Fields allows partial responses to be retrieved. See
  69643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69644. // for more information.
  69645. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  69646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69647. return c
  69648. }
  69649. // IfNoneMatch sets the optional parameter which makes the operation
  69650. // fail if the object's ETag matches the given value. This is useful for
  69651. // getting updates only after the object has changed since the last
  69652. // request. Use googleapi.IsNotModified to check whether the response
  69653. // error from Do is the result of In-None-Match.
  69654. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  69655. c.ifNoneMatch_ = entityTag
  69656. return c
  69657. }
  69658. // Context sets the context to be used in this call's Do method. Any
  69659. // pending HTTP request will be aborted if the provided context is
  69660. // canceled.
  69661. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  69662. c.ctx_ = ctx
  69663. return c
  69664. }
  69665. // Header returns an http.Header that can be modified by the caller to
  69666. // add HTTP headers to the request.
  69667. func (c *RegionCommitmentsListCall) Header() http.Header {
  69668. if c.header_ == nil {
  69669. c.header_ = make(http.Header)
  69670. }
  69671. return c.header_
  69672. }
  69673. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  69674. reqHeaders := make(http.Header)
  69675. for k, v := range c.header_ {
  69676. reqHeaders[k] = v
  69677. }
  69678. reqHeaders.Set("User-Agent", c.s.userAgent())
  69679. if c.ifNoneMatch_ != "" {
  69680. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69681. }
  69682. var body io.Reader = nil
  69683. c.urlParams_.Set("alt", alt)
  69684. c.urlParams_.Set("prettyPrint", "false")
  69685. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  69686. urls += "?" + c.urlParams_.Encode()
  69687. req, err := http.NewRequest("GET", urls, body)
  69688. if err != nil {
  69689. return nil, err
  69690. }
  69691. req.Header = reqHeaders
  69692. googleapi.Expand(req.URL, map[string]string{
  69693. "project": c.project,
  69694. "region": c.region,
  69695. })
  69696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69697. }
  69698. // Do executes the "compute.regionCommitments.list" call.
  69699. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  69700. // status code is an error. Response headers are in either
  69701. // *CommitmentList.ServerResponse.Header or (if a response was returned
  69702. // at all) in error.(*googleapi.Error).Header. Use
  69703. // googleapi.IsNotModified to check whether the returned error was
  69704. // because http.StatusNotModified was returned.
  69705. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  69706. gensupport.SetOptions(c.urlParams_, opts...)
  69707. res, err := c.doRequest("json")
  69708. if res != nil && res.StatusCode == http.StatusNotModified {
  69709. if res.Body != nil {
  69710. res.Body.Close()
  69711. }
  69712. return nil, &googleapi.Error{
  69713. Code: res.StatusCode,
  69714. Header: res.Header,
  69715. }
  69716. }
  69717. if err != nil {
  69718. return nil, err
  69719. }
  69720. defer googleapi.CloseBody(res)
  69721. if err := googleapi.CheckResponse(res); err != nil {
  69722. return nil, err
  69723. }
  69724. ret := &CommitmentList{
  69725. ServerResponse: googleapi.ServerResponse{
  69726. Header: res.Header,
  69727. HTTPStatusCode: res.StatusCode,
  69728. },
  69729. }
  69730. target := &ret
  69731. if err := gensupport.DecodeResponse(target, res); err != nil {
  69732. return nil, err
  69733. }
  69734. return ret, nil
  69735. // {
  69736. // "description": "Retrieves a list of commitments contained within the specified region.",
  69737. // "httpMethod": "GET",
  69738. // "id": "compute.regionCommitments.list",
  69739. // "parameterOrder": [
  69740. // "project",
  69741. // "region"
  69742. // ],
  69743. // "parameters": {
  69744. // "filter": {
  69745. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69746. // "location": "query",
  69747. // "type": "string"
  69748. // },
  69749. // "maxResults": {
  69750. // "default": "500",
  69751. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69752. // "format": "uint32",
  69753. // "location": "query",
  69754. // "minimum": "0",
  69755. // "type": "integer"
  69756. // },
  69757. // "orderBy": {
  69758. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69759. // "location": "query",
  69760. // "type": "string"
  69761. // },
  69762. // "pageToken": {
  69763. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69764. // "location": "query",
  69765. // "type": "string"
  69766. // },
  69767. // "project": {
  69768. // "description": "Project ID for this request.",
  69769. // "location": "path",
  69770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69771. // "required": true,
  69772. // "type": "string"
  69773. // },
  69774. // "region": {
  69775. // "description": "Name of the region for this request.",
  69776. // "location": "path",
  69777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69778. // "required": true,
  69779. // "type": "string"
  69780. // }
  69781. // },
  69782. // "path": "{project}/regions/{region}/commitments",
  69783. // "response": {
  69784. // "$ref": "CommitmentList"
  69785. // },
  69786. // "scopes": [
  69787. // "https://www.googleapis.com/auth/cloud-platform",
  69788. // "https://www.googleapis.com/auth/compute",
  69789. // "https://www.googleapis.com/auth/compute.readonly"
  69790. // ]
  69791. // }
  69792. }
  69793. // Pages invokes f for each page of results.
  69794. // A non-nil error returned from f will halt the iteration.
  69795. // The provided context supersedes any context provided to the Context method.
  69796. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  69797. c.ctx_ = ctx
  69798. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69799. for {
  69800. x, err := c.Do()
  69801. if err != nil {
  69802. return err
  69803. }
  69804. if err := f(x); err != nil {
  69805. return err
  69806. }
  69807. if x.NextPageToken == "" {
  69808. return nil
  69809. }
  69810. c.PageToken(x.NextPageToken)
  69811. }
  69812. }
  69813. // method id "compute.regionDiskTypes.get":
  69814. type RegionDiskTypesGetCall struct {
  69815. s *Service
  69816. project string
  69817. region string
  69818. diskType string
  69819. urlParams_ gensupport.URLParams
  69820. ifNoneMatch_ string
  69821. ctx_ context.Context
  69822. header_ http.Header
  69823. }
  69824. // Get: Returns the specified regional disk type. Gets a list of
  69825. // available disk types by making a list() request.
  69826. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  69827. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69828. c.project = project
  69829. c.region = region
  69830. c.diskType = diskType
  69831. return c
  69832. }
  69833. // Fields allows partial responses to be retrieved. See
  69834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69835. // for more information.
  69836. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  69837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69838. return c
  69839. }
  69840. // IfNoneMatch sets the optional parameter which makes the operation
  69841. // fail if the object's ETag matches the given value. This is useful for
  69842. // getting updates only after the object has changed since the last
  69843. // request. Use googleapi.IsNotModified to check whether the response
  69844. // error from Do is the result of In-None-Match.
  69845. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  69846. c.ifNoneMatch_ = entityTag
  69847. return c
  69848. }
  69849. // Context sets the context to be used in this call's Do method. Any
  69850. // pending HTTP request will be aborted if the provided context is
  69851. // canceled.
  69852. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  69853. c.ctx_ = ctx
  69854. return c
  69855. }
  69856. // Header returns an http.Header that can be modified by the caller to
  69857. // add HTTP headers to the request.
  69858. func (c *RegionDiskTypesGetCall) Header() http.Header {
  69859. if c.header_ == nil {
  69860. c.header_ = make(http.Header)
  69861. }
  69862. return c.header_
  69863. }
  69864. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  69865. reqHeaders := make(http.Header)
  69866. for k, v := range c.header_ {
  69867. reqHeaders[k] = v
  69868. }
  69869. reqHeaders.Set("User-Agent", c.s.userAgent())
  69870. if c.ifNoneMatch_ != "" {
  69871. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69872. }
  69873. var body io.Reader = nil
  69874. c.urlParams_.Set("alt", alt)
  69875. c.urlParams_.Set("prettyPrint", "false")
  69876. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  69877. urls += "?" + c.urlParams_.Encode()
  69878. req, err := http.NewRequest("GET", urls, body)
  69879. if err != nil {
  69880. return nil, err
  69881. }
  69882. req.Header = reqHeaders
  69883. googleapi.Expand(req.URL, map[string]string{
  69884. "project": c.project,
  69885. "region": c.region,
  69886. "diskType": c.diskType,
  69887. })
  69888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69889. }
  69890. // Do executes the "compute.regionDiskTypes.get" call.
  69891. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  69892. // code is an error. Response headers are in either
  69893. // *DiskType.ServerResponse.Header or (if a response was returned at
  69894. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69895. // to check whether the returned error was because
  69896. // http.StatusNotModified was returned.
  69897. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  69898. gensupport.SetOptions(c.urlParams_, opts...)
  69899. res, err := c.doRequest("json")
  69900. if res != nil && res.StatusCode == http.StatusNotModified {
  69901. if res.Body != nil {
  69902. res.Body.Close()
  69903. }
  69904. return nil, &googleapi.Error{
  69905. Code: res.StatusCode,
  69906. Header: res.Header,
  69907. }
  69908. }
  69909. if err != nil {
  69910. return nil, err
  69911. }
  69912. defer googleapi.CloseBody(res)
  69913. if err := googleapi.CheckResponse(res); err != nil {
  69914. return nil, err
  69915. }
  69916. ret := &DiskType{
  69917. ServerResponse: googleapi.ServerResponse{
  69918. Header: res.Header,
  69919. HTTPStatusCode: res.StatusCode,
  69920. },
  69921. }
  69922. target := &ret
  69923. if err := gensupport.DecodeResponse(target, res); err != nil {
  69924. return nil, err
  69925. }
  69926. return ret, nil
  69927. // {
  69928. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  69929. // "httpMethod": "GET",
  69930. // "id": "compute.regionDiskTypes.get",
  69931. // "parameterOrder": [
  69932. // "project",
  69933. // "region",
  69934. // "diskType"
  69935. // ],
  69936. // "parameters": {
  69937. // "diskType": {
  69938. // "description": "Name of the disk type to return.",
  69939. // "location": "path",
  69940. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69941. // "required": true,
  69942. // "type": "string"
  69943. // },
  69944. // "project": {
  69945. // "description": "Project ID for this request.",
  69946. // "location": "path",
  69947. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69948. // "required": true,
  69949. // "type": "string"
  69950. // },
  69951. // "region": {
  69952. // "description": "The name of the region for this request.",
  69953. // "location": "path",
  69954. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69955. // "required": true,
  69956. // "type": "string"
  69957. // }
  69958. // },
  69959. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  69960. // "response": {
  69961. // "$ref": "DiskType"
  69962. // },
  69963. // "scopes": [
  69964. // "https://www.googleapis.com/auth/cloud-platform",
  69965. // "https://www.googleapis.com/auth/compute",
  69966. // "https://www.googleapis.com/auth/compute.readonly"
  69967. // ]
  69968. // }
  69969. }
  69970. // method id "compute.regionDiskTypes.list":
  69971. type RegionDiskTypesListCall struct {
  69972. s *Service
  69973. project string
  69974. region string
  69975. urlParams_ gensupport.URLParams
  69976. ifNoneMatch_ string
  69977. ctx_ context.Context
  69978. header_ http.Header
  69979. }
  69980. // List: Retrieves a list of regional disk types available to the
  69981. // specified project.
  69982. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  69983. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69984. c.project = project
  69985. c.region = region
  69986. return c
  69987. }
  69988. // Filter sets the optional parameter "filter": A filter expression that
  69989. // filters resources listed in the response. The expression must specify
  69990. // the field name, a comparison operator, and the value that you want to
  69991. // use for filtering. The value must be a string, a number, or a
  69992. // boolean. The comparison operator must be either =, !=, >, or <.
  69993. //
  69994. // For example, if you are filtering Compute Engine instances, you can
  69995. // exclude instances named example-instance by specifying name !=
  69996. // example-instance.
  69997. //
  69998. // You can also filter nested fields. For example, you could specify
  69999. // scheduling.automaticRestart = false to include instances only if they
  70000. // are not scheduled for automatic restarts. You can use filtering on
  70001. // nested fields to filter based on resource labels.
  70002. //
  70003. // To filter on multiple expressions, provide each separate expression
  70004. // within parentheses. For example, (scheduling.automaticRestart = true)
  70005. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70006. // AND expression. However, you can include AND and OR expressions
  70007. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70008. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70009. // true).
  70010. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  70011. c.urlParams_.Set("filter", filter)
  70012. return c
  70013. }
  70014. // MaxResults sets the optional parameter "maxResults": The maximum
  70015. // number of results per page that should be returned. If the number of
  70016. // available results is larger than maxResults, Compute Engine returns a
  70017. // nextPageToken that can be used to get the next page of results in
  70018. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70019. // (Default: 500)
  70020. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  70021. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70022. return c
  70023. }
  70024. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70025. // a certain order. By default, results are returned in alphanumerical
  70026. // order based on the resource name.
  70027. //
  70028. // You can also sort results in descending order based on the creation
  70029. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70030. // based on the creationTimestamp field in reverse chronological order
  70031. // (newest result first). Use this to sort resources like operations so
  70032. // that the newest operation is returned first.
  70033. //
  70034. // Currently, only sorting by name or creationTimestamp desc is
  70035. // supported.
  70036. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  70037. c.urlParams_.Set("orderBy", orderBy)
  70038. return c
  70039. }
  70040. // PageToken sets the optional parameter "pageToken": Specifies a page
  70041. // token to use. Set pageToken to the nextPageToken returned by a
  70042. // previous list request to get the next page of results.
  70043. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  70044. c.urlParams_.Set("pageToken", pageToken)
  70045. return c
  70046. }
  70047. // Fields allows partial responses to be retrieved. See
  70048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70049. // for more information.
  70050. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  70051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70052. return c
  70053. }
  70054. // IfNoneMatch sets the optional parameter which makes the operation
  70055. // fail if the object's ETag matches the given value. This is useful for
  70056. // getting updates only after the object has changed since the last
  70057. // request. Use googleapi.IsNotModified to check whether the response
  70058. // error from Do is the result of In-None-Match.
  70059. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  70060. c.ifNoneMatch_ = entityTag
  70061. return c
  70062. }
  70063. // Context sets the context to be used in this call's Do method. Any
  70064. // pending HTTP request will be aborted if the provided context is
  70065. // canceled.
  70066. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  70067. c.ctx_ = ctx
  70068. return c
  70069. }
  70070. // Header returns an http.Header that can be modified by the caller to
  70071. // add HTTP headers to the request.
  70072. func (c *RegionDiskTypesListCall) Header() http.Header {
  70073. if c.header_ == nil {
  70074. c.header_ = make(http.Header)
  70075. }
  70076. return c.header_
  70077. }
  70078. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  70079. reqHeaders := make(http.Header)
  70080. for k, v := range c.header_ {
  70081. reqHeaders[k] = v
  70082. }
  70083. reqHeaders.Set("User-Agent", c.s.userAgent())
  70084. if c.ifNoneMatch_ != "" {
  70085. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70086. }
  70087. var body io.Reader = nil
  70088. c.urlParams_.Set("alt", alt)
  70089. c.urlParams_.Set("prettyPrint", "false")
  70090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  70091. urls += "?" + c.urlParams_.Encode()
  70092. req, err := http.NewRequest("GET", urls, body)
  70093. if err != nil {
  70094. return nil, err
  70095. }
  70096. req.Header = reqHeaders
  70097. googleapi.Expand(req.URL, map[string]string{
  70098. "project": c.project,
  70099. "region": c.region,
  70100. })
  70101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70102. }
  70103. // Do executes the "compute.regionDiskTypes.list" call.
  70104. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  70105. // non-2xx status code is an error. Response headers are in either
  70106. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  70107. // returned at all) in error.(*googleapi.Error).Header. Use
  70108. // googleapi.IsNotModified to check whether the returned error was
  70109. // because http.StatusNotModified was returned.
  70110. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  70111. gensupport.SetOptions(c.urlParams_, opts...)
  70112. res, err := c.doRequest("json")
  70113. if res != nil && res.StatusCode == http.StatusNotModified {
  70114. if res.Body != nil {
  70115. res.Body.Close()
  70116. }
  70117. return nil, &googleapi.Error{
  70118. Code: res.StatusCode,
  70119. Header: res.Header,
  70120. }
  70121. }
  70122. if err != nil {
  70123. return nil, err
  70124. }
  70125. defer googleapi.CloseBody(res)
  70126. if err := googleapi.CheckResponse(res); err != nil {
  70127. return nil, err
  70128. }
  70129. ret := &RegionDiskTypeList{
  70130. ServerResponse: googleapi.ServerResponse{
  70131. Header: res.Header,
  70132. HTTPStatusCode: res.StatusCode,
  70133. },
  70134. }
  70135. target := &ret
  70136. if err := gensupport.DecodeResponse(target, res); err != nil {
  70137. return nil, err
  70138. }
  70139. return ret, nil
  70140. // {
  70141. // "description": "Retrieves a list of regional disk types available to the specified project.",
  70142. // "httpMethod": "GET",
  70143. // "id": "compute.regionDiskTypes.list",
  70144. // "parameterOrder": [
  70145. // "project",
  70146. // "region"
  70147. // ],
  70148. // "parameters": {
  70149. // "filter": {
  70150. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  70151. // "location": "query",
  70152. // "type": "string"
  70153. // },
  70154. // "maxResults": {
  70155. // "default": "500",
  70156. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  70157. // "format": "uint32",
  70158. // "location": "query",
  70159. // "minimum": "0",
  70160. // "type": "integer"
  70161. // },
  70162. // "orderBy": {
  70163. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  70164. // "location": "query",
  70165. // "type": "string"
  70166. // },
  70167. // "pageToken": {
  70168. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  70169. // "location": "query",
  70170. // "type": "string"
  70171. // },
  70172. // "project": {
  70173. // "description": "Project ID for this request.",
  70174. // "location": "path",
  70175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70176. // "required": true,
  70177. // "type": "string"
  70178. // },
  70179. // "region": {
  70180. // "description": "The name of the region for this request.",
  70181. // "location": "path",
  70182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70183. // "required": true,
  70184. // "type": "string"
  70185. // }
  70186. // },
  70187. // "path": "{project}/regions/{region}/diskTypes",
  70188. // "response": {
  70189. // "$ref": "RegionDiskTypeList"
  70190. // },
  70191. // "scopes": [
  70192. // "https://www.googleapis.com/auth/cloud-platform",
  70193. // "https://www.googleapis.com/auth/compute",
  70194. // "https://www.googleapis.com/auth/compute.readonly"
  70195. // ]
  70196. // }
  70197. }
  70198. // Pages invokes f for each page of results.
  70199. // A non-nil error returned from f will halt the iteration.
  70200. // The provided context supersedes any context provided to the Context method.
  70201. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  70202. c.ctx_ = ctx
  70203. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70204. for {
  70205. x, err := c.Do()
  70206. if err != nil {
  70207. return err
  70208. }
  70209. if err := f(x); err != nil {
  70210. return err
  70211. }
  70212. if x.NextPageToken == "" {
  70213. return nil
  70214. }
  70215. c.PageToken(x.NextPageToken)
  70216. }
  70217. }
  70218. // method id "compute.regionDisks.createSnapshot":
  70219. type RegionDisksCreateSnapshotCall struct {
  70220. s *Service
  70221. project string
  70222. region string
  70223. disk string
  70224. snapshot *Snapshot
  70225. urlParams_ gensupport.URLParams
  70226. ctx_ context.Context
  70227. header_ http.Header
  70228. }
  70229. // CreateSnapshot: Creates a snapshot of this regional disk.
  70230. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  70231. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70232. c.project = project
  70233. c.region = region
  70234. c.disk = disk
  70235. c.snapshot = snapshot
  70236. return c
  70237. }
  70238. // RequestId sets the optional parameter "requestId": An optional
  70239. // request ID to identify requests. Specify a unique request ID so that
  70240. // if you must retry your request, the server will know to ignore the
  70241. // request if it has already been completed.
  70242. //
  70243. // For example, consider a situation where you make an initial request
  70244. // and the request times out. If you make the request again with the
  70245. // same request ID, the server can check if original operation with the
  70246. // same request ID was received, and if so, will ignore the second
  70247. // request. This prevents clients from accidentally creating duplicate
  70248. // commitments.
  70249. //
  70250. // The request ID must be a valid UUID with the exception that zero UUID
  70251. // is not supported (00000000-0000-0000-0000-000000000000).
  70252. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  70253. c.urlParams_.Set("requestId", requestId)
  70254. return c
  70255. }
  70256. // Fields allows partial responses to be retrieved. See
  70257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70258. // for more information.
  70259. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  70260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70261. return c
  70262. }
  70263. // Context sets the context to be used in this call's Do method. Any
  70264. // pending HTTP request will be aborted if the provided context is
  70265. // canceled.
  70266. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  70267. c.ctx_ = ctx
  70268. return c
  70269. }
  70270. // Header returns an http.Header that can be modified by the caller to
  70271. // add HTTP headers to the request.
  70272. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  70273. if c.header_ == nil {
  70274. c.header_ = make(http.Header)
  70275. }
  70276. return c.header_
  70277. }
  70278. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  70279. reqHeaders := make(http.Header)
  70280. for k, v := range c.header_ {
  70281. reqHeaders[k] = v
  70282. }
  70283. reqHeaders.Set("User-Agent", c.s.userAgent())
  70284. var body io.Reader = nil
  70285. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  70286. if err != nil {
  70287. return nil, err
  70288. }
  70289. reqHeaders.Set("Content-Type", "application/json")
  70290. c.urlParams_.Set("alt", alt)
  70291. c.urlParams_.Set("prettyPrint", "false")
  70292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  70293. urls += "?" + c.urlParams_.Encode()
  70294. req, err := http.NewRequest("POST", urls, body)
  70295. if err != nil {
  70296. return nil, err
  70297. }
  70298. req.Header = reqHeaders
  70299. googleapi.Expand(req.URL, map[string]string{
  70300. "project": c.project,
  70301. "region": c.region,
  70302. "disk": c.disk,
  70303. })
  70304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70305. }
  70306. // Do executes the "compute.regionDisks.createSnapshot" call.
  70307. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70308. // status code is an error. Response headers are in either
  70309. // *Operation.ServerResponse.Header or (if a response was returned at
  70310. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70311. // to check whether the returned error was because
  70312. // http.StatusNotModified was returned.
  70313. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70314. gensupport.SetOptions(c.urlParams_, opts...)
  70315. res, err := c.doRequest("json")
  70316. if res != nil && res.StatusCode == http.StatusNotModified {
  70317. if res.Body != nil {
  70318. res.Body.Close()
  70319. }
  70320. return nil, &googleapi.Error{
  70321. Code: res.StatusCode,
  70322. Header: res.Header,
  70323. }
  70324. }
  70325. if err != nil {
  70326. return nil, err
  70327. }
  70328. defer googleapi.CloseBody(res)
  70329. if err := googleapi.CheckResponse(res); err != nil {
  70330. return nil, err
  70331. }
  70332. ret := &Operation{
  70333. ServerResponse: googleapi.ServerResponse{
  70334. Header: res.Header,
  70335. HTTPStatusCode: res.StatusCode,
  70336. },
  70337. }
  70338. target := &ret
  70339. if err := gensupport.DecodeResponse(target, res); err != nil {
  70340. return nil, err
  70341. }
  70342. return ret, nil
  70343. // {
  70344. // "description": "Creates a snapshot of this regional disk.",
  70345. // "httpMethod": "POST",
  70346. // "id": "compute.regionDisks.createSnapshot",
  70347. // "parameterOrder": [
  70348. // "project",
  70349. // "region",
  70350. // "disk"
  70351. // ],
  70352. // "parameters": {
  70353. // "disk": {
  70354. // "description": "Name of the regional persistent disk to snapshot.",
  70355. // "location": "path",
  70356. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70357. // "required": true,
  70358. // "type": "string"
  70359. // },
  70360. // "project": {
  70361. // "description": "Project ID for this request.",
  70362. // "location": "path",
  70363. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70364. // "required": true,
  70365. // "type": "string"
  70366. // },
  70367. // "region": {
  70368. // "description": "Name of the region for this request.",
  70369. // "location": "path",
  70370. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70371. // "required": true,
  70372. // "type": "string"
  70373. // },
  70374. // "requestId": {
  70375. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70376. // "location": "query",
  70377. // "type": "string"
  70378. // }
  70379. // },
  70380. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  70381. // "request": {
  70382. // "$ref": "Snapshot"
  70383. // },
  70384. // "response": {
  70385. // "$ref": "Operation"
  70386. // },
  70387. // "scopes": [
  70388. // "https://www.googleapis.com/auth/cloud-platform",
  70389. // "https://www.googleapis.com/auth/compute"
  70390. // ]
  70391. // }
  70392. }
  70393. // method id "compute.regionDisks.delete":
  70394. type RegionDisksDeleteCall struct {
  70395. s *Service
  70396. project string
  70397. region string
  70398. disk string
  70399. urlParams_ gensupport.URLParams
  70400. ctx_ context.Context
  70401. header_ http.Header
  70402. }
  70403. // Delete: Deletes the specified regional persistent disk. Deleting a
  70404. // regional disk removes all the replicas of its data permanently and is
  70405. // irreversible. However, deleting a disk does not delete any snapshots
  70406. // previously made from the disk. You must separately delete snapshots.
  70407. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  70408. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70409. c.project = project
  70410. c.region = region
  70411. c.disk = disk
  70412. return c
  70413. }
  70414. // RequestId sets the optional parameter "requestId": An optional
  70415. // request ID to identify requests. Specify a unique request ID so that
  70416. // if you must retry your request, the server will know to ignore the
  70417. // request if it has already been completed.
  70418. //
  70419. // For example, consider a situation where you make an initial request
  70420. // and the request times out. If you make the request again with the
  70421. // same request ID, the server can check if original operation with the
  70422. // same request ID was received, and if so, will ignore the second
  70423. // request. This prevents clients from accidentally creating duplicate
  70424. // commitments.
  70425. //
  70426. // The request ID must be a valid UUID with the exception that zero UUID
  70427. // is not supported (00000000-0000-0000-0000-000000000000).
  70428. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  70429. c.urlParams_.Set("requestId", requestId)
  70430. return c
  70431. }
  70432. // Fields allows partial responses to be retrieved. See
  70433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70434. // for more information.
  70435. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  70436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70437. return c
  70438. }
  70439. // Context sets the context to be used in this call's Do method. Any
  70440. // pending HTTP request will be aborted if the provided context is
  70441. // canceled.
  70442. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  70443. c.ctx_ = ctx
  70444. return c
  70445. }
  70446. // Header returns an http.Header that can be modified by the caller to
  70447. // add HTTP headers to the request.
  70448. func (c *RegionDisksDeleteCall) Header() http.Header {
  70449. if c.header_ == nil {
  70450. c.header_ = make(http.Header)
  70451. }
  70452. return c.header_
  70453. }
  70454. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  70455. reqHeaders := make(http.Header)
  70456. for k, v := range c.header_ {
  70457. reqHeaders[k] = v
  70458. }
  70459. reqHeaders.Set("User-Agent", c.s.userAgent())
  70460. var body io.Reader = nil
  70461. c.urlParams_.Set("alt", alt)
  70462. c.urlParams_.Set("prettyPrint", "false")
  70463. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  70464. urls += "?" + c.urlParams_.Encode()
  70465. req, err := http.NewRequest("DELETE", urls, body)
  70466. if err != nil {
  70467. return nil, err
  70468. }
  70469. req.Header = reqHeaders
  70470. googleapi.Expand(req.URL, map[string]string{
  70471. "project": c.project,
  70472. "region": c.region,
  70473. "disk": c.disk,
  70474. })
  70475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70476. }
  70477. // Do executes the "compute.regionDisks.delete" call.
  70478. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70479. // status code is an error. Response headers are in either
  70480. // *Operation.ServerResponse.Header or (if a response was returned at
  70481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70482. // to check whether the returned error was because
  70483. // http.StatusNotModified was returned.
  70484. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70485. gensupport.SetOptions(c.urlParams_, opts...)
  70486. res, err := c.doRequest("json")
  70487. if res != nil && res.StatusCode == http.StatusNotModified {
  70488. if res.Body != nil {
  70489. res.Body.Close()
  70490. }
  70491. return nil, &googleapi.Error{
  70492. Code: res.StatusCode,
  70493. Header: res.Header,
  70494. }
  70495. }
  70496. if err != nil {
  70497. return nil, err
  70498. }
  70499. defer googleapi.CloseBody(res)
  70500. if err := googleapi.CheckResponse(res); err != nil {
  70501. return nil, err
  70502. }
  70503. ret := &Operation{
  70504. ServerResponse: googleapi.ServerResponse{
  70505. Header: res.Header,
  70506. HTTPStatusCode: res.StatusCode,
  70507. },
  70508. }
  70509. target := &ret
  70510. if err := gensupport.DecodeResponse(target, res); err != nil {
  70511. return nil, err
  70512. }
  70513. return ret, nil
  70514. // {
  70515. // "description": "Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
  70516. // "httpMethod": "DELETE",
  70517. // "id": "compute.regionDisks.delete",
  70518. // "parameterOrder": [
  70519. // "project",
  70520. // "region",
  70521. // "disk"
  70522. // ],
  70523. // "parameters": {
  70524. // "disk": {
  70525. // "description": "Name of the regional persistent disk to delete.",
  70526. // "location": "path",
  70527. // "required": true,
  70528. // "type": "string"
  70529. // },
  70530. // "project": {
  70531. // "description": "Project ID for this request.",
  70532. // "location": "path",
  70533. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70534. // "required": true,
  70535. // "type": "string"
  70536. // },
  70537. // "region": {
  70538. // "description": "Name of the region for this request.",
  70539. // "location": "path",
  70540. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70541. // "required": true,
  70542. // "type": "string"
  70543. // },
  70544. // "requestId": {
  70545. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70546. // "location": "query",
  70547. // "type": "string"
  70548. // }
  70549. // },
  70550. // "path": "{project}/regions/{region}/disks/{disk}",
  70551. // "response": {
  70552. // "$ref": "Operation"
  70553. // },
  70554. // "scopes": [
  70555. // "https://www.googleapis.com/auth/cloud-platform",
  70556. // "https://www.googleapis.com/auth/compute"
  70557. // ]
  70558. // }
  70559. }
  70560. // method id "compute.regionDisks.get":
  70561. type RegionDisksGetCall struct {
  70562. s *Service
  70563. project string
  70564. region string
  70565. disk string
  70566. urlParams_ gensupport.URLParams
  70567. ifNoneMatch_ string
  70568. ctx_ context.Context
  70569. header_ http.Header
  70570. }
  70571. // Get: Returns a specified regional persistent disk.
  70572. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  70573. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70574. c.project = project
  70575. c.region = region
  70576. c.disk = disk
  70577. return c
  70578. }
  70579. // Fields allows partial responses to be retrieved. See
  70580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70581. // for more information.
  70582. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  70583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70584. return c
  70585. }
  70586. // IfNoneMatch sets the optional parameter which makes the operation
  70587. // fail if the object's ETag matches the given value. This is useful for
  70588. // getting updates only after the object has changed since the last
  70589. // request. Use googleapi.IsNotModified to check whether the response
  70590. // error from Do is the result of In-None-Match.
  70591. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  70592. c.ifNoneMatch_ = entityTag
  70593. return c
  70594. }
  70595. // Context sets the context to be used in this call's Do method. Any
  70596. // pending HTTP request will be aborted if the provided context is
  70597. // canceled.
  70598. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  70599. c.ctx_ = ctx
  70600. return c
  70601. }
  70602. // Header returns an http.Header that can be modified by the caller to
  70603. // add HTTP headers to the request.
  70604. func (c *RegionDisksGetCall) Header() http.Header {
  70605. if c.header_ == nil {
  70606. c.header_ = make(http.Header)
  70607. }
  70608. return c.header_
  70609. }
  70610. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  70611. reqHeaders := make(http.Header)
  70612. for k, v := range c.header_ {
  70613. reqHeaders[k] = v
  70614. }
  70615. reqHeaders.Set("User-Agent", c.s.userAgent())
  70616. if c.ifNoneMatch_ != "" {
  70617. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70618. }
  70619. var body io.Reader = nil
  70620. c.urlParams_.Set("alt", alt)
  70621. c.urlParams_.Set("prettyPrint", "false")
  70622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  70623. urls += "?" + c.urlParams_.Encode()
  70624. req, err := http.NewRequest("GET", urls, body)
  70625. if err != nil {
  70626. return nil, err
  70627. }
  70628. req.Header = reqHeaders
  70629. googleapi.Expand(req.URL, map[string]string{
  70630. "project": c.project,
  70631. "region": c.region,
  70632. "disk": c.disk,
  70633. })
  70634. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70635. }
  70636. // Do executes the "compute.regionDisks.get" call.
  70637. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  70638. // code is an error. Response headers are in either
  70639. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  70640. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  70641. // whether the returned error was because http.StatusNotModified was
  70642. // returned.
  70643. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  70644. gensupport.SetOptions(c.urlParams_, opts...)
  70645. res, err := c.doRequest("json")
  70646. if res != nil && res.StatusCode == http.StatusNotModified {
  70647. if res.Body != nil {
  70648. res.Body.Close()
  70649. }
  70650. return nil, &googleapi.Error{
  70651. Code: res.StatusCode,
  70652. Header: res.Header,
  70653. }
  70654. }
  70655. if err != nil {
  70656. return nil, err
  70657. }
  70658. defer googleapi.CloseBody(res)
  70659. if err := googleapi.CheckResponse(res); err != nil {
  70660. return nil, err
  70661. }
  70662. ret := &Disk{
  70663. ServerResponse: googleapi.ServerResponse{
  70664. Header: res.Header,
  70665. HTTPStatusCode: res.StatusCode,
  70666. },
  70667. }
  70668. target := &ret
  70669. if err := gensupport.DecodeResponse(target, res); err != nil {
  70670. return nil, err
  70671. }
  70672. return ret, nil
  70673. // {
  70674. // "description": "Returns a specified regional persistent disk.",
  70675. // "httpMethod": "GET",
  70676. // "id": "compute.regionDisks.get",
  70677. // "parameterOrder": [
  70678. // "project",
  70679. // "region",
  70680. // "disk"
  70681. // ],
  70682. // "parameters": {
  70683. // "disk": {
  70684. // "description": "Name of the regional persistent disk to return.",
  70685. // "location": "path",
  70686. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70687. // "required": true,
  70688. // "type": "string"
  70689. // },
  70690. // "project": {
  70691. // "description": "Project ID for this request.",
  70692. // "location": "path",
  70693. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70694. // "required": true,
  70695. // "type": "string"
  70696. // },
  70697. // "region": {
  70698. // "description": "Name of the region for this request.",
  70699. // "location": "path",
  70700. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70701. // "required": true,
  70702. // "type": "string"
  70703. // }
  70704. // },
  70705. // "path": "{project}/regions/{region}/disks/{disk}",
  70706. // "response": {
  70707. // "$ref": "Disk"
  70708. // },
  70709. // "scopes": [
  70710. // "https://www.googleapis.com/auth/cloud-platform",
  70711. // "https://www.googleapis.com/auth/compute",
  70712. // "https://www.googleapis.com/auth/compute.readonly"
  70713. // ]
  70714. // }
  70715. }
  70716. // method id "compute.regionDisks.insert":
  70717. type RegionDisksInsertCall struct {
  70718. s *Service
  70719. project string
  70720. region string
  70721. disk *Disk
  70722. urlParams_ gensupport.URLParams
  70723. ctx_ context.Context
  70724. header_ http.Header
  70725. }
  70726. // Insert: Creates a persistent regional disk in the specified project
  70727. // using the data included in the request.
  70728. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  70729. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70730. c.project = project
  70731. c.region = region
  70732. c.disk = disk
  70733. return c
  70734. }
  70735. // RequestId sets the optional parameter "requestId": An optional
  70736. // request ID to identify requests. Specify a unique request ID so that
  70737. // if you must retry your request, the server will know to ignore the
  70738. // request if it has already been completed.
  70739. //
  70740. // For example, consider a situation where you make an initial request
  70741. // and the request times out. If you make the request again with the
  70742. // same request ID, the server can check if original operation with the
  70743. // same request ID was received, and if so, will ignore the second
  70744. // request. This prevents clients from accidentally creating duplicate
  70745. // commitments.
  70746. //
  70747. // The request ID must be a valid UUID with the exception that zero UUID
  70748. // is not supported (00000000-0000-0000-0000-000000000000).
  70749. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  70750. c.urlParams_.Set("requestId", requestId)
  70751. return c
  70752. }
  70753. // SourceImage sets the optional parameter "sourceImage": Source image
  70754. // to restore onto a disk.
  70755. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  70756. c.urlParams_.Set("sourceImage", sourceImage)
  70757. return c
  70758. }
  70759. // Fields allows partial responses to be retrieved. See
  70760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70761. // for more information.
  70762. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  70763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70764. return c
  70765. }
  70766. // Context sets the context to be used in this call's Do method. Any
  70767. // pending HTTP request will be aborted if the provided context is
  70768. // canceled.
  70769. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  70770. c.ctx_ = ctx
  70771. return c
  70772. }
  70773. // Header returns an http.Header that can be modified by the caller to
  70774. // add HTTP headers to the request.
  70775. func (c *RegionDisksInsertCall) Header() http.Header {
  70776. if c.header_ == nil {
  70777. c.header_ = make(http.Header)
  70778. }
  70779. return c.header_
  70780. }
  70781. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  70782. reqHeaders := make(http.Header)
  70783. for k, v := range c.header_ {
  70784. reqHeaders[k] = v
  70785. }
  70786. reqHeaders.Set("User-Agent", c.s.userAgent())
  70787. var body io.Reader = nil
  70788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  70789. if err != nil {
  70790. return nil, err
  70791. }
  70792. reqHeaders.Set("Content-Type", "application/json")
  70793. c.urlParams_.Set("alt", alt)
  70794. c.urlParams_.Set("prettyPrint", "false")
  70795. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  70796. urls += "?" + c.urlParams_.Encode()
  70797. req, err := http.NewRequest("POST", urls, body)
  70798. if err != nil {
  70799. return nil, err
  70800. }
  70801. req.Header = reqHeaders
  70802. googleapi.Expand(req.URL, map[string]string{
  70803. "project": c.project,
  70804. "region": c.region,
  70805. })
  70806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70807. }
  70808. // Do executes the "compute.regionDisks.insert" call.
  70809. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70810. // status code is an error. Response headers are in either
  70811. // *Operation.ServerResponse.Header or (if a response was returned at
  70812. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70813. // to check whether the returned error was because
  70814. // http.StatusNotModified was returned.
  70815. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70816. gensupport.SetOptions(c.urlParams_, opts...)
  70817. res, err := c.doRequest("json")
  70818. if res != nil && res.StatusCode == http.StatusNotModified {
  70819. if res.Body != nil {
  70820. res.Body.Close()
  70821. }
  70822. return nil, &googleapi.Error{
  70823. Code: res.StatusCode,
  70824. Header: res.Header,
  70825. }
  70826. }
  70827. if err != nil {
  70828. return nil, err
  70829. }
  70830. defer googleapi.CloseBody(res)
  70831. if err := googleapi.CheckResponse(res); err != nil {
  70832. return nil, err
  70833. }
  70834. ret := &Operation{
  70835. ServerResponse: googleapi.ServerResponse{
  70836. Header: res.Header,
  70837. HTTPStatusCode: res.StatusCode,
  70838. },
  70839. }
  70840. target := &ret
  70841. if err := gensupport.DecodeResponse(target, res); err != nil {
  70842. return nil, err
  70843. }
  70844. return ret, nil
  70845. // {
  70846. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  70847. // "httpMethod": "POST",
  70848. // "id": "compute.regionDisks.insert",
  70849. // "parameterOrder": [
  70850. // "project",
  70851. // "region"
  70852. // ],
  70853. // "parameters": {
  70854. // "project": {
  70855. // "description": "Project ID for this request.",
  70856. // "location": "path",
  70857. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70858. // "required": true,
  70859. // "type": "string"
  70860. // },
  70861. // "region": {
  70862. // "description": "Name of the region for this request.",
  70863. // "location": "path",
  70864. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70865. // "required": true,
  70866. // "type": "string"
  70867. // },
  70868. // "requestId": {
  70869. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70870. // "location": "query",
  70871. // "type": "string"
  70872. // },
  70873. // "sourceImage": {
  70874. // "description": "Optional. Source image to restore onto a disk.",
  70875. // "location": "query",
  70876. // "type": "string"
  70877. // }
  70878. // },
  70879. // "path": "{project}/regions/{region}/disks",
  70880. // "request": {
  70881. // "$ref": "Disk"
  70882. // },
  70883. // "response": {
  70884. // "$ref": "Operation"
  70885. // },
  70886. // "scopes": [
  70887. // "https://www.googleapis.com/auth/cloud-platform",
  70888. // "https://www.googleapis.com/auth/compute"
  70889. // ]
  70890. // }
  70891. }
  70892. // method id "compute.regionDisks.list":
  70893. type RegionDisksListCall struct {
  70894. s *Service
  70895. project string
  70896. region string
  70897. urlParams_ gensupport.URLParams
  70898. ifNoneMatch_ string
  70899. ctx_ context.Context
  70900. header_ http.Header
  70901. }
  70902. // List: Retrieves the list of persistent disks contained within the
  70903. // specified region.
  70904. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  70905. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70906. c.project = project
  70907. c.region = region
  70908. return c
  70909. }
  70910. // Filter sets the optional parameter "filter": A filter expression that
  70911. // filters resources listed in the response. The expression must specify
  70912. // the field name, a comparison operator, and the value that you want to
  70913. // use for filtering. The value must be a string, a number, or a
  70914. // boolean. The comparison operator must be either =, !=, >, or <.
  70915. //
  70916. // For example, if you are filtering Compute Engine instances, you can
  70917. // exclude instances named example-instance by specifying name !=
  70918. // example-instance.
  70919. //
  70920. // You can also filter nested fields. For example, you could specify
  70921. // scheduling.automaticRestart = false to include instances only if they
  70922. // are not scheduled for automatic restarts. You can use filtering on
  70923. // nested fields to filter based on resource labels.
  70924. //
  70925. // To filter on multiple expressions, provide each separate expression
  70926. // within parentheses. For example, (scheduling.automaticRestart = true)
  70927. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70928. // AND expression. However, you can include AND and OR expressions
  70929. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70930. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70931. // true).
  70932. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  70933. c.urlParams_.Set("filter", filter)
  70934. return c
  70935. }
  70936. // MaxResults sets the optional parameter "maxResults": The maximum
  70937. // number of results per page that should be returned. If the number of
  70938. // available results is larger than maxResults, Compute Engine returns a
  70939. // nextPageToken that can be used to get the next page of results in
  70940. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70941. // (Default: 500)
  70942. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  70943. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70944. return c
  70945. }
  70946. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70947. // a certain order. By default, results are returned in alphanumerical
  70948. // order based on the resource name.
  70949. //
  70950. // You can also sort results in descending order based on the creation
  70951. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70952. // based on the creationTimestamp field in reverse chronological order
  70953. // (newest result first). Use this to sort resources like operations so
  70954. // that the newest operation is returned first.
  70955. //
  70956. // Currently, only sorting by name or creationTimestamp desc is
  70957. // supported.
  70958. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  70959. c.urlParams_.Set("orderBy", orderBy)
  70960. return c
  70961. }
  70962. // PageToken sets the optional parameter "pageToken": Specifies a page
  70963. // token to use. Set pageToken to the nextPageToken returned by a
  70964. // previous list request to get the next page of results.
  70965. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  70966. c.urlParams_.Set("pageToken", pageToken)
  70967. return c
  70968. }
  70969. // Fields allows partial responses to be retrieved. See
  70970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70971. // for more information.
  70972. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  70973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70974. return c
  70975. }
  70976. // IfNoneMatch sets the optional parameter which makes the operation
  70977. // fail if the object's ETag matches the given value. This is useful for
  70978. // getting updates only after the object has changed since the last
  70979. // request. Use googleapi.IsNotModified to check whether the response
  70980. // error from Do is the result of In-None-Match.
  70981. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  70982. c.ifNoneMatch_ = entityTag
  70983. return c
  70984. }
  70985. // Context sets the context to be used in this call's Do method. Any
  70986. // pending HTTP request will be aborted if the provided context is
  70987. // canceled.
  70988. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  70989. c.ctx_ = ctx
  70990. return c
  70991. }
  70992. // Header returns an http.Header that can be modified by the caller to
  70993. // add HTTP headers to the request.
  70994. func (c *RegionDisksListCall) Header() http.Header {
  70995. if c.header_ == nil {
  70996. c.header_ = make(http.Header)
  70997. }
  70998. return c.header_
  70999. }
  71000. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  71001. reqHeaders := make(http.Header)
  71002. for k, v := range c.header_ {
  71003. reqHeaders[k] = v
  71004. }
  71005. reqHeaders.Set("User-Agent", c.s.userAgent())
  71006. if c.ifNoneMatch_ != "" {
  71007. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71008. }
  71009. var body io.Reader = nil
  71010. c.urlParams_.Set("alt", alt)
  71011. c.urlParams_.Set("prettyPrint", "false")
  71012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  71013. urls += "?" + c.urlParams_.Encode()
  71014. req, err := http.NewRequest("GET", urls, body)
  71015. if err != nil {
  71016. return nil, err
  71017. }
  71018. req.Header = reqHeaders
  71019. googleapi.Expand(req.URL, map[string]string{
  71020. "project": c.project,
  71021. "region": c.region,
  71022. })
  71023. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71024. }
  71025. // Do executes the "compute.regionDisks.list" call.
  71026. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  71027. // code is an error. Response headers are in either
  71028. // *DiskList.ServerResponse.Header or (if a response was returned at
  71029. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71030. // to check whether the returned error was because
  71031. // http.StatusNotModified was returned.
  71032. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  71033. gensupport.SetOptions(c.urlParams_, opts...)
  71034. res, err := c.doRequest("json")
  71035. if res != nil && res.StatusCode == http.StatusNotModified {
  71036. if res.Body != nil {
  71037. res.Body.Close()
  71038. }
  71039. return nil, &googleapi.Error{
  71040. Code: res.StatusCode,
  71041. Header: res.Header,
  71042. }
  71043. }
  71044. if err != nil {
  71045. return nil, err
  71046. }
  71047. defer googleapi.CloseBody(res)
  71048. if err := googleapi.CheckResponse(res); err != nil {
  71049. return nil, err
  71050. }
  71051. ret := &DiskList{
  71052. ServerResponse: googleapi.ServerResponse{
  71053. Header: res.Header,
  71054. HTTPStatusCode: res.StatusCode,
  71055. },
  71056. }
  71057. target := &ret
  71058. if err := gensupport.DecodeResponse(target, res); err != nil {
  71059. return nil, err
  71060. }
  71061. return ret, nil
  71062. // {
  71063. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  71064. // "httpMethod": "GET",
  71065. // "id": "compute.regionDisks.list",
  71066. // "parameterOrder": [
  71067. // "project",
  71068. // "region"
  71069. // ],
  71070. // "parameters": {
  71071. // "filter": {
  71072. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  71073. // "location": "query",
  71074. // "type": "string"
  71075. // },
  71076. // "maxResults": {
  71077. // "default": "500",
  71078. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  71079. // "format": "uint32",
  71080. // "location": "query",
  71081. // "minimum": "0",
  71082. // "type": "integer"
  71083. // },
  71084. // "orderBy": {
  71085. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  71086. // "location": "query",
  71087. // "type": "string"
  71088. // },
  71089. // "pageToken": {
  71090. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  71091. // "location": "query",
  71092. // "type": "string"
  71093. // },
  71094. // "project": {
  71095. // "description": "Project ID for this request.",
  71096. // "location": "path",
  71097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71098. // "required": true,
  71099. // "type": "string"
  71100. // },
  71101. // "region": {
  71102. // "description": "Name of the region for this request.",
  71103. // "location": "path",
  71104. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71105. // "required": true,
  71106. // "type": "string"
  71107. // }
  71108. // },
  71109. // "path": "{project}/regions/{region}/disks",
  71110. // "response": {
  71111. // "$ref": "DiskList"
  71112. // },
  71113. // "scopes": [
  71114. // "https://www.googleapis.com/auth/cloud-platform",
  71115. // "https://www.googleapis.com/auth/compute",
  71116. // "https://www.googleapis.com/auth/compute.readonly"
  71117. // ]
  71118. // }
  71119. }
  71120. // Pages invokes f for each page of results.
  71121. // A non-nil error returned from f will halt the iteration.
  71122. // The provided context supersedes any context provided to the Context method.
  71123. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  71124. c.ctx_ = ctx
  71125. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71126. for {
  71127. x, err := c.Do()
  71128. if err != nil {
  71129. return err
  71130. }
  71131. if err := f(x); err != nil {
  71132. return err
  71133. }
  71134. if x.NextPageToken == "" {
  71135. return nil
  71136. }
  71137. c.PageToken(x.NextPageToken)
  71138. }
  71139. }
  71140. // method id "compute.regionDisks.resize":
  71141. type RegionDisksResizeCall struct {
  71142. s *Service
  71143. project string
  71144. region string
  71145. disk string
  71146. regiondisksresizerequest *RegionDisksResizeRequest
  71147. urlParams_ gensupport.URLParams
  71148. ctx_ context.Context
  71149. header_ http.Header
  71150. }
  71151. // Resize: Resizes the specified regional persistent disk.
  71152. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  71153. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71154. c.project = project
  71155. c.region = region
  71156. c.disk = disk
  71157. c.regiondisksresizerequest = regiondisksresizerequest
  71158. return c
  71159. }
  71160. // RequestId sets the optional parameter "requestId": An optional
  71161. // request ID to identify requests. Specify a unique request ID so that
  71162. // if you must retry your request, the server will know to ignore the
  71163. // request if it has already been completed.
  71164. //
  71165. // For example, consider a situation where you make an initial request
  71166. // and the request times out. If you make the request again with the
  71167. // same request ID, the server can check if original operation with the
  71168. // same request ID was received, and if so, will ignore the second
  71169. // request. This prevents clients from accidentally creating duplicate
  71170. // commitments.
  71171. //
  71172. // The request ID must be a valid UUID with the exception that zero UUID
  71173. // is not supported (00000000-0000-0000-0000-000000000000).
  71174. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  71175. c.urlParams_.Set("requestId", requestId)
  71176. return c
  71177. }
  71178. // Fields allows partial responses to be retrieved. See
  71179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71180. // for more information.
  71181. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  71182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71183. return c
  71184. }
  71185. // Context sets the context to be used in this call's Do method. Any
  71186. // pending HTTP request will be aborted if the provided context is
  71187. // canceled.
  71188. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  71189. c.ctx_ = ctx
  71190. return c
  71191. }
  71192. // Header returns an http.Header that can be modified by the caller to
  71193. // add HTTP headers to the request.
  71194. func (c *RegionDisksResizeCall) Header() http.Header {
  71195. if c.header_ == nil {
  71196. c.header_ = make(http.Header)
  71197. }
  71198. return c.header_
  71199. }
  71200. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  71201. reqHeaders := make(http.Header)
  71202. for k, v := range c.header_ {
  71203. reqHeaders[k] = v
  71204. }
  71205. reqHeaders.Set("User-Agent", c.s.userAgent())
  71206. var body io.Reader = nil
  71207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  71208. if err != nil {
  71209. return nil, err
  71210. }
  71211. reqHeaders.Set("Content-Type", "application/json")
  71212. c.urlParams_.Set("alt", alt)
  71213. c.urlParams_.Set("prettyPrint", "false")
  71214. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  71215. urls += "?" + c.urlParams_.Encode()
  71216. req, err := http.NewRequest("POST", urls, body)
  71217. if err != nil {
  71218. return nil, err
  71219. }
  71220. req.Header = reqHeaders
  71221. googleapi.Expand(req.URL, map[string]string{
  71222. "project": c.project,
  71223. "region": c.region,
  71224. "disk": c.disk,
  71225. })
  71226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71227. }
  71228. // Do executes the "compute.regionDisks.resize" call.
  71229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71230. // status code is an error. Response headers are in either
  71231. // *Operation.ServerResponse.Header or (if a response was returned at
  71232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71233. // to check whether the returned error was because
  71234. // http.StatusNotModified was returned.
  71235. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71236. gensupport.SetOptions(c.urlParams_, opts...)
  71237. res, err := c.doRequest("json")
  71238. if res != nil && res.StatusCode == http.StatusNotModified {
  71239. if res.Body != nil {
  71240. res.Body.Close()
  71241. }
  71242. return nil, &googleapi.Error{
  71243. Code: res.StatusCode,
  71244. Header: res.Header,
  71245. }
  71246. }
  71247. if err != nil {
  71248. return nil, err
  71249. }
  71250. defer googleapi.CloseBody(res)
  71251. if err := googleapi.CheckResponse(res); err != nil {
  71252. return nil, err
  71253. }
  71254. ret := &Operation{
  71255. ServerResponse: googleapi.ServerResponse{
  71256. Header: res.Header,
  71257. HTTPStatusCode: res.StatusCode,
  71258. },
  71259. }
  71260. target := &ret
  71261. if err := gensupport.DecodeResponse(target, res); err != nil {
  71262. return nil, err
  71263. }
  71264. return ret, nil
  71265. // {
  71266. // "description": "Resizes the specified regional persistent disk.",
  71267. // "httpMethod": "POST",
  71268. // "id": "compute.regionDisks.resize",
  71269. // "parameterOrder": [
  71270. // "project",
  71271. // "region",
  71272. // "disk"
  71273. // ],
  71274. // "parameters": {
  71275. // "disk": {
  71276. // "description": "Name of the regional persistent disk.",
  71277. // "location": "path",
  71278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71279. // "required": true,
  71280. // "type": "string"
  71281. // },
  71282. // "project": {
  71283. // "description": "The project ID for this request.",
  71284. // "location": "path",
  71285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71286. // "required": true,
  71287. // "type": "string"
  71288. // },
  71289. // "region": {
  71290. // "description": "Name of the region for this request.",
  71291. // "location": "path",
  71292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71293. // "required": true,
  71294. // "type": "string"
  71295. // },
  71296. // "requestId": {
  71297. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71298. // "location": "query",
  71299. // "type": "string"
  71300. // }
  71301. // },
  71302. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  71303. // "request": {
  71304. // "$ref": "RegionDisksResizeRequest"
  71305. // },
  71306. // "response": {
  71307. // "$ref": "Operation"
  71308. // },
  71309. // "scopes": [
  71310. // "https://www.googleapis.com/auth/cloud-platform",
  71311. // "https://www.googleapis.com/auth/compute"
  71312. // ]
  71313. // }
  71314. }
  71315. // method id "compute.regionDisks.setLabels":
  71316. type RegionDisksSetLabelsCall struct {
  71317. s *Service
  71318. project string
  71319. region string
  71320. resource string
  71321. regionsetlabelsrequest *RegionSetLabelsRequest
  71322. urlParams_ gensupport.URLParams
  71323. ctx_ context.Context
  71324. header_ http.Header
  71325. }
  71326. // SetLabels: Sets the labels on the target regional disk.
  71327. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  71328. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71329. c.project = project
  71330. c.region = region
  71331. c.resource = resource
  71332. c.regionsetlabelsrequest = regionsetlabelsrequest
  71333. return c
  71334. }
  71335. // RequestId sets the optional parameter "requestId": An optional
  71336. // request ID to identify requests. Specify a unique request ID so that
  71337. // if you must retry your request, the server will know to ignore the
  71338. // request if it has already been completed.
  71339. //
  71340. // For example, consider a situation where you make an initial request
  71341. // and the request times out. If you make the request again with the
  71342. // same request ID, the server can check if original operation with the
  71343. // same request ID was received, and if so, will ignore the second
  71344. // request. This prevents clients from accidentally creating duplicate
  71345. // commitments.
  71346. //
  71347. // The request ID must be a valid UUID with the exception that zero UUID
  71348. // is not supported (00000000-0000-0000-0000-000000000000).
  71349. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  71350. c.urlParams_.Set("requestId", requestId)
  71351. return c
  71352. }
  71353. // Fields allows partial responses to be retrieved. See
  71354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71355. // for more information.
  71356. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  71357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71358. return c
  71359. }
  71360. // Context sets the context to be used in this call's Do method. Any
  71361. // pending HTTP request will be aborted if the provided context is
  71362. // canceled.
  71363. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  71364. c.ctx_ = ctx
  71365. return c
  71366. }
  71367. // Header returns an http.Header that can be modified by the caller to
  71368. // add HTTP headers to the request.
  71369. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  71370. if c.header_ == nil {
  71371. c.header_ = make(http.Header)
  71372. }
  71373. return c.header_
  71374. }
  71375. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  71376. reqHeaders := make(http.Header)
  71377. for k, v := range c.header_ {
  71378. reqHeaders[k] = v
  71379. }
  71380. reqHeaders.Set("User-Agent", c.s.userAgent())
  71381. var body io.Reader = nil
  71382. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  71383. if err != nil {
  71384. return nil, err
  71385. }
  71386. reqHeaders.Set("Content-Type", "application/json")
  71387. c.urlParams_.Set("alt", alt)
  71388. c.urlParams_.Set("prettyPrint", "false")
  71389. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  71390. urls += "?" + c.urlParams_.Encode()
  71391. req, err := http.NewRequest("POST", urls, body)
  71392. if err != nil {
  71393. return nil, err
  71394. }
  71395. req.Header = reqHeaders
  71396. googleapi.Expand(req.URL, map[string]string{
  71397. "project": c.project,
  71398. "region": c.region,
  71399. "resource": c.resource,
  71400. })
  71401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71402. }
  71403. // Do executes the "compute.regionDisks.setLabels" call.
  71404. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71405. // status code is an error. Response headers are in either
  71406. // *Operation.ServerResponse.Header or (if a response was returned at
  71407. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71408. // to check whether the returned error was because
  71409. // http.StatusNotModified was returned.
  71410. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71411. gensupport.SetOptions(c.urlParams_, opts...)
  71412. res, err := c.doRequest("json")
  71413. if res != nil && res.StatusCode == http.StatusNotModified {
  71414. if res.Body != nil {
  71415. res.Body.Close()
  71416. }
  71417. return nil, &googleapi.Error{
  71418. Code: res.StatusCode,
  71419. Header: res.Header,
  71420. }
  71421. }
  71422. if err != nil {
  71423. return nil, err
  71424. }
  71425. defer googleapi.CloseBody(res)
  71426. if err := googleapi.CheckResponse(res); err != nil {
  71427. return nil, err
  71428. }
  71429. ret := &Operation{
  71430. ServerResponse: googleapi.ServerResponse{
  71431. Header: res.Header,
  71432. HTTPStatusCode: res.StatusCode,
  71433. },
  71434. }
  71435. target := &ret
  71436. if err := gensupport.DecodeResponse(target, res); err != nil {
  71437. return nil, err
  71438. }
  71439. return ret, nil
  71440. // {
  71441. // "description": "Sets the labels on the target regional disk.",
  71442. // "httpMethod": "POST",
  71443. // "id": "compute.regionDisks.setLabels",
  71444. // "parameterOrder": [
  71445. // "project",
  71446. // "region",
  71447. // "resource"
  71448. // ],
  71449. // "parameters": {
  71450. // "project": {
  71451. // "description": "Project ID for this request.",
  71452. // "location": "path",
  71453. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71454. // "required": true,
  71455. // "type": "string"
  71456. // },
  71457. // "region": {
  71458. // "description": "The region for this request.",
  71459. // "location": "path",
  71460. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71461. // "required": true,
  71462. // "type": "string"
  71463. // },
  71464. // "requestId": {
  71465. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71466. // "location": "query",
  71467. // "type": "string"
  71468. // },
  71469. // "resource": {
  71470. // "description": "Name or id of the resource for this request.",
  71471. // "location": "path",
  71472. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71473. // "required": true,
  71474. // "type": "string"
  71475. // }
  71476. // },
  71477. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  71478. // "request": {
  71479. // "$ref": "RegionSetLabelsRequest"
  71480. // },
  71481. // "response": {
  71482. // "$ref": "Operation"
  71483. // },
  71484. // "scopes": [
  71485. // "https://www.googleapis.com/auth/cloud-platform",
  71486. // "https://www.googleapis.com/auth/compute"
  71487. // ]
  71488. // }
  71489. }
  71490. // method id "compute.regionDisks.testIamPermissions":
  71491. type RegionDisksTestIamPermissionsCall struct {
  71492. s *Service
  71493. project string
  71494. region string
  71495. resource string
  71496. testpermissionsrequest *TestPermissionsRequest
  71497. urlParams_ gensupport.URLParams
  71498. ctx_ context.Context
  71499. header_ http.Header
  71500. }
  71501. // TestIamPermissions: Returns permissions that a caller has on the
  71502. // specified resource.
  71503. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  71504. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71505. c.project = project
  71506. c.region = region
  71507. c.resource = resource
  71508. c.testpermissionsrequest = testpermissionsrequest
  71509. return c
  71510. }
  71511. // Fields allows partial responses to be retrieved. See
  71512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71513. // for more information.
  71514. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  71515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71516. return c
  71517. }
  71518. // Context sets the context to be used in this call's Do method. Any
  71519. // pending HTTP request will be aborted if the provided context is
  71520. // canceled.
  71521. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  71522. c.ctx_ = ctx
  71523. return c
  71524. }
  71525. // Header returns an http.Header that can be modified by the caller to
  71526. // add HTTP headers to the request.
  71527. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  71528. if c.header_ == nil {
  71529. c.header_ = make(http.Header)
  71530. }
  71531. return c.header_
  71532. }
  71533. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  71534. reqHeaders := make(http.Header)
  71535. for k, v := range c.header_ {
  71536. reqHeaders[k] = v
  71537. }
  71538. reqHeaders.Set("User-Agent", c.s.userAgent())
  71539. var body io.Reader = nil
  71540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  71541. if err != nil {
  71542. return nil, err
  71543. }
  71544. reqHeaders.Set("Content-Type", "application/json")
  71545. c.urlParams_.Set("alt", alt)
  71546. c.urlParams_.Set("prettyPrint", "false")
  71547. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  71548. urls += "?" + c.urlParams_.Encode()
  71549. req, err := http.NewRequest("POST", urls, body)
  71550. if err != nil {
  71551. return nil, err
  71552. }
  71553. req.Header = reqHeaders
  71554. googleapi.Expand(req.URL, map[string]string{
  71555. "project": c.project,
  71556. "region": c.region,
  71557. "resource": c.resource,
  71558. })
  71559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71560. }
  71561. // Do executes the "compute.regionDisks.testIamPermissions" call.
  71562. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  71563. // non-2xx status code is an error. Response headers are in either
  71564. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  71565. // returned at all) in error.(*googleapi.Error).Header. Use
  71566. // googleapi.IsNotModified to check whether the returned error was
  71567. // because http.StatusNotModified was returned.
  71568. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  71569. gensupport.SetOptions(c.urlParams_, opts...)
  71570. res, err := c.doRequest("json")
  71571. if res != nil && res.StatusCode == http.StatusNotModified {
  71572. if res.Body != nil {
  71573. res.Body.Close()
  71574. }
  71575. return nil, &googleapi.Error{
  71576. Code: res.StatusCode,
  71577. Header: res.Header,
  71578. }
  71579. }
  71580. if err != nil {
  71581. return nil, err
  71582. }
  71583. defer googleapi.CloseBody(res)
  71584. if err := googleapi.CheckResponse(res); err != nil {
  71585. return nil, err
  71586. }
  71587. ret := &TestPermissionsResponse{
  71588. ServerResponse: googleapi.ServerResponse{
  71589. Header: res.Header,
  71590. HTTPStatusCode: res.StatusCode,
  71591. },
  71592. }
  71593. target := &ret
  71594. if err := gensupport.DecodeResponse(target, res); err != nil {
  71595. return nil, err
  71596. }
  71597. return ret, nil
  71598. // {
  71599. // "description": "Returns permissions that a caller has on the specified resource.",
  71600. // "httpMethod": "POST",
  71601. // "id": "compute.regionDisks.testIamPermissions",
  71602. // "parameterOrder": [
  71603. // "project",
  71604. // "region",
  71605. // "resource"
  71606. // ],
  71607. // "parameters": {
  71608. // "project": {
  71609. // "description": "Project ID for this request.",
  71610. // "location": "path",
  71611. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71612. // "required": true,
  71613. // "type": "string"
  71614. // },
  71615. // "region": {
  71616. // "description": "The name of the region for this request.",
  71617. // "location": "path",
  71618. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71619. // "required": true,
  71620. // "type": "string"
  71621. // },
  71622. // "resource": {
  71623. // "description": "Name or id of the resource for this request.",
  71624. // "location": "path",
  71625. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71626. // "required": true,
  71627. // "type": "string"
  71628. // }
  71629. // },
  71630. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  71631. // "request": {
  71632. // "$ref": "TestPermissionsRequest"
  71633. // },
  71634. // "response": {
  71635. // "$ref": "TestPermissionsResponse"
  71636. // },
  71637. // "scopes": [
  71638. // "https://www.googleapis.com/auth/cloud-platform",
  71639. // "https://www.googleapis.com/auth/compute",
  71640. // "https://www.googleapis.com/auth/compute.readonly"
  71641. // ]
  71642. // }
  71643. }
  71644. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  71645. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  71646. s *Service
  71647. project string
  71648. region string
  71649. instanceGroupManager string
  71650. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  71651. urlParams_ gensupport.URLParams
  71652. ctx_ context.Context
  71653. header_ http.Header
  71654. }
  71655. // AbandonInstances: Flags the specified instances to be immediately
  71656. // removed from the managed instance group. Abandoning an instance does
  71657. // not delete the instance, but it does remove the instance from any
  71658. // target pools that are applied by the managed instance group. This
  71659. // method reduces the targetSize of the managed instance group by the
  71660. // number of instances that you abandon. This operation is marked as
  71661. // DONE when the action is scheduled even if the instances have not yet
  71662. // been removed from the group. You must separately verify the status of
  71663. // the abandoning action with the listmanagedinstances method.
  71664. //
  71665. // If the group is part of a backend service that has enabled connection
  71666. // draining, it can take up to 60 seconds after the connection draining
  71667. // duration has elapsed before the VM instance is removed or
  71668. // deleted.
  71669. //
  71670. // You can specify a maximum of 1000 instances with this method per
  71671. // request.
  71672. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  71673. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71674. c.project = project
  71675. c.region = region
  71676. c.instanceGroupManager = instanceGroupManager
  71677. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  71678. return c
  71679. }
  71680. // RequestId sets the optional parameter "requestId": An optional
  71681. // request ID to identify requests. Specify a unique request ID so that
  71682. // if you must retry your request, the server will know to ignore the
  71683. // request if it has already been completed.
  71684. //
  71685. // For example, consider a situation where you make an initial request
  71686. // and the request times out. If you make the request again with the
  71687. // same request ID, the server can check if original operation with the
  71688. // same request ID was received, and if so, will ignore the second
  71689. // request. This prevents clients from accidentally creating duplicate
  71690. // commitments.
  71691. //
  71692. // The request ID must be a valid UUID with the exception that zero UUID
  71693. // is not supported (00000000-0000-0000-0000-000000000000).
  71694. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  71695. c.urlParams_.Set("requestId", requestId)
  71696. return c
  71697. }
  71698. // Fields allows partial responses to be retrieved. See
  71699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71700. // for more information.
  71701. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  71702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71703. return c
  71704. }
  71705. // Context sets the context to be used in this call's Do method. Any
  71706. // pending HTTP request will be aborted if the provided context is
  71707. // canceled.
  71708. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  71709. c.ctx_ = ctx
  71710. return c
  71711. }
  71712. // Header returns an http.Header that can be modified by the caller to
  71713. // add HTTP headers to the request.
  71714. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  71715. if c.header_ == nil {
  71716. c.header_ = make(http.Header)
  71717. }
  71718. return c.header_
  71719. }
  71720. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  71721. reqHeaders := make(http.Header)
  71722. for k, v := range c.header_ {
  71723. reqHeaders[k] = v
  71724. }
  71725. reqHeaders.Set("User-Agent", c.s.userAgent())
  71726. var body io.Reader = nil
  71727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  71728. if err != nil {
  71729. return nil, err
  71730. }
  71731. reqHeaders.Set("Content-Type", "application/json")
  71732. c.urlParams_.Set("alt", alt)
  71733. c.urlParams_.Set("prettyPrint", "false")
  71734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  71735. urls += "?" + c.urlParams_.Encode()
  71736. req, err := http.NewRequest("POST", urls, body)
  71737. if err != nil {
  71738. return nil, err
  71739. }
  71740. req.Header = reqHeaders
  71741. googleapi.Expand(req.URL, map[string]string{
  71742. "project": c.project,
  71743. "region": c.region,
  71744. "instanceGroupManager": c.instanceGroupManager,
  71745. })
  71746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71747. }
  71748. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  71749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71750. // status code is an error. Response headers are in either
  71751. // *Operation.ServerResponse.Header or (if a response was returned at
  71752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71753. // to check whether the returned error was because
  71754. // http.StatusNotModified was returned.
  71755. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71756. gensupport.SetOptions(c.urlParams_, opts...)
  71757. res, err := c.doRequest("json")
  71758. if res != nil && res.StatusCode == http.StatusNotModified {
  71759. if res.Body != nil {
  71760. res.Body.Close()
  71761. }
  71762. return nil, &googleapi.Error{
  71763. Code: res.StatusCode,
  71764. Header: res.Header,
  71765. }
  71766. }
  71767. if err != nil {
  71768. return nil, err
  71769. }
  71770. defer googleapi.CloseBody(res)
  71771. if err := googleapi.CheckResponse(res); err != nil {
  71772. return nil, err
  71773. }
  71774. ret := &Operation{
  71775. ServerResponse: googleapi.ServerResponse{
  71776. Header: res.Header,
  71777. HTTPStatusCode: res.StatusCode,
  71778. },
  71779. }
  71780. target := &ret
  71781. if err := gensupport.DecodeResponse(target, res); err != nil {
  71782. return nil, err
  71783. }
  71784. return ret, nil
  71785. // {
  71786. // "description": "Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  71787. // "httpMethod": "POST",
  71788. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  71789. // "parameterOrder": [
  71790. // "project",
  71791. // "region",
  71792. // "instanceGroupManager"
  71793. // ],
  71794. // "parameters": {
  71795. // "instanceGroupManager": {
  71796. // "description": "Name of the managed instance group.",
  71797. // "location": "path",
  71798. // "required": true,
  71799. // "type": "string"
  71800. // },
  71801. // "project": {
  71802. // "description": "Project ID for this request.",
  71803. // "location": "path",
  71804. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71805. // "required": true,
  71806. // "type": "string"
  71807. // },
  71808. // "region": {
  71809. // "description": "Name of the region scoping this request.",
  71810. // "location": "path",
  71811. // "required": true,
  71812. // "type": "string"
  71813. // },
  71814. // "requestId": {
  71815. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71816. // "location": "query",
  71817. // "type": "string"
  71818. // }
  71819. // },
  71820. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  71821. // "request": {
  71822. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  71823. // },
  71824. // "response": {
  71825. // "$ref": "Operation"
  71826. // },
  71827. // "scopes": [
  71828. // "https://www.googleapis.com/auth/cloud-platform",
  71829. // "https://www.googleapis.com/auth/compute"
  71830. // ]
  71831. // }
  71832. }
  71833. // method id "compute.regionInstanceGroupManagers.delete":
  71834. type RegionInstanceGroupManagersDeleteCall struct {
  71835. s *Service
  71836. project string
  71837. region string
  71838. instanceGroupManager string
  71839. urlParams_ gensupport.URLParams
  71840. ctx_ context.Context
  71841. header_ http.Header
  71842. }
  71843. // Delete: Deletes the specified managed instance group and all of the
  71844. // instances in that group.
  71845. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  71846. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71847. c.project = project
  71848. c.region = region
  71849. c.instanceGroupManager = instanceGroupManager
  71850. return c
  71851. }
  71852. // RequestId sets the optional parameter "requestId": An optional
  71853. // request ID to identify requests. Specify a unique request ID so that
  71854. // if you must retry your request, the server will know to ignore the
  71855. // request if it has already been completed.
  71856. //
  71857. // For example, consider a situation where you make an initial request
  71858. // and the request times out. If you make the request again with the
  71859. // same request ID, the server can check if original operation with the
  71860. // same request ID was received, and if so, will ignore the second
  71861. // request. This prevents clients from accidentally creating duplicate
  71862. // commitments.
  71863. //
  71864. // The request ID must be a valid UUID with the exception that zero UUID
  71865. // is not supported (00000000-0000-0000-0000-000000000000).
  71866. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  71867. c.urlParams_.Set("requestId", requestId)
  71868. return c
  71869. }
  71870. // Fields allows partial responses to be retrieved. See
  71871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71872. // for more information.
  71873. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  71874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71875. return c
  71876. }
  71877. // Context sets the context to be used in this call's Do method. Any
  71878. // pending HTTP request will be aborted if the provided context is
  71879. // canceled.
  71880. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  71881. c.ctx_ = ctx
  71882. return c
  71883. }
  71884. // Header returns an http.Header that can be modified by the caller to
  71885. // add HTTP headers to the request.
  71886. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  71887. if c.header_ == nil {
  71888. c.header_ = make(http.Header)
  71889. }
  71890. return c.header_
  71891. }
  71892. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  71893. reqHeaders := make(http.Header)
  71894. for k, v := range c.header_ {
  71895. reqHeaders[k] = v
  71896. }
  71897. reqHeaders.Set("User-Agent", c.s.userAgent())
  71898. var body io.Reader = nil
  71899. c.urlParams_.Set("alt", alt)
  71900. c.urlParams_.Set("prettyPrint", "false")
  71901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  71902. urls += "?" + c.urlParams_.Encode()
  71903. req, err := http.NewRequest("DELETE", urls, body)
  71904. if err != nil {
  71905. return nil, err
  71906. }
  71907. req.Header = reqHeaders
  71908. googleapi.Expand(req.URL, map[string]string{
  71909. "project": c.project,
  71910. "region": c.region,
  71911. "instanceGroupManager": c.instanceGroupManager,
  71912. })
  71913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71914. }
  71915. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  71916. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71917. // status code is an error. Response headers are in either
  71918. // *Operation.ServerResponse.Header or (if a response was returned at
  71919. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71920. // to check whether the returned error was because
  71921. // http.StatusNotModified was returned.
  71922. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71923. gensupport.SetOptions(c.urlParams_, opts...)
  71924. res, err := c.doRequest("json")
  71925. if res != nil && res.StatusCode == http.StatusNotModified {
  71926. if res.Body != nil {
  71927. res.Body.Close()
  71928. }
  71929. return nil, &googleapi.Error{
  71930. Code: res.StatusCode,
  71931. Header: res.Header,
  71932. }
  71933. }
  71934. if err != nil {
  71935. return nil, err
  71936. }
  71937. defer googleapi.CloseBody(res)
  71938. if err := googleapi.CheckResponse(res); err != nil {
  71939. return nil, err
  71940. }
  71941. ret := &Operation{
  71942. ServerResponse: googleapi.ServerResponse{
  71943. Header: res.Header,
  71944. HTTPStatusCode: res.StatusCode,
  71945. },
  71946. }
  71947. target := &ret
  71948. if err := gensupport.DecodeResponse(target, res); err != nil {
  71949. return nil, err
  71950. }
  71951. return ret, nil
  71952. // {
  71953. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  71954. // "httpMethod": "DELETE",
  71955. // "id": "compute.regionInstanceGroupManagers.delete",
  71956. // "parameterOrder": [
  71957. // "project",
  71958. // "region",
  71959. // "instanceGroupManager"
  71960. // ],
  71961. // "parameters": {
  71962. // "instanceGroupManager": {
  71963. // "description": "Name of the managed instance group to delete.",
  71964. // "location": "path",
  71965. // "required": true,
  71966. // "type": "string"
  71967. // },
  71968. // "project": {
  71969. // "description": "Project ID for this request.",
  71970. // "location": "path",
  71971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71972. // "required": true,
  71973. // "type": "string"
  71974. // },
  71975. // "region": {
  71976. // "description": "Name of the region scoping this request.",
  71977. // "location": "path",
  71978. // "required": true,
  71979. // "type": "string"
  71980. // },
  71981. // "requestId": {
  71982. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71983. // "location": "query",
  71984. // "type": "string"
  71985. // }
  71986. // },
  71987. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  71988. // "response": {
  71989. // "$ref": "Operation"
  71990. // },
  71991. // "scopes": [
  71992. // "https://www.googleapis.com/auth/cloud-platform",
  71993. // "https://www.googleapis.com/auth/compute"
  71994. // ]
  71995. // }
  71996. }
  71997. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  71998. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  71999. s *Service
  72000. project string
  72001. region string
  72002. instanceGroupManager string
  72003. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  72004. urlParams_ gensupport.URLParams
  72005. ctx_ context.Context
  72006. header_ http.Header
  72007. }
  72008. // DeleteInstances: Flags the specified instances in the managed
  72009. // instance group to be immediately deleted. The instances are also
  72010. // removed from any target pools of which they were a member. This
  72011. // method reduces the targetSize of the managed instance group by the
  72012. // number of instances that you delete. The deleteInstances operation is
  72013. // marked DONE if the deleteInstances request is successful. The
  72014. // underlying actions take additional time. You must separately verify
  72015. // the status of the deleting action with the listmanagedinstances
  72016. // method.
  72017. //
  72018. // If the group is part of a backend service that has enabled connection
  72019. // draining, it can take up to 60 seconds after the connection draining
  72020. // duration has elapsed before the VM instance is removed or
  72021. // deleted.
  72022. //
  72023. // You can specify a maximum of 1000 instances with this method per
  72024. // request.
  72025. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  72026. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72027. c.project = project
  72028. c.region = region
  72029. c.instanceGroupManager = instanceGroupManager
  72030. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  72031. return c
  72032. }
  72033. // RequestId sets the optional parameter "requestId": An optional
  72034. // request ID to identify requests. Specify a unique request ID so that
  72035. // if you must retry your request, the server will know to ignore the
  72036. // request if it has already been completed.
  72037. //
  72038. // For example, consider a situation where you make an initial request
  72039. // and the request times out. If you make the request again with the
  72040. // same request ID, the server can check if original operation with the
  72041. // same request ID was received, and if so, will ignore the second
  72042. // request. This prevents clients from accidentally creating duplicate
  72043. // commitments.
  72044. //
  72045. // The request ID must be a valid UUID with the exception that zero UUID
  72046. // is not supported (00000000-0000-0000-0000-000000000000).
  72047. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  72048. c.urlParams_.Set("requestId", requestId)
  72049. return c
  72050. }
  72051. // Fields allows partial responses to be retrieved. See
  72052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72053. // for more information.
  72054. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  72055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72056. return c
  72057. }
  72058. // Context sets the context to be used in this call's Do method. Any
  72059. // pending HTTP request will be aborted if the provided context is
  72060. // canceled.
  72061. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  72062. c.ctx_ = ctx
  72063. return c
  72064. }
  72065. // Header returns an http.Header that can be modified by the caller to
  72066. // add HTTP headers to the request.
  72067. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  72068. if c.header_ == nil {
  72069. c.header_ = make(http.Header)
  72070. }
  72071. return c.header_
  72072. }
  72073. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  72074. reqHeaders := make(http.Header)
  72075. for k, v := range c.header_ {
  72076. reqHeaders[k] = v
  72077. }
  72078. reqHeaders.Set("User-Agent", c.s.userAgent())
  72079. var body io.Reader = nil
  72080. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  72081. if err != nil {
  72082. return nil, err
  72083. }
  72084. reqHeaders.Set("Content-Type", "application/json")
  72085. c.urlParams_.Set("alt", alt)
  72086. c.urlParams_.Set("prettyPrint", "false")
  72087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  72088. urls += "?" + c.urlParams_.Encode()
  72089. req, err := http.NewRequest("POST", urls, body)
  72090. if err != nil {
  72091. return nil, err
  72092. }
  72093. req.Header = reqHeaders
  72094. googleapi.Expand(req.URL, map[string]string{
  72095. "project": c.project,
  72096. "region": c.region,
  72097. "instanceGroupManager": c.instanceGroupManager,
  72098. })
  72099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72100. }
  72101. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  72102. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72103. // status code is an error. Response headers are in either
  72104. // *Operation.ServerResponse.Header or (if a response was returned at
  72105. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72106. // to check whether the returned error was because
  72107. // http.StatusNotModified was returned.
  72108. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72109. gensupport.SetOptions(c.urlParams_, opts...)
  72110. res, err := c.doRequest("json")
  72111. if res != nil && res.StatusCode == http.StatusNotModified {
  72112. if res.Body != nil {
  72113. res.Body.Close()
  72114. }
  72115. return nil, &googleapi.Error{
  72116. Code: res.StatusCode,
  72117. Header: res.Header,
  72118. }
  72119. }
  72120. if err != nil {
  72121. return nil, err
  72122. }
  72123. defer googleapi.CloseBody(res)
  72124. if err := googleapi.CheckResponse(res); err != nil {
  72125. return nil, err
  72126. }
  72127. ret := &Operation{
  72128. ServerResponse: googleapi.ServerResponse{
  72129. Header: res.Header,
  72130. HTTPStatusCode: res.StatusCode,
  72131. },
  72132. }
  72133. target := &ret
  72134. if err := gensupport.DecodeResponse(target, res); err != nil {
  72135. return nil, err
  72136. }
  72137. return ret, nil
  72138. // {
  72139. // "description": "Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  72140. // "httpMethod": "POST",
  72141. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  72142. // "parameterOrder": [
  72143. // "project",
  72144. // "region",
  72145. // "instanceGroupManager"
  72146. // ],
  72147. // "parameters": {
  72148. // "instanceGroupManager": {
  72149. // "description": "Name of the managed instance group.",
  72150. // "location": "path",
  72151. // "required": true,
  72152. // "type": "string"
  72153. // },
  72154. // "project": {
  72155. // "description": "Project ID for this request.",
  72156. // "location": "path",
  72157. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72158. // "required": true,
  72159. // "type": "string"
  72160. // },
  72161. // "region": {
  72162. // "description": "Name of the region scoping this request.",
  72163. // "location": "path",
  72164. // "required": true,
  72165. // "type": "string"
  72166. // },
  72167. // "requestId": {
  72168. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72169. // "location": "query",
  72170. // "type": "string"
  72171. // }
  72172. // },
  72173. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  72174. // "request": {
  72175. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  72176. // },
  72177. // "response": {
  72178. // "$ref": "Operation"
  72179. // },
  72180. // "scopes": [
  72181. // "https://www.googleapis.com/auth/cloud-platform",
  72182. // "https://www.googleapis.com/auth/compute"
  72183. // ]
  72184. // }
  72185. }
  72186. // method id "compute.regionInstanceGroupManagers.get":
  72187. type RegionInstanceGroupManagersGetCall struct {
  72188. s *Service
  72189. project string
  72190. region string
  72191. instanceGroupManager string
  72192. urlParams_ gensupport.URLParams
  72193. ifNoneMatch_ string
  72194. ctx_ context.Context
  72195. header_ http.Header
  72196. }
  72197. // Get: Returns all of the details about the specified managed instance
  72198. // group.
  72199. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  72200. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72201. c.project = project
  72202. c.region = region
  72203. c.instanceGroupManager = instanceGroupManager
  72204. return c
  72205. }
  72206. // Fields allows partial responses to be retrieved. See
  72207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72208. // for more information.
  72209. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  72210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72211. return c
  72212. }
  72213. // IfNoneMatch sets the optional parameter which makes the operation
  72214. // fail if the object's ETag matches the given value. This is useful for
  72215. // getting updates only after the object has changed since the last
  72216. // request. Use googleapi.IsNotModified to check whether the response
  72217. // error from Do is the result of In-None-Match.
  72218. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  72219. c.ifNoneMatch_ = entityTag
  72220. return c
  72221. }
  72222. // Context sets the context to be used in this call's Do method. Any
  72223. // pending HTTP request will be aborted if the provided context is
  72224. // canceled.
  72225. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  72226. c.ctx_ = ctx
  72227. return c
  72228. }
  72229. // Header returns an http.Header that can be modified by the caller to
  72230. // add HTTP headers to the request.
  72231. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  72232. if c.header_ == nil {
  72233. c.header_ = make(http.Header)
  72234. }
  72235. return c.header_
  72236. }
  72237. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  72238. reqHeaders := make(http.Header)
  72239. for k, v := range c.header_ {
  72240. reqHeaders[k] = v
  72241. }
  72242. reqHeaders.Set("User-Agent", c.s.userAgent())
  72243. if c.ifNoneMatch_ != "" {
  72244. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72245. }
  72246. var body io.Reader = nil
  72247. c.urlParams_.Set("alt", alt)
  72248. c.urlParams_.Set("prettyPrint", "false")
  72249. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  72250. urls += "?" + c.urlParams_.Encode()
  72251. req, err := http.NewRequest("GET", urls, body)
  72252. if err != nil {
  72253. return nil, err
  72254. }
  72255. req.Header = reqHeaders
  72256. googleapi.Expand(req.URL, map[string]string{
  72257. "project": c.project,
  72258. "region": c.region,
  72259. "instanceGroupManager": c.instanceGroupManager,
  72260. })
  72261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72262. }
  72263. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  72264. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  72265. // non-2xx status code is an error. Response headers are in either
  72266. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  72267. // returned at all) in error.(*googleapi.Error).Header. Use
  72268. // googleapi.IsNotModified to check whether the returned error was
  72269. // because http.StatusNotModified was returned.
  72270. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  72271. gensupport.SetOptions(c.urlParams_, opts...)
  72272. res, err := c.doRequest("json")
  72273. if res != nil && res.StatusCode == http.StatusNotModified {
  72274. if res.Body != nil {
  72275. res.Body.Close()
  72276. }
  72277. return nil, &googleapi.Error{
  72278. Code: res.StatusCode,
  72279. Header: res.Header,
  72280. }
  72281. }
  72282. if err != nil {
  72283. return nil, err
  72284. }
  72285. defer googleapi.CloseBody(res)
  72286. if err := googleapi.CheckResponse(res); err != nil {
  72287. return nil, err
  72288. }
  72289. ret := &InstanceGroupManager{
  72290. ServerResponse: googleapi.ServerResponse{
  72291. Header: res.Header,
  72292. HTTPStatusCode: res.StatusCode,
  72293. },
  72294. }
  72295. target := &ret
  72296. if err := gensupport.DecodeResponse(target, res); err != nil {
  72297. return nil, err
  72298. }
  72299. return ret, nil
  72300. // {
  72301. // "description": "Returns all of the details about the specified managed instance group.",
  72302. // "httpMethod": "GET",
  72303. // "id": "compute.regionInstanceGroupManagers.get",
  72304. // "parameterOrder": [
  72305. // "project",
  72306. // "region",
  72307. // "instanceGroupManager"
  72308. // ],
  72309. // "parameters": {
  72310. // "instanceGroupManager": {
  72311. // "description": "Name of the managed instance group to return.",
  72312. // "location": "path",
  72313. // "required": true,
  72314. // "type": "string"
  72315. // },
  72316. // "project": {
  72317. // "description": "Project ID for this request.",
  72318. // "location": "path",
  72319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72320. // "required": true,
  72321. // "type": "string"
  72322. // },
  72323. // "region": {
  72324. // "description": "Name of the region scoping this request.",
  72325. // "location": "path",
  72326. // "required": true,
  72327. // "type": "string"
  72328. // }
  72329. // },
  72330. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  72331. // "response": {
  72332. // "$ref": "InstanceGroupManager"
  72333. // },
  72334. // "scopes": [
  72335. // "https://www.googleapis.com/auth/cloud-platform",
  72336. // "https://www.googleapis.com/auth/compute",
  72337. // "https://www.googleapis.com/auth/compute.readonly"
  72338. // ]
  72339. // }
  72340. }
  72341. // method id "compute.regionInstanceGroupManagers.insert":
  72342. type RegionInstanceGroupManagersInsertCall struct {
  72343. s *Service
  72344. project string
  72345. region string
  72346. instancegroupmanager *InstanceGroupManager
  72347. urlParams_ gensupport.URLParams
  72348. ctx_ context.Context
  72349. header_ http.Header
  72350. }
  72351. // Insert: Creates a managed instance group using the information that
  72352. // you specify in the request. After the group is created, instances in
  72353. // the group are created using the specified instance template. This
  72354. // operation is marked as DONE when the group is created even if the
  72355. // instances in the group have not yet been created. You must separately
  72356. // verify the status of the individual instances with the
  72357. // listmanagedinstances method.
  72358. //
  72359. // A regional managed instance group can contain up to 2000 instances.
  72360. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  72361. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72362. c.project = project
  72363. c.region = region
  72364. c.instancegroupmanager = instancegroupmanager
  72365. return c
  72366. }
  72367. // RequestId sets the optional parameter "requestId": An optional
  72368. // request ID to identify requests. Specify a unique request ID so that
  72369. // if you must retry your request, the server will know to ignore the
  72370. // request if it has already been completed.
  72371. //
  72372. // For example, consider a situation where you make an initial request
  72373. // and the request times out. If you make the request again with the
  72374. // same request ID, the server can check if original operation with the
  72375. // same request ID was received, and if so, will ignore the second
  72376. // request. This prevents clients from accidentally creating duplicate
  72377. // commitments.
  72378. //
  72379. // The request ID must be a valid UUID with the exception that zero UUID
  72380. // is not supported (00000000-0000-0000-0000-000000000000).
  72381. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  72382. c.urlParams_.Set("requestId", requestId)
  72383. return c
  72384. }
  72385. // Fields allows partial responses to be retrieved. See
  72386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72387. // for more information.
  72388. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  72389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72390. return c
  72391. }
  72392. // Context sets the context to be used in this call's Do method. Any
  72393. // pending HTTP request will be aborted if the provided context is
  72394. // canceled.
  72395. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  72396. c.ctx_ = ctx
  72397. return c
  72398. }
  72399. // Header returns an http.Header that can be modified by the caller to
  72400. // add HTTP headers to the request.
  72401. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  72402. if c.header_ == nil {
  72403. c.header_ = make(http.Header)
  72404. }
  72405. return c.header_
  72406. }
  72407. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  72408. reqHeaders := make(http.Header)
  72409. for k, v := range c.header_ {
  72410. reqHeaders[k] = v
  72411. }
  72412. reqHeaders.Set("User-Agent", c.s.userAgent())
  72413. var body io.Reader = nil
  72414. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  72415. if err != nil {
  72416. return nil, err
  72417. }
  72418. reqHeaders.Set("Content-Type", "application/json")
  72419. c.urlParams_.Set("alt", alt)
  72420. c.urlParams_.Set("prettyPrint", "false")
  72421. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  72422. urls += "?" + c.urlParams_.Encode()
  72423. req, err := http.NewRequest("POST", urls, body)
  72424. if err != nil {
  72425. return nil, err
  72426. }
  72427. req.Header = reqHeaders
  72428. googleapi.Expand(req.URL, map[string]string{
  72429. "project": c.project,
  72430. "region": c.region,
  72431. })
  72432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72433. }
  72434. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  72435. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72436. // status code is an error. Response headers are in either
  72437. // *Operation.ServerResponse.Header or (if a response was returned at
  72438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72439. // to check whether the returned error was because
  72440. // http.StatusNotModified was returned.
  72441. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72442. gensupport.SetOptions(c.urlParams_, opts...)
  72443. res, err := c.doRequest("json")
  72444. if res != nil && res.StatusCode == http.StatusNotModified {
  72445. if res.Body != nil {
  72446. res.Body.Close()
  72447. }
  72448. return nil, &googleapi.Error{
  72449. Code: res.StatusCode,
  72450. Header: res.Header,
  72451. }
  72452. }
  72453. if err != nil {
  72454. return nil, err
  72455. }
  72456. defer googleapi.CloseBody(res)
  72457. if err := googleapi.CheckResponse(res); err != nil {
  72458. return nil, err
  72459. }
  72460. ret := &Operation{
  72461. ServerResponse: googleapi.ServerResponse{
  72462. Header: res.Header,
  72463. HTTPStatusCode: res.StatusCode,
  72464. },
  72465. }
  72466. target := &ret
  72467. if err := gensupport.DecodeResponse(target, res); err != nil {
  72468. return nil, err
  72469. }
  72470. return ret, nil
  72471. // {
  72472. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA regional managed instance group can contain up to 2000 instances.",
  72473. // "httpMethod": "POST",
  72474. // "id": "compute.regionInstanceGroupManagers.insert",
  72475. // "parameterOrder": [
  72476. // "project",
  72477. // "region"
  72478. // ],
  72479. // "parameters": {
  72480. // "project": {
  72481. // "description": "Project ID for this request.",
  72482. // "location": "path",
  72483. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72484. // "required": true,
  72485. // "type": "string"
  72486. // },
  72487. // "region": {
  72488. // "description": "Name of the region scoping this request.",
  72489. // "location": "path",
  72490. // "required": true,
  72491. // "type": "string"
  72492. // },
  72493. // "requestId": {
  72494. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72495. // "location": "query",
  72496. // "type": "string"
  72497. // }
  72498. // },
  72499. // "path": "{project}/regions/{region}/instanceGroupManagers",
  72500. // "request": {
  72501. // "$ref": "InstanceGroupManager"
  72502. // },
  72503. // "response": {
  72504. // "$ref": "Operation"
  72505. // },
  72506. // "scopes": [
  72507. // "https://www.googleapis.com/auth/cloud-platform",
  72508. // "https://www.googleapis.com/auth/compute"
  72509. // ]
  72510. // }
  72511. }
  72512. // method id "compute.regionInstanceGroupManagers.list":
  72513. type RegionInstanceGroupManagersListCall struct {
  72514. s *Service
  72515. project string
  72516. region string
  72517. urlParams_ gensupport.URLParams
  72518. ifNoneMatch_ string
  72519. ctx_ context.Context
  72520. header_ http.Header
  72521. }
  72522. // List: Retrieves the list of managed instance groups that are
  72523. // contained within the specified region.
  72524. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  72525. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72526. c.project = project
  72527. c.region = region
  72528. return c
  72529. }
  72530. // Filter sets the optional parameter "filter": A filter expression that
  72531. // filters resources listed in the response. The expression must specify
  72532. // the field name, a comparison operator, and the value that you want to
  72533. // use for filtering. The value must be a string, a number, or a
  72534. // boolean. The comparison operator must be either =, !=, >, or <.
  72535. //
  72536. // For example, if you are filtering Compute Engine instances, you can
  72537. // exclude instances named example-instance by specifying name !=
  72538. // example-instance.
  72539. //
  72540. // You can also filter nested fields. For example, you could specify
  72541. // scheduling.automaticRestart = false to include instances only if they
  72542. // are not scheduled for automatic restarts. You can use filtering on
  72543. // nested fields to filter based on resource labels.
  72544. //
  72545. // To filter on multiple expressions, provide each separate expression
  72546. // within parentheses. For example, (scheduling.automaticRestart = true)
  72547. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72548. // AND expression. However, you can include AND and OR expressions
  72549. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72550. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72551. // true).
  72552. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  72553. c.urlParams_.Set("filter", filter)
  72554. return c
  72555. }
  72556. // MaxResults sets the optional parameter "maxResults": The maximum
  72557. // number of results per page that should be returned. If the number of
  72558. // available results is larger than maxResults, Compute Engine returns a
  72559. // nextPageToken that can be used to get the next page of results in
  72560. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72561. // (Default: 500)
  72562. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  72563. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72564. return c
  72565. }
  72566. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72567. // a certain order. By default, results are returned in alphanumerical
  72568. // order based on the resource name.
  72569. //
  72570. // You can also sort results in descending order based on the creation
  72571. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72572. // based on the creationTimestamp field in reverse chronological order
  72573. // (newest result first). Use this to sort resources like operations so
  72574. // that the newest operation is returned first.
  72575. //
  72576. // Currently, only sorting by name or creationTimestamp desc is
  72577. // supported.
  72578. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  72579. c.urlParams_.Set("orderBy", orderBy)
  72580. return c
  72581. }
  72582. // PageToken sets the optional parameter "pageToken": Specifies a page
  72583. // token to use. Set pageToken to the nextPageToken returned by a
  72584. // previous list request to get the next page of results.
  72585. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  72586. c.urlParams_.Set("pageToken", pageToken)
  72587. return c
  72588. }
  72589. // Fields allows partial responses to be retrieved. See
  72590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72591. // for more information.
  72592. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  72593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72594. return c
  72595. }
  72596. // IfNoneMatch sets the optional parameter which makes the operation
  72597. // fail if the object's ETag matches the given value. This is useful for
  72598. // getting updates only after the object has changed since the last
  72599. // request. Use googleapi.IsNotModified to check whether the response
  72600. // error from Do is the result of In-None-Match.
  72601. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  72602. c.ifNoneMatch_ = entityTag
  72603. return c
  72604. }
  72605. // Context sets the context to be used in this call's Do method. Any
  72606. // pending HTTP request will be aborted if the provided context is
  72607. // canceled.
  72608. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  72609. c.ctx_ = ctx
  72610. return c
  72611. }
  72612. // Header returns an http.Header that can be modified by the caller to
  72613. // add HTTP headers to the request.
  72614. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  72615. if c.header_ == nil {
  72616. c.header_ = make(http.Header)
  72617. }
  72618. return c.header_
  72619. }
  72620. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  72621. reqHeaders := make(http.Header)
  72622. for k, v := range c.header_ {
  72623. reqHeaders[k] = v
  72624. }
  72625. reqHeaders.Set("User-Agent", c.s.userAgent())
  72626. if c.ifNoneMatch_ != "" {
  72627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72628. }
  72629. var body io.Reader = nil
  72630. c.urlParams_.Set("alt", alt)
  72631. c.urlParams_.Set("prettyPrint", "false")
  72632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  72633. urls += "?" + c.urlParams_.Encode()
  72634. req, err := http.NewRequest("GET", urls, body)
  72635. if err != nil {
  72636. return nil, err
  72637. }
  72638. req.Header = reqHeaders
  72639. googleapi.Expand(req.URL, map[string]string{
  72640. "project": c.project,
  72641. "region": c.region,
  72642. })
  72643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72644. }
  72645. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  72646. // Exactly one of *RegionInstanceGroupManagerList or error will be
  72647. // non-nil. Any non-2xx status code is an error. Response headers are in
  72648. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  72649. // response was returned at all) in error.(*googleapi.Error).Header. Use
  72650. // googleapi.IsNotModified to check whether the returned error was
  72651. // because http.StatusNotModified was returned.
  72652. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  72653. gensupport.SetOptions(c.urlParams_, opts...)
  72654. res, err := c.doRequest("json")
  72655. if res != nil && res.StatusCode == http.StatusNotModified {
  72656. if res.Body != nil {
  72657. res.Body.Close()
  72658. }
  72659. return nil, &googleapi.Error{
  72660. Code: res.StatusCode,
  72661. Header: res.Header,
  72662. }
  72663. }
  72664. if err != nil {
  72665. return nil, err
  72666. }
  72667. defer googleapi.CloseBody(res)
  72668. if err := googleapi.CheckResponse(res); err != nil {
  72669. return nil, err
  72670. }
  72671. ret := &RegionInstanceGroupManagerList{
  72672. ServerResponse: googleapi.ServerResponse{
  72673. Header: res.Header,
  72674. HTTPStatusCode: res.StatusCode,
  72675. },
  72676. }
  72677. target := &ret
  72678. if err := gensupport.DecodeResponse(target, res); err != nil {
  72679. return nil, err
  72680. }
  72681. return ret, nil
  72682. // {
  72683. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  72684. // "httpMethod": "GET",
  72685. // "id": "compute.regionInstanceGroupManagers.list",
  72686. // "parameterOrder": [
  72687. // "project",
  72688. // "region"
  72689. // ],
  72690. // "parameters": {
  72691. // "filter": {
  72692. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72693. // "location": "query",
  72694. // "type": "string"
  72695. // },
  72696. // "maxResults": {
  72697. // "default": "500",
  72698. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72699. // "format": "uint32",
  72700. // "location": "query",
  72701. // "minimum": "0",
  72702. // "type": "integer"
  72703. // },
  72704. // "orderBy": {
  72705. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72706. // "location": "query",
  72707. // "type": "string"
  72708. // },
  72709. // "pageToken": {
  72710. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72711. // "location": "query",
  72712. // "type": "string"
  72713. // },
  72714. // "project": {
  72715. // "description": "Project ID for this request.",
  72716. // "location": "path",
  72717. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72718. // "required": true,
  72719. // "type": "string"
  72720. // },
  72721. // "region": {
  72722. // "description": "Name of the region scoping this request.",
  72723. // "location": "path",
  72724. // "required": true,
  72725. // "type": "string"
  72726. // }
  72727. // },
  72728. // "path": "{project}/regions/{region}/instanceGroupManagers",
  72729. // "response": {
  72730. // "$ref": "RegionInstanceGroupManagerList"
  72731. // },
  72732. // "scopes": [
  72733. // "https://www.googleapis.com/auth/cloud-platform",
  72734. // "https://www.googleapis.com/auth/compute",
  72735. // "https://www.googleapis.com/auth/compute.readonly"
  72736. // ]
  72737. // }
  72738. }
  72739. // Pages invokes f for each page of results.
  72740. // A non-nil error returned from f will halt the iteration.
  72741. // The provided context supersedes any context provided to the Context method.
  72742. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  72743. c.ctx_ = ctx
  72744. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72745. for {
  72746. x, err := c.Do()
  72747. if err != nil {
  72748. return err
  72749. }
  72750. if err := f(x); err != nil {
  72751. return err
  72752. }
  72753. if x.NextPageToken == "" {
  72754. return nil
  72755. }
  72756. c.PageToken(x.NextPageToken)
  72757. }
  72758. }
  72759. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  72760. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  72761. s *Service
  72762. project string
  72763. region string
  72764. instanceGroupManager string
  72765. urlParams_ gensupport.URLParams
  72766. ctx_ context.Context
  72767. header_ http.Header
  72768. }
  72769. // ListManagedInstances: Lists the instances in the managed instance
  72770. // group and instances that are scheduled to be created. The list
  72771. // includes any current actions that the group has scheduled for its
  72772. // instances.
  72773. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  72774. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72775. c.project = project
  72776. c.region = region
  72777. c.instanceGroupManager = instanceGroupManager
  72778. return c
  72779. }
  72780. // Filter sets the optional parameter "filter": A filter expression that
  72781. // filters resources listed in the response. The expression must specify
  72782. // the field name, a comparison operator, and the value that you want to
  72783. // use for filtering. The value must be a string, a number, or a
  72784. // boolean. The comparison operator must be either =, !=, >, or <.
  72785. //
  72786. // For example, if you are filtering Compute Engine instances, you can
  72787. // exclude instances named example-instance by specifying name !=
  72788. // example-instance.
  72789. //
  72790. // You can also filter nested fields. For example, you could specify
  72791. // scheduling.automaticRestart = false to include instances only if they
  72792. // are not scheduled for automatic restarts. You can use filtering on
  72793. // nested fields to filter based on resource labels.
  72794. //
  72795. // To filter on multiple expressions, provide each separate expression
  72796. // within parentheses. For example, (scheduling.automaticRestart = true)
  72797. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72798. // AND expression. However, you can include AND and OR expressions
  72799. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72800. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72801. // true).
  72802. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  72803. c.urlParams_.Set("filter", filter)
  72804. return c
  72805. }
  72806. // MaxResults sets the optional parameter "maxResults": The maximum
  72807. // number of results per page that should be returned. If the number of
  72808. // available results is larger than maxResults, Compute Engine returns a
  72809. // nextPageToken that can be used to get the next page of results in
  72810. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72811. // (Default: 500)
  72812. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  72813. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72814. return c
  72815. }
  72816. // OrderBy sets the optional parameter "order_by": Sorts list results by
  72817. // a certain order. By default, results are returned in alphanumerical
  72818. // order based on the resource name.
  72819. //
  72820. // You can also sort results in descending order based on the creation
  72821. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72822. // based on the creationTimestamp field in reverse chronological order
  72823. // (newest result first). Use this to sort resources like operations so
  72824. // that the newest operation is returned first.
  72825. //
  72826. // Currently, only sorting by name or creationTimestamp desc is
  72827. // supported.
  72828. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  72829. c.urlParams_.Set("order_by", orderBy)
  72830. return c
  72831. }
  72832. // PageToken sets the optional parameter "pageToken": Specifies a page
  72833. // token to use. Set pageToken to the nextPageToken returned by a
  72834. // previous list request to get the next page of results.
  72835. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  72836. c.urlParams_.Set("pageToken", pageToken)
  72837. return c
  72838. }
  72839. // Fields allows partial responses to be retrieved. See
  72840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72841. // for more information.
  72842. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  72843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72844. return c
  72845. }
  72846. // Context sets the context to be used in this call's Do method. Any
  72847. // pending HTTP request will be aborted if the provided context is
  72848. // canceled.
  72849. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  72850. c.ctx_ = ctx
  72851. return c
  72852. }
  72853. // Header returns an http.Header that can be modified by the caller to
  72854. // add HTTP headers to the request.
  72855. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  72856. if c.header_ == nil {
  72857. c.header_ = make(http.Header)
  72858. }
  72859. return c.header_
  72860. }
  72861. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  72862. reqHeaders := make(http.Header)
  72863. for k, v := range c.header_ {
  72864. reqHeaders[k] = v
  72865. }
  72866. reqHeaders.Set("User-Agent", c.s.userAgent())
  72867. var body io.Reader = nil
  72868. c.urlParams_.Set("alt", alt)
  72869. c.urlParams_.Set("prettyPrint", "false")
  72870. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  72871. urls += "?" + c.urlParams_.Encode()
  72872. req, err := http.NewRequest("POST", urls, body)
  72873. if err != nil {
  72874. return nil, err
  72875. }
  72876. req.Header = reqHeaders
  72877. googleapi.Expand(req.URL, map[string]string{
  72878. "project": c.project,
  72879. "region": c.region,
  72880. "instanceGroupManager": c.instanceGroupManager,
  72881. })
  72882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72883. }
  72884. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  72885. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  72886. // error will be non-nil. Any non-2xx status code is an error. Response
  72887. // headers are in either
  72888. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  72889. // r or (if a response was returned at all) in
  72890. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  72891. // whether the returned error was because http.StatusNotModified was
  72892. // returned.
  72893. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  72894. gensupport.SetOptions(c.urlParams_, opts...)
  72895. res, err := c.doRequest("json")
  72896. if res != nil && res.StatusCode == http.StatusNotModified {
  72897. if res.Body != nil {
  72898. res.Body.Close()
  72899. }
  72900. return nil, &googleapi.Error{
  72901. Code: res.StatusCode,
  72902. Header: res.Header,
  72903. }
  72904. }
  72905. if err != nil {
  72906. return nil, err
  72907. }
  72908. defer googleapi.CloseBody(res)
  72909. if err := googleapi.CheckResponse(res); err != nil {
  72910. return nil, err
  72911. }
  72912. ret := &RegionInstanceGroupManagersListInstancesResponse{
  72913. ServerResponse: googleapi.ServerResponse{
  72914. Header: res.Header,
  72915. HTTPStatusCode: res.StatusCode,
  72916. },
  72917. }
  72918. target := &ret
  72919. if err := gensupport.DecodeResponse(target, res); err != nil {
  72920. return nil, err
  72921. }
  72922. return ret, nil
  72923. // {
  72924. // "description": "Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances.",
  72925. // "httpMethod": "POST",
  72926. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  72927. // "parameterOrder": [
  72928. // "project",
  72929. // "region",
  72930. // "instanceGroupManager"
  72931. // ],
  72932. // "parameters": {
  72933. // "filter": {
  72934. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72935. // "location": "query",
  72936. // "type": "string"
  72937. // },
  72938. // "instanceGroupManager": {
  72939. // "description": "The name of the managed instance group.",
  72940. // "location": "path",
  72941. // "required": true,
  72942. // "type": "string"
  72943. // },
  72944. // "maxResults": {
  72945. // "default": "500",
  72946. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72947. // "format": "uint32",
  72948. // "location": "query",
  72949. // "minimum": "0",
  72950. // "type": "integer"
  72951. // },
  72952. // "order_by": {
  72953. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72954. // "location": "query",
  72955. // "type": "string"
  72956. // },
  72957. // "pageToken": {
  72958. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72959. // "location": "query",
  72960. // "type": "string"
  72961. // },
  72962. // "project": {
  72963. // "description": "Project ID for this request.",
  72964. // "location": "path",
  72965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72966. // "required": true,
  72967. // "type": "string"
  72968. // },
  72969. // "region": {
  72970. // "description": "Name of the region scoping this request.",
  72971. // "location": "path",
  72972. // "required": true,
  72973. // "type": "string"
  72974. // }
  72975. // },
  72976. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  72977. // "response": {
  72978. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  72979. // },
  72980. // "scopes": [
  72981. // "https://www.googleapis.com/auth/cloud-platform",
  72982. // "https://www.googleapis.com/auth/compute",
  72983. // "https://www.googleapis.com/auth/compute.readonly"
  72984. // ]
  72985. // }
  72986. }
  72987. // method id "compute.regionInstanceGroupManagers.patch":
  72988. type RegionInstanceGroupManagersPatchCall struct {
  72989. s *Service
  72990. project string
  72991. region string
  72992. instanceGroupManager string
  72993. instancegroupmanager *InstanceGroupManager
  72994. urlParams_ gensupport.URLParams
  72995. ctx_ context.Context
  72996. header_ http.Header
  72997. }
  72998. // Patch: Updates a managed instance group using the information that
  72999. // you specify in the request. This operation is marked as DONE when the
  73000. // group is patched even if the instances in the group are still in the
  73001. // process of being patched. You must separately verify the status of
  73002. // the individual instances with the listmanagedinstances method. This
  73003. // method supports PATCH semantics and uses the JSON merge patch format
  73004. // and processing rules.
  73005. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  73006. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73007. c.project = project
  73008. c.region = region
  73009. c.instanceGroupManager = instanceGroupManager
  73010. c.instancegroupmanager = instancegroupmanager
  73011. return c
  73012. }
  73013. // RequestId sets the optional parameter "requestId": An optional
  73014. // request ID to identify requests. Specify a unique request ID so that
  73015. // if you must retry your request, the server will know to ignore the
  73016. // request if it has already been completed.
  73017. //
  73018. // For example, consider a situation where you make an initial request
  73019. // and the request times out. If you make the request again with the
  73020. // same request ID, the server can check if original operation with the
  73021. // same request ID was received, and if so, will ignore the second
  73022. // request. This prevents clients from accidentally creating duplicate
  73023. // commitments.
  73024. //
  73025. // The request ID must be a valid UUID with the exception that zero UUID
  73026. // is not supported (00000000-0000-0000-0000-000000000000).
  73027. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  73028. c.urlParams_.Set("requestId", requestId)
  73029. return c
  73030. }
  73031. // Fields allows partial responses to be retrieved. See
  73032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73033. // for more information.
  73034. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  73035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73036. return c
  73037. }
  73038. // Context sets the context to be used in this call's Do method. Any
  73039. // pending HTTP request will be aborted if the provided context is
  73040. // canceled.
  73041. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  73042. c.ctx_ = ctx
  73043. return c
  73044. }
  73045. // Header returns an http.Header that can be modified by the caller to
  73046. // add HTTP headers to the request.
  73047. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  73048. if c.header_ == nil {
  73049. c.header_ = make(http.Header)
  73050. }
  73051. return c.header_
  73052. }
  73053. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  73054. reqHeaders := make(http.Header)
  73055. for k, v := range c.header_ {
  73056. reqHeaders[k] = v
  73057. }
  73058. reqHeaders.Set("User-Agent", c.s.userAgent())
  73059. var body io.Reader = nil
  73060. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  73061. if err != nil {
  73062. return nil, err
  73063. }
  73064. reqHeaders.Set("Content-Type", "application/json")
  73065. c.urlParams_.Set("alt", alt)
  73066. c.urlParams_.Set("prettyPrint", "false")
  73067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  73068. urls += "?" + c.urlParams_.Encode()
  73069. req, err := http.NewRequest("PATCH", urls, body)
  73070. if err != nil {
  73071. return nil, err
  73072. }
  73073. req.Header = reqHeaders
  73074. googleapi.Expand(req.URL, map[string]string{
  73075. "project": c.project,
  73076. "region": c.region,
  73077. "instanceGroupManager": c.instanceGroupManager,
  73078. })
  73079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73080. }
  73081. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  73082. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73083. // status code is an error. Response headers are in either
  73084. // *Operation.ServerResponse.Header or (if a response was returned at
  73085. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73086. // to check whether the returned error was because
  73087. // http.StatusNotModified was returned.
  73088. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73089. gensupport.SetOptions(c.urlParams_, opts...)
  73090. res, err := c.doRequest("json")
  73091. if res != nil && res.StatusCode == http.StatusNotModified {
  73092. if res.Body != nil {
  73093. res.Body.Close()
  73094. }
  73095. return nil, &googleapi.Error{
  73096. Code: res.StatusCode,
  73097. Header: res.Header,
  73098. }
  73099. }
  73100. if err != nil {
  73101. return nil, err
  73102. }
  73103. defer googleapi.CloseBody(res)
  73104. if err := googleapi.CheckResponse(res); err != nil {
  73105. return nil, err
  73106. }
  73107. ret := &Operation{
  73108. ServerResponse: googleapi.ServerResponse{
  73109. Header: res.Header,
  73110. HTTPStatusCode: res.StatusCode,
  73111. },
  73112. }
  73113. target := &ret
  73114. if err := gensupport.DecodeResponse(target, res); err != nil {
  73115. return nil, err
  73116. }
  73117. return ret, nil
  73118. // {
  73119. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  73120. // "httpMethod": "PATCH",
  73121. // "id": "compute.regionInstanceGroupManagers.patch",
  73122. // "parameterOrder": [
  73123. // "project",
  73124. // "region",
  73125. // "instanceGroupManager"
  73126. // ],
  73127. // "parameters": {
  73128. // "instanceGroupManager": {
  73129. // "description": "The name of the instance group manager.",
  73130. // "location": "path",
  73131. // "required": true,
  73132. // "type": "string"
  73133. // },
  73134. // "project": {
  73135. // "description": "Project ID for this request.",
  73136. // "location": "path",
  73137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73138. // "required": true,
  73139. // "type": "string"
  73140. // },
  73141. // "region": {
  73142. // "description": "Name of the region scoping this request.",
  73143. // "location": "path",
  73144. // "required": true,
  73145. // "type": "string"
  73146. // },
  73147. // "requestId": {
  73148. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73149. // "location": "query",
  73150. // "type": "string"
  73151. // }
  73152. // },
  73153. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  73154. // "request": {
  73155. // "$ref": "InstanceGroupManager"
  73156. // },
  73157. // "response": {
  73158. // "$ref": "Operation"
  73159. // },
  73160. // "scopes": [
  73161. // "https://www.googleapis.com/auth/cloud-platform",
  73162. // "https://www.googleapis.com/auth/compute"
  73163. // ]
  73164. // }
  73165. }
  73166. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  73167. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  73168. s *Service
  73169. project string
  73170. region string
  73171. instanceGroupManager string
  73172. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  73173. urlParams_ gensupport.URLParams
  73174. ctx_ context.Context
  73175. header_ http.Header
  73176. }
  73177. // RecreateInstances: Flags the specified instances in the managed
  73178. // instance group to be immediately recreated. The instances are deleted
  73179. // and recreated using the current instance template for the managed
  73180. // instance group. This operation is marked as DONE when the flag is set
  73181. // even if the instances have not yet been recreated. You must
  73182. // separately verify the status of the recreating action with the
  73183. // listmanagedinstances method.
  73184. //
  73185. // If the group is part of a backend service that has enabled connection
  73186. // draining, it can take up to 60 seconds after the connection draining
  73187. // duration has elapsed before the VM instance is removed or
  73188. // deleted.
  73189. //
  73190. // You can specify a maximum of 1000 instances with this method per
  73191. // request.
  73192. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  73193. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73194. c.project = project
  73195. c.region = region
  73196. c.instanceGroupManager = instanceGroupManager
  73197. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  73198. return c
  73199. }
  73200. // RequestId sets the optional parameter "requestId": An optional
  73201. // request ID to identify requests. Specify a unique request ID so that
  73202. // if you must retry your request, the server will know to ignore the
  73203. // request if it has already been completed.
  73204. //
  73205. // For example, consider a situation where you make an initial request
  73206. // and the request times out. If you make the request again with the
  73207. // same request ID, the server can check if original operation with the
  73208. // same request ID was received, and if so, will ignore the second
  73209. // request. This prevents clients from accidentally creating duplicate
  73210. // commitments.
  73211. //
  73212. // The request ID must be a valid UUID with the exception that zero UUID
  73213. // is not supported (00000000-0000-0000-0000-000000000000).
  73214. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  73215. c.urlParams_.Set("requestId", requestId)
  73216. return c
  73217. }
  73218. // Fields allows partial responses to be retrieved. See
  73219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73220. // for more information.
  73221. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  73222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73223. return c
  73224. }
  73225. // Context sets the context to be used in this call's Do method. Any
  73226. // pending HTTP request will be aborted if the provided context is
  73227. // canceled.
  73228. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  73229. c.ctx_ = ctx
  73230. return c
  73231. }
  73232. // Header returns an http.Header that can be modified by the caller to
  73233. // add HTTP headers to the request.
  73234. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  73235. if c.header_ == nil {
  73236. c.header_ = make(http.Header)
  73237. }
  73238. return c.header_
  73239. }
  73240. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  73241. reqHeaders := make(http.Header)
  73242. for k, v := range c.header_ {
  73243. reqHeaders[k] = v
  73244. }
  73245. reqHeaders.Set("User-Agent", c.s.userAgent())
  73246. var body io.Reader = nil
  73247. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  73248. if err != nil {
  73249. return nil, err
  73250. }
  73251. reqHeaders.Set("Content-Type", "application/json")
  73252. c.urlParams_.Set("alt", alt)
  73253. c.urlParams_.Set("prettyPrint", "false")
  73254. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  73255. urls += "?" + c.urlParams_.Encode()
  73256. req, err := http.NewRequest("POST", urls, body)
  73257. if err != nil {
  73258. return nil, err
  73259. }
  73260. req.Header = reqHeaders
  73261. googleapi.Expand(req.URL, map[string]string{
  73262. "project": c.project,
  73263. "region": c.region,
  73264. "instanceGroupManager": c.instanceGroupManager,
  73265. })
  73266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73267. }
  73268. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  73269. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73270. // status code is an error. Response headers are in either
  73271. // *Operation.ServerResponse.Header or (if a response was returned at
  73272. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73273. // to check whether the returned error was because
  73274. // http.StatusNotModified was returned.
  73275. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73276. gensupport.SetOptions(c.urlParams_, opts...)
  73277. res, err := c.doRequest("json")
  73278. if res != nil && res.StatusCode == http.StatusNotModified {
  73279. if res.Body != nil {
  73280. res.Body.Close()
  73281. }
  73282. return nil, &googleapi.Error{
  73283. Code: res.StatusCode,
  73284. Header: res.Header,
  73285. }
  73286. }
  73287. if err != nil {
  73288. return nil, err
  73289. }
  73290. defer googleapi.CloseBody(res)
  73291. if err := googleapi.CheckResponse(res); err != nil {
  73292. return nil, err
  73293. }
  73294. ret := &Operation{
  73295. ServerResponse: googleapi.ServerResponse{
  73296. Header: res.Header,
  73297. HTTPStatusCode: res.StatusCode,
  73298. },
  73299. }
  73300. target := &ret
  73301. if err := gensupport.DecodeResponse(target, res); err != nil {
  73302. return nil, err
  73303. }
  73304. return ret, nil
  73305. // {
  73306. // "description": "Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  73307. // "httpMethod": "POST",
  73308. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  73309. // "parameterOrder": [
  73310. // "project",
  73311. // "region",
  73312. // "instanceGroupManager"
  73313. // ],
  73314. // "parameters": {
  73315. // "instanceGroupManager": {
  73316. // "description": "Name of the managed instance group.",
  73317. // "location": "path",
  73318. // "required": true,
  73319. // "type": "string"
  73320. // },
  73321. // "project": {
  73322. // "description": "Project ID for this request.",
  73323. // "location": "path",
  73324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73325. // "required": true,
  73326. // "type": "string"
  73327. // },
  73328. // "region": {
  73329. // "description": "Name of the region scoping this request.",
  73330. // "location": "path",
  73331. // "required": true,
  73332. // "type": "string"
  73333. // },
  73334. // "requestId": {
  73335. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73336. // "location": "query",
  73337. // "type": "string"
  73338. // }
  73339. // },
  73340. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  73341. // "request": {
  73342. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  73343. // },
  73344. // "response": {
  73345. // "$ref": "Operation"
  73346. // },
  73347. // "scopes": [
  73348. // "https://www.googleapis.com/auth/cloud-platform",
  73349. // "https://www.googleapis.com/auth/compute"
  73350. // ]
  73351. // }
  73352. }
  73353. // method id "compute.regionInstanceGroupManagers.resize":
  73354. type RegionInstanceGroupManagersResizeCall struct {
  73355. s *Service
  73356. project string
  73357. region string
  73358. instanceGroupManager string
  73359. urlParams_ gensupport.URLParams
  73360. ctx_ context.Context
  73361. header_ http.Header
  73362. }
  73363. // Resize: Changes the intended size of the managed instance group. If
  73364. // you increase the size, the group creates new instances using the
  73365. // current instance template. If you decrease the size, the group
  73366. // deletes one or more instances.
  73367. //
  73368. // The resize operation is marked DONE if the resize request is
  73369. // successful. The underlying actions take additional time. You must
  73370. // separately verify the status of the creating or deleting actions with
  73371. // the listmanagedinstances method.
  73372. //
  73373. // If the group is part of a backend service that has enabled connection
  73374. // draining, it can take up to 60 seconds after the connection draining
  73375. // duration has elapsed before the VM instance is removed or deleted.
  73376. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  73377. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73378. c.project = project
  73379. c.region = region
  73380. c.instanceGroupManager = instanceGroupManager
  73381. c.urlParams_.Set("size", fmt.Sprint(size))
  73382. return c
  73383. }
  73384. // RequestId sets the optional parameter "requestId": An optional
  73385. // request ID to identify requests. Specify a unique request ID so that
  73386. // if you must retry your request, the server will know to ignore the
  73387. // request if it has already been completed.
  73388. //
  73389. // For example, consider a situation where you make an initial request
  73390. // and the request times out. If you make the request again with the
  73391. // same request ID, the server can check if original operation with the
  73392. // same request ID was received, and if so, will ignore the second
  73393. // request. This prevents clients from accidentally creating duplicate
  73394. // commitments.
  73395. //
  73396. // The request ID must be a valid UUID with the exception that zero UUID
  73397. // is not supported (00000000-0000-0000-0000-000000000000).
  73398. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  73399. c.urlParams_.Set("requestId", requestId)
  73400. return c
  73401. }
  73402. // Fields allows partial responses to be retrieved. See
  73403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73404. // for more information.
  73405. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  73406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73407. return c
  73408. }
  73409. // Context sets the context to be used in this call's Do method. Any
  73410. // pending HTTP request will be aborted if the provided context is
  73411. // canceled.
  73412. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  73413. c.ctx_ = ctx
  73414. return c
  73415. }
  73416. // Header returns an http.Header that can be modified by the caller to
  73417. // add HTTP headers to the request.
  73418. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  73419. if c.header_ == nil {
  73420. c.header_ = make(http.Header)
  73421. }
  73422. return c.header_
  73423. }
  73424. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  73425. reqHeaders := make(http.Header)
  73426. for k, v := range c.header_ {
  73427. reqHeaders[k] = v
  73428. }
  73429. reqHeaders.Set("User-Agent", c.s.userAgent())
  73430. var body io.Reader = nil
  73431. c.urlParams_.Set("alt", alt)
  73432. c.urlParams_.Set("prettyPrint", "false")
  73433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  73434. urls += "?" + c.urlParams_.Encode()
  73435. req, err := http.NewRequest("POST", urls, body)
  73436. if err != nil {
  73437. return nil, err
  73438. }
  73439. req.Header = reqHeaders
  73440. googleapi.Expand(req.URL, map[string]string{
  73441. "project": c.project,
  73442. "region": c.region,
  73443. "instanceGroupManager": c.instanceGroupManager,
  73444. })
  73445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73446. }
  73447. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  73448. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73449. // status code is an error. Response headers are in either
  73450. // *Operation.ServerResponse.Header or (if a response was returned at
  73451. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73452. // to check whether the returned error was because
  73453. // http.StatusNotModified was returned.
  73454. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73455. gensupport.SetOptions(c.urlParams_, opts...)
  73456. res, err := c.doRequest("json")
  73457. if res != nil && res.StatusCode == http.StatusNotModified {
  73458. if res.Body != nil {
  73459. res.Body.Close()
  73460. }
  73461. return nil, &googleapi.Error{
  73462. Code: res.StatusCode,
  73463. Header: res.Header,
  73464. }
  73465. }
  73466. if err != nil {
  73467. return nil, err
  73468. }
  73469. defer googleapi.CloseBody(res)
  73470. if err := googleapi.CheckResponse(res); err != nil {
  73471. return nil, err
  73472. }
  73473. ret := &Operation{
  73474. ServerResponse: googleapi.ServerResponse{
  73475. Header: res.Header,
  73476. HTTPStatusCode: res.StatusCode,
  73477. },
  73478. }
  73479. target := &ret
  73480. if err := gensupport.DecodeResponse(target, res); err != nil {
  73481. return nil, err
  73482. }
  73483. return ret, nil
  73484. // {
  73485. // "description": "Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances.\n\nThe resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  73486. // "httpMethod": "POST",
  73487. // "id": "compute.regionInstanceGroupManagers.resize",
  73488. // "parameterOrder": [
  73489. // "project",
  73490. // "region",
  73491. // "instanceGroupManager",
  73492. // "size"
  73493. // ],
  73494. // "parameters": {
  73495. // "instanceGroupManager": {
  73496. // "description": "Name of the managed instance group.",
  73497. // "location": "path",
  73498. // "required": true,
  73499. // "type": "string"
  73500. // },
  73501. // "project": {
  73502. // "description": "Project ID for this request.",
  73503. // "location": "path",
  73504. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73505. // "required": true,
  73506. // "type": "string"
  73507. // },
  73508. // "region": {
  73509. // "description": "Name of the region scoping this request.",
  73510. // "location": "path",
  73511. // "required": true,
  73512. // "type": "string"
  73513. // },
  73514. // "requestId": {
  73515. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73516. // "location": "query",
  73517. // "type": "string"
  73518. // },
  73519. // "size": {
  73520. // "description": "Number of instances that should exist in this instance group manager.",
  73521. // "format": "int32",
  73522. // "location": "query",
  73523. // "minimum": "0",
  73524. // "required": true,
  73525. // "type": "integer"
  73526. // }
  73527. // },
  73528. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  73529. // "response": {
  73530. // "$ref": "Operation"
  73531. // },
  73532. // "scopes": [
  73533. // "https://www.googleapis.com/auth/cloud-platform",
  73534. // "https://www.googleapis.com/auth/compute"
  73535. // ]
  73536. // }
  73537. }
  73538. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  73539. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  73540. s *Service
  73541. project string
  73542. region string
  73543. instanceGroupManager string
  73544. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  73545. urlParams_ gensupport.URLParams
  73546. ctx_ context.Context
  73547. header_ http.Header
  73548. }
  73549. // SetInstanceTemplate: Sets the instance template to use when creating
  73550. // new instances or recreating instances in this group. Existing
  73551. // instances are not affected.
  73552. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  73553. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73554. c.project = project
  73555. c.region = region
  73556. c.instanceGroupManager = instanceGroupManager
  73557. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  73558. return c
  73559. }
  73560. // RequestId sets the optional parameter "requestId": An optional
  73561. // request ID to identify requests. Specify a unique request ID so that
  73562. // if you must retry your request, the server will know to ignore the
  73563. // request if it has already been completed.
  73564. //
  73565. // For example, consider a situation where you make an initial request
  73566. // and the request times out. If you make the request again with the
  73567. // same request ID, the server can check if original operation with the
  73568. // same request ID was received, and if so, will ignore the second
  73569. // request. This prevents clients from accidentally creating duplicate
  73570. // commitments.
  73571. //
  73572. // The request ID must be a valid UUID with the exception that zero UUID
  73573. // is not supported (00000000-0000-0000-0000-000000000000).
  73574. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  73575. c.urlParams_.Set("requestId", requestId)
  73576. return c
  73577. }
  73578. // Fields allows partial responses to be retrieved. See
  73579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73580. // for more information.
  73581. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  73582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73583. return c
  73584. }
  73585. // Context sets the context to be used in this call's Do method. Any
  73586. // pending HTTP request will be aborted if the provided context is
  73587. // canceled.
  73588. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  73589. c.ctx_ = ctx
  73590. return c
  73591. }
  73592. // Header returns an http.Header that can be modified by the caller to
  73593. // add HTTP headers to the request.
  73594. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  73595. if c.header_ == nil {
  73596. c.header_ = make(http.Header)
  73597. }
  73598. return c.header_
  73599. }
  73600. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  73601. reqHeaders := make(http.Header)
  73602. for k, v := range c.header_ {
  73603. reqHeaders[k] = v
  73604. }
  73605. reqHeaders.Set("User-Agent", c.s.userAgent())
  73606. var body io.Reader = nil
  73607. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  73608. if err != nil {
  73609. return nil, err
  73610. }
  73611. reqHeaders.Set("Content-Type", "application/json")
  73612. c.urlParams_.Set("alt", alt)
  73613. c.urlParams_.Set("prettyPrint", "false")
  73614. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  73615. urls += "?" + c.urlParams_.Encode()
  73616. req, err := http.NewRequest("POST", urls, body)
  73617. if err != nil {
  73618. return nil, err
  73619. }
  73620. req.Header = reqHeaders
  73621. googleapi.Expand(req.URL, map[string]string{
  73622. "project": c.project,
  73623. "region": c.region,
  73624. "instanceGroupManager": c.instanceGroupManager,
  73625. })
  73626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73627. }
  73628. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  73629. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73630. // status code is an error. Response headers are in either
  73631. // *Operation.ServerResponse.Header or (if a response was returned at
  73632. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73633. // to check whether the returned error was because
  73634. // http.StatusNotModified was returned.
  73635. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73636. gensupport.SetOptions(c.urlParams_, opts...)
  73637. res, err := c.doRequest("json")
  73638. if res != nil && res.StatusCode == http.StatusNotModified {
  73639. if res.Body != nil {
  73640. res.Body.Close()
  73641. }
  73642. return nil, &googleapi.Error{
  73643. Code: res.StatusCode,
  73644. Header: res.Header,
  73645. }
  73646. }
  73647. if err != nil {
  73648. return nil, err
  73649. }
  73650. defer googleapi.CloseBody(res)
  73651. if err := googleapi.CheckResponse(res); err != nil {
  73652. return nil, err
  73653. }
  73654. ret := &Operation{
  73655. ServerResponse: googleapi.ServerResponse{
  73656. Header: res.Header,
  73657. HTTPStatusCode: res.StatusCode,
  73658. },
  73659. }
  73660. target := &ret
  73661. if err := gensupport.DecodeResponse(target, res); err != nil {
  73662. return nil, err
  73663. }
  73664. return ret, nil
  73665. // {
  73666. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  73667. // "httpMethod": "POST",
  73668. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  73669. // "parameterOrder": [
  73670. // "project",
  73671. // "region",
  73672. // "instanceGroupManager"
  73673. // ],
  73674. // "parameters": {
  73675. // "instanceGroupManager": {
  73676. // "description": "The name of the managed instance group.",
  73677. // "location": "path",
  73678. // "required": true,
  73679. // "type": "string"
  73680. // },
  73681. // "project": {
  73682. // "description": "Project ID for this request.",
  73683. // "location": "path",
  73684. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73685. // "required": true,
  73686. // "type": "string"
  73687. // },
  73688. // "region": {
  73689. // "description": "Name of the region scoping this request.",
  73690. // "location": "path",
  73691. // "required": true,
  73692. // "type": "string"
  73693. // },
  73694. // "requestId": {
  73695. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73696. // "location": "query",
  73697. // "type": "string"
  73698. // }
  73699. // },
  73700. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  73701. // "request": {
  73702. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  73703. // },
  73704. // "response": {
  73705. // "$ref": "Operation"
  73706. // },
  73707. // "scopes": [
  73708. // "https://www.googleapis.com/auth/cloud-platform",
  73709. // "https://www.googleapis.com/auth/compute"
  73710. // ]
  73711. // }
  73712. }
  73713. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  73714. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  73715. s *Service
  73716. project string
  73717. region string
  73718. instanceGroupManager string
  73719. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  73720. urlParams_ gensupport.URLParams
  73721. ctx_ context.Context
  73722. header_ http.Header
  73723. }
  73724. // SetTargetPools: Modifies the target pools to which all new instances
  73725. // in this group are assigned. Existing instances in the group are not
  73726. // affected.
  73727. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  73728. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73729. c.project = project
  73730. c.region = region
  73731. c.instanceGroupManager = instanceGroupManager
  73732. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  73733. return c
  73734. }
  73735. // RequestId sets the optional parameter "requestId": An optional
  73736. // request ID to identify requests. Specify a unique request ID so that
  73737. // if you must retry your request, the server will know to ignore the
  73738. // request if it has already been completed.
  73739. //
  73740. // For example, consider a situation where you make an initial request
  73741. // and the request times out. If you make the request again with the
  73742. // same request ID, the server can check if original operation with the
  73743. // same request ID was received, and if so, will ignore the second
  73744. // request. This prevents clients from accidentally creating duplicate
  73745. // commitments.
  73746. //
  73747. // The request ID must be a valid UUID with the exception that zero UUID
  73748. // is not supported (00000000-0000-0000-0000-000000000000).
  73749. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  73750. c.urlParams_.Set("requestId", requestId)
  73751. return c
  73752. }
  73753. // Fields allows partial responses to be retrieved. See
  73754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73755. // for more information.
  73756. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  73757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73758. return c
  73759. }
  73760. // Context sets the context to be used in this call's Do method. Any
  73761. // pending HTTP request will be aborted if the provided context is
  73762. // canceled.
  73763. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  73764. c.ctx_ = ctx
  73765. return c
  73766. }
  73767. // Header returns an http.Header that can be modified by the caller to
  73768. // add HTTP headers to the request.
  73769. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  73770. if c.header_ == nil {
  73771. c.header_ = make(http.Header)
  73772. }
  73773. return c.header_
  73774. }
  73775. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  73776. reqHeaders := make(http.Header)
  73777. for k, v := range c.header_ {
  73778. reqHeaders[k] = v
  73779. }
  73780. reqHeaders.Set("User-Agent", c.s.userAgent())
  73781. var body io.Reader = nil
  73782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  73783. if err != nil {
  73784. return nil, err
  73785. }
  73786. reqHeaders.Set("Content-Type", "application/json")
  73787. c.urlParams_.Set("alt", alt)
  73788. c.urlParams_.Set("prettyPrint", "false")
  73789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  73790. urls += "?" + c.urlParams_.Encode()
  73791. req, err := http.NewRequest("POST", urls, body)
  73792. if err != nil {
  73793. return nil, err
  73794. }
  73795. req.Header = reqHeaders
  73796. googleapi.Expand(req.URL, map[string]string{
  73797. "project": c.project,
  73798. "region": c.region,
  73799. "instanceGroupManager": c.instanceGroupManager,
  73800. })
  73801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73802. }
  73803. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  73804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73805. // status code is an error. Response headers are in either
  73806. // *Operation.ServerResponse.Header or (if a response was returned at
  73807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73808. // to check whether the returned error was because
  73809. // http.StatusNotModified was returned.
  73810. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73811. gensupport.SetOptions(c.urlParams_, opts...)
  73812. res, err := c.doRequest("json")
  73813. if res != nil && res.StatusCode == http.StatusNotModified {
  73814. if res.Body != nil {
  73815. res.Body.Close()
  73816. }
  73817. return nil, &googleapi.Error{
  73818. Code: res.StatusCode,
  73819. Header: res.Header,
  73820. }
  73821. }
  73822. if err != nil {
  73823. return nil, err
  73824. }
  73825. defer googleapi.CloseBody(res)
  73826. if err := googleapi.CheckResponse(res); err != nil {
  73827. return nil, err
  73828. }
  73829. ret := &Operation{
  73830. ServerResponse: googleapi.ServerResponse{
  73831. Header: res.Header,
  73832. HTTPStatusCode: res.StatusCode,
  73833. },
  73834. }
  73835. target := &ret
  73836. if err := gensupport.DecodeResponse(target, res); err != nil {
  73837. return nil, err
  73838. }
  73839. return ret, nil
  73840. // {
  73841. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  73842. // "httpMethod": "POST",
  73843. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  73844. // "parameterOrder": [
  73845. // "project",
  73846. // "region",
  73847. // "instanceGroupManager"
  73848. // ],
  73849. // "parameters": {
  73850. // "instanceGroupManager": {
  73851. // "description": "Name of the managed instance group.",
  73852. // "location": "path",
  73853. // "required": true,
  73854. // "type": "string"
  73855. // },
  73856. // "project": {
  73857. // "description": "Project ID for this request.",
  73858. // "location": "path",
  73859. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73860. // "required": true,
  73861. // "type": "string"
  73862. // },
  73863. // "region": {
  73864. // "description": "Name of the region scoping this request.",
  73865. // "location": "path",
  73866. // "required": true,
  73867. // "type": "string"
  73868. // },
  73869. // "requestId": {
  73870. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73871. // "location": "query",
  73872. // "type": "string"
  73873. // }
  73874. // },
  73875. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  73876. // "request": {
  73877. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  73878. // },
  73879. // "response": {
  73880. // "$ref": "Operation"
  73881. // },
  73882. // "scopes": [
  73883. // "https://www.googleapis.com/auth/cloud-platform",
  73884. // "https://www.googleapis.com/auth/compute"
  73885. // ]
  73886. // }
  73887. }
  73888. // method id "compute.regionInstanceGroups.get":
  73889. type RegionInstanceGroupsGetCall struct {
  73890. s *Service
  73891. project string
  73892. region string
  73893. instanceGroup string
  73894. urlParams_ gensupport.URLParams
  73895. ifNoneMatch_ string
  73896. ctx_ context.Context
  73897. header_ http.Header
  73898. }
  73899. // Get: Returns the specified instance group resource.
  73900. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  73901. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73902. c.project = project
  73903. c.region = region
  73904. c.instanceGroup = instanceGroup
  73905. return c
  73906. }
  73907. // Fields allows partial responses to be retrieved. See
  73908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73909. // for more information.
  73910. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  73911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73912. return c
  73913. }
  73914. // IfNoneMatch sets the optional parameter which makes the operation
  73915. // fail if the object's ETag matches the given value. This is useful for
  73916. // getting updates only after the object has changed since the last
  73917. // request. Use googleapi.IsNotModified to check whether the response
  73918. // error from Do is the result of In-None-Match.
  73919. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  73920. c.ifNoneMatch_ = entityTag
  73921. return c
  73922. }
  73923. // Context sets the context to be used in this call's Do method. Any
  73924. // pending HTTP request will be aborted if the provided context is
  73925. // canceled.
  73926. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  73927. c.ctx_ = ctx
  73928. return c
  73929. }
  73930. // Header returns an http.Header that can be modified by the caller to
  73931. // add HTTP headers to the request.
  73932. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  73933. if c.header_ == nil {
  73934. c.header_ = make(http.Header)
  73935. }
  73936. return c.header_
  73937. }
  73938. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  73939. reqHeaders := make(http.Header)
  73940. for k, v := range c.header_ {
  73941. reqHeaders[k] = v
  73942. }
  73943. reqHeaders.Set("User-Agent", c.s.userAgent())
  73944. if c.ifNoneMatch_ != "" {
  73945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73946. }
  73947. var body io.Reader = nil
  73948. c.urlParams_.Set("alt", alt)
  73949. c.urlParams_.Set("prettyPrint", "false")
  73950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  73951. urls += "?" + c.urlParams_.Encode()
  73952. req, err := http.NewRequest("GET", urls, body)
  73953. if err != nil {
  73954. return nil, err
  73955. }
  73956. req.Header = reqHeaders
  73957. googleapi.Expand(req.URL, map[string]string{
  73958. "project": c.project,
  73959. "region": c.region,
  73960. "instanceGroup": c.instanceGroup,
  73961. })
  73962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73963. }
  73964. // Do executes the "compute.regionInstanceGroups.get" call.
  73965. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  73966. // status code is an error. Response headers are in either
  73967. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  73968. // at all) in error.(*googleapi.Error).Header. Use
  73969. // googleapi.IsNotModified to check whether the returned error was
  73970. // because http.StatusNotModified was returned.
  73971. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  73972. gensupport.SetOptions(c.urlParams_, opts...)
  73973. res, err := c.doRequest("json")
  73974. if res != nil && res.StatusCode == http.StatusNotModified {
  73975. if res.Body != nil {
  73976. res.Body.Close()
  73977. }
  73978. return nil, &googleapi.Error{
  73979. Code: res.StatusCode,
  73980. Header: res.Header,
  73981. }
  73982. }
  73983. if err != nil {
  73984. return nil, err
  73985. }
  73986. defer googleapi.CloseBody(res)
  73987. if err := googleapi.CheckResponse(res); err != nil {
  73988. return nil, err
  73989. }
  73990. ret := &InstanceGroup{
  73991. ServerResponse: googleapi.ServerResponse{
  73992. Header: res.Header,
  73993. HTTPStatusCode: res.StatusCode,
  73994. },
  73995. }
  73996. target := &ret
  73997. if err := gensupport.DecodeResponse(target, res); err != nil {
  73998. return nil, err
  73999. }
  74000. return ret, nil
  74001. // {
  74002. // "description": "Returns the specified instance group resource.",
  74003. // "httpMethod": "GET",
  74004. // "id": "compute.regionInstanceGroups.get",
  74005. // "parameterOrder": [
  74006. // "project",
  74007. // "region",
  74008. // "instanceGroup"
  74009. // ],
  74010. // "parameters": {
  74011. // "instanceGroup": {
  74012. // "description": "Name of the instance group resource to return.",
  74013. // "location": "path",
  74014. // "required": true,
  74015. // "type": "string"
  74016. // },
  74017. // "project": {
  74018. // "description": "Project ID for this request.",
  74019. // "location": "path",
  74020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74021. // "required": true,
  74022. // "type": "string"
  74023. // },
  74024. // "region": {
  74025. // "description": "Name of the region scoping this request.",
  74026. // "location": "path",
  74027. // "required": true,
  74028. // "type": "string"
  74029. // }
  74030. // },
  74031. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  74032. // "response": {
  74033. // "$ref": "InstanceGroup"
  74034. // },
  74035. // "scopes": [
  74036. // "https://www.googleapis.com/auth/cloud-platform",
  74037. // "https://www.googleapis.com/auth/compute",
  74038. // "https://www.googleapis.com/auth/compute.readonly"
  74039. // ]
  74040. // }
  74041. }
  74042. // method id "compute.regionInstanceGroups.list":
  74043. type RegionInstanceGroupsListCall struct {
  74044. s *Service
  74045. project string
  74046. region string
  74047. urlParams_ gensupport.URLParams
  74048. ifNoneMatch_ string
  74049. ctx_ context.Context
  74050. header_ http.Header
  74051. }
  74052. // List: Retrieves the list of instance group resources contained within
  74053. // the specified region.
  74054. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  74055. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74056. c.project = project
  74057. c.region = region
  74058. return c
  74059. }
  74060. // Filter sets the optional parameter "filter": A filter expression that
  74061. // filters resources listed in the response. The expression must specify
  74062. // the field name, a comparison operator, and the value that you want to
  74063. // use for filtering. The value must be a string, a number, or a
  74064. // boolean. The comparison operator must be either =, !=, >, or <.
  74065. //
  74066. // For example, if you are filtering Compute Engine instances, you can
  74067. // exclude instances named example-instance by specifying name !=
  74068. // example-instance.
  74069. //
  74070. // You can also filter nested fields. For example, you could specify
  74071. // scheduling.automaticRestart = false to include instances only if they
  74072. // are not scheduled for automatic restarts. You can use filtering on
  74073. // nested fields to filter based on resource labels.
  74074. //
  74075. // To filter on multiple expressions, provide each separate expression
  74076. // within parentheses. For example, (scheduling.automaticRestart = true)
  74077. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74078. // AND expression. However, you can include AND and OR expressions
  74079. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74080. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74081. // true).
  74082. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  74083. c.urlParams_.Set("filter", filter)
  74084. return c
  74085. }
  74086. // MaxResults sets the optional parameter "maxResults": The maximum
  74087. // number of results per page that should be returned. If the number of
  74088. // available results is larger than maxResults, Compute Engine returns a
  74089. // nextPageToken that can be used to get the next page of results in
  74090. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74091. // (Default: 500)
  74092. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  74093. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74094. return c
  74095. }
  74096. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74097. // a certain order. By default, results are returned in alphanumerical
  74098. // order based on the resource name.
  74099. //
  74100. // You can also sort results in descending order based on the creation
  74101. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74102. // based on the creationTimestamp field in reverse chronological order
  74103. // (newest result first). Use this to sort resources like operations so
  74104. // that the newest operation is returned first.
  74105. //
  74106. // Currently, only sorting by name or creationTimestamp desc is
  74107. // supported.
  74108. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  74109. c.urlParams_.Set("orderBy", orderBy)
  74110. return c
  74111. }
  74112. // PageToken sets the optional parameter "pageToken": Specifies a page
  74113. // token to use. Set pageToken to the nextPageToken returned by a
  74114. // previous list request to get the next page of results.
  74115. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  74116. c.urlParams_.Set("pageToken", pageToken)
  74117. return c
  74118. }
  74119. // Fields allows partial responses to be retrieved. See
  74120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74121. // for more information.
  74122. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  74123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74124. return c
  74125. }
  74126. // IfNoneMatch sets the optional parameter which makes the operation
  74127. // fail if the object's ETag matches the given value. This is useful for
  74128. // getting updates only after the object has changed since the last
  74129. // request. Use googleapi.IsNotModified to check whether the response
  74130. // error from Do is the result of In-None-Match.
  74131. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  74132. c.ifNoneMatch_ = entityTag
  74133. return c
  74134. }
  74135. // Context sets the context to be used in this call's Do method. Any
  74136. // pending HTTP request will be aborted if the provided context is
  74137. // canceled.
  74138. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  74139. c.ctx_ = ctx
  74140. return c
  74141. }
  74142. // Header returns an http.Header that can be modified by the caller to
  74143. // add HTTP headers to the request.
  74144. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  74145. if c.header_ == nil {
  74146. c.header_ = make(http.Header)
  74147. }
  74148. return c.header_
  74149. }
  74150. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  74151. reqHeaders := make(http.Header)
  74152. for k, v := range c.header_ {
  74153. reqHeaders[k] = v
  74154. }
  74155. reqHeaders.Set("User-Agent", c.s.userAgent())
  74156. if c.ifNoneMatch_ != "" {
  74157. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74158. }
  74159. var body io.Reader = nil
  74160. c.urlParams_.Set("alt", alt)
  74161. c.urlParams_.Set("prettyPrint", "false")
  74162. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  74163. urls += "?" + c.urlParams_.Encode()
  74164. req, err := http.NewRequest("GET", urls, body)
  74165. if err != nil {
  74166. return nil, err
  74167. }
  74168. req.Header = reqHeaders
  74169. googleapi.Expand(req.URL, map[string]string{
  74170. "project": c.project,
  74171. "region": c.region,
  74172. })
  74173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74174. }
  74175. // Do executes the "compute.regionInstanceGroups.list" call.
  74176. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  74177. // non-2xx status code is an error. Response headers are in either
  74178. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  74179. // returned at all) in error.(*googleapi.Error).Header. Use
  74180. // googleapi.IsNotModified to check whether the returned error was
  74181. // because http.StatusNotModified was returned.
  74182. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  74183. gensupport.SetOptions(c.urlParams_, opts...)
  74184. res, err := c.doRequest("json")
  74185. if res != nil && res.StatusCode == http.StatusNotModified {
  74186. if res.Body != nil {
  74187. res.Body.Close()
  74188. }
  74189. return nil, &googleapi.Error{
  74190. Code: res.StatusCode,
  74191. Header: res.Header,
  74192. }
  74193. }
  74194. if err != nil {
  74195. return nil, err
  74196. }
  74197. defer googleapi.CloseBody(res)
  74198. if err := googleapi.CheckResponse(res); err != nil {
  74199. return nil, err
  74200. }
  74201. ret := &RegionInstanceGroupList{
  74202. ServerResponse: googleapi.ServerResponse{
  74203. Header: res.Header,
  74204. HTTPStatusCode: res.StatusCode,
  74205. },
  74206. }
  74207. target := &ret
  74208. if err := gensupport.DecodeResponse(target, res); err != nil {
  74209. return nil, err
  74210. }
  74211. return ret, nil
  74212. // {
  74213. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  74214. // "httpMethod": "GET",
  74215. // "id": "compute.regionInstanceGroups.list",
  74216. // "parameterOrder": [
  74217. // "project",
  74218. // "region"
  74219. // ],
  74220. // "parameters": {
  74221. // "filter": {
  74222. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  74223. // "location": "query",
  74224. // "type": "string"
  74225. // },
  74226. // "maxResults": {
  74227. // "default": "500",
  74228. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  74229. // "format": "uint32",
  74230. // "location": "query",
  74231. // "minimum": "0",
  74232. // "type": "integer"
  74233. // },
  74234. // "orderBy": {
  74235. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  74236. // "location": "query",
  74237. // "type": "string"
  74238. // },
  74239. // "pageToken": {
  74240. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  74241. // "location": "query",
  74242. // "type": "string"
  74243. // },
  74244. // "project": {
  74245. // "description": "Project ID for this request.",
  74246. // "location": "path",
  74247. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74248. // "required": true,
  74249. // "type": "string"
  74250. // },
  74251. // "region": {
  74252. // "description": "Name of the region scoping this request.",
  74253. // "location": "path",
  74254. // "required": true,
  74255. // "type": "string"
  74256. // }
  74257. // },
  74258. // "path": "{project}/regions/{region}/instanceGroups",
  74259. // "response": {
  74260. // "$ref": "RegionInstanceGroupList"
  74261. // },
  74262. // "scopes": [
  74263. // "https://www.googleapis.com/auth/cloud-platform",
  74264. // "https://www.googleapis.com/auth/compute",
  74265. // "https://www.googleapis.com/auth/compute.readonly"
  74266. // ]
  74267. // }
  74268. }
  74269. // Pages invokes f for each page of results.
  74270. // A non-nil error returned from f will halt the iteration.
  74271. // The provided context supersedes any context provided to the Context method.
  74272. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  74273. c.ctx_ = ctx
  74274. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74275. for {
  74276. x, err := c.Do()
  74277. if err != nil {
  74278. return err
  74279. }
  74280. if err := f(x); err != nil {
  74281. return err
  74282. }
  74283. if x.NextPageToken == "" {
  74284. return nil
  74285. }
  74286. c.PageToken(x.NextPageToken)
  74287. }
  74288. }
  74289. // method id "compute.regionInstanceGroups.listInstances":
  74290. type RegionInstanceGroupsListInstancesCall struct {
  74291. s *Service
  74292. project string
  74293. region string
  74294. instanceGroup string
  74295. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  74296. urlParams_ gensupport.URLParams
  74297. ctx_ context.Context
  74298. header_ http.Header
  74299. }
  74300. // ListInstances: Lists the instances in the specified instance group
  74301. // and displays information about the named ports. Depending on the
  74302. // specified options, this method can list all instances or only the
  74303. // instances that are running.
  74304. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  74305. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74306. c.project = project
  74307. c.region = region
  74308. c.instanceGroup = instanceGroup
  74309. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  74310. return c
  74311. }
  74312. // Filter sets the optional parameter "filter": A filter expression that
  74313. // filters resources listed in the response. The expression must specify
  74314. // the field name, a comparison operator, and the value that you want to
  74315. // use for filtering. The value must be a string, a number, or a
  74316. // boolean. The comparison operator must be either =, !=, >, or <.
  74317. //
  74318. // For example, if you are filtering Compute Engine instances, you can
  74319. // exclude instances named example-instance by specifying name !=
  74320. // example-instance.
  74321. //
  74322. // You can also filter nested fields. For example, you could specify
  74323. // scheduling.automaticRestart = false to include instances only if they
  74324. // are not scheduled for automatic restarts. You can use filtering on
  74325. // nested fields to filter based on resource labels.
  74326. //
  74327. // To filter on multiple expressions, provide each separate expression
  74328. // within parentheses. For example, (scheduling.automaticRestart = true)
  74329. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74330. // AND expression. However, you can include AND and OR expressions
  74331. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74332. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74333. // true).
  74334. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  74335. c.urlParams_.Set("filter", filter)
  74336. return c
  74337. }
  74338. // MaxResults sets the optional parameter "maxResults": The maximum
  74339. // number of results per page that should be returned. If the number of
  74340. // available results is larger than maxResults, Compute Engine returns a
  74341. // nextPageToken that can be used to get the next page of results in
  74342. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74343. // (Default: 500)
  74344. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  74345. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74346. return c
  74347. }
  74348. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74349. // a certain order. By default, results are returned in alphanumerical
  74350. // order based on the resource name.
  74351. //
  74352. // You can also sort results in descending order based on the creation
  74353. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74354. // based on the creationTimestamp field in reverse chronological order
  74355. // (newest result first). Use this to sort resources like operations so
  74356. // that the newest operation is returned first.
  74357. //
  74358. // Currently, only sorting by name or creationTimestamp desc is
  74359. // supported.
  74360. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  74361. c.urlParams_.Set("orderBy", orderBy)
  74362. return c
  74363. }
  74364. // PageToken sets the optional parameter "pageToken": Specifies a page
  74365. // token to use. Set pageToken to the nextPageToken returned by a
  74366. // previous list request to get the next page of results.
  74367. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  74368. c.urlParams_.Set("pageToken", pageToken)
  74369. return c
  74370. }
  74371. // Fields allows partial responses to be retrieved. See
  74372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74373. // for more information.
  74374. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  74375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74376. return c
  74377. }
  74378. // Context sets the context to be used in this call's Do method. Any
  74379. // pending HTTP request will be aborted if the provided context is
  74380. // canceled.
  74381. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  74382. c.ctx_ = ctx
  74383. return c
  74384. }
  74385. // Header returns an http.Header that can be modified by the caller to
  74386. // add HTTP headers to the request.
  74387. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  74388. if c.header_ == nil {
  74389. c.header_ = make(http.Header)
  74390. }
  74391. return c.header_
  74392. }
  74393. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  74394. reqHeaders := make(http.Header)
  74395. for k, v := range c.header_ {
  74396. reqHeaders[k] = v
  74397. }
  74398. reqHeaders.Set("User-Agent", c.s.userAgent())
  74399. var body io.Reader = nil
  74400. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  74401. if err != nil {
  74402. return nil, err
  74403. }
  74404. reqHeaders.Set("Content-Type", "application/json")
  74405. c.urlParams_.Set("alt", alt)
  74406. c.urlParams_.Set("prettyPrint", "false")
  74407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  74408. urls += "?" + c.urlParams_.Encode()
  74409. req, err := http.NewRequest("POST", urls, body)
  74410. if err != nil {
  74411. return nil, err
  74412. }
  74413. req.Header = reqHeaders
  74414. googleapi.Expand(req.URL, map[string]string{
  74415. "project": c.project,
  74416. "region": c.region,
  74417. "instanceGroup": c.instanceGroup,
  74418. })
  74419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74420. }
  74421. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  74422. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  74423. // non-nil. Any non-2xx status code is an error. Response headers are in
  74424. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  74425. // (if a response was returned at all) in
  74426. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  74427. // whether the returned error was because http.StatusNotModified was
  74428. // returned.
  74429. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  74430. gensupport.SetOptions(c.urlParams_, opts...)
  74431. res, err := c.doRequest("json")
  74432. if res != nil && res.StatusCode == http.StatusNotModified {
  74433. if res.Body != nil {
  74434. res.Body.Close()
  74435. }
  74436. return nil, &googleapi.Error{
  74437. Code: res.StatusCode,
  74438. Header: res.Header,
  74439. }
  74440. }
  74441. if err != nil {
  74442. return nil, err
  74443. }
  74444. defer googleapi.CloseBody(res)
  74445. if err := googleapi.CheckResponse(res); err != nil {
  74446. return nil, err
  74447. }
  74448. ret := &RegionInstanceGroupsListInstances{
  74449. ServerResponse: googleapi.ServerResponse{
  74450. Header: res.Header,
  74451. HTTPStatusCode: res.StatusCode,
  74452. },
  74453. }
  74454. target := &ret
  74455. if err := gensupport.DecodeResponse(target, res); err != nil {
  74456. return nil, err
  74457. }
  74458. return ret, nil
  74459. // {
  74460. // "description": "Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running.",
  74461. // "httpMethod": "POST",
  74462. // "id": "compute.regionInstanceGroups.listInstances",
  74463. // "parameterOrder": [
  74464. // "project",
  74465. // "region",
  74466. // "instanceGroup"
  74467. // ],
  74468. // "parameters": {
  74469. // "filter": {
  74470. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  74471. // "location": "query",
  74472. // "type": "string"
  74473. // },
  74474. // "instanceGroup": {
  74475. // "description": "Name of the regional instance group for which we want to list the instances.",
  74476. // "location": "path",
  74477. // "required": true,
  74478. // "type": "string"
  74479. // },
  74480. // "maxResults": {
  74481. // "default": "500",
  74482. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  74483. // "format": "uint32",
  74484. // "location": "query",
  74485. // "minimum": "0",
  74486. // "type": "integer"
  74487. // },
  74488. // "orderBy": {
  74489. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  74490. // "location": "query",
  74491. // "type": "string"
  74492. // },
  74493. // "pageToken": {
  74494. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  74495. // "location": "query",
  74496. // "type": "string"
  74497. // },
  74498. // "project": {
  74499. // "description": "Project ID for this request.",
  74500. // "location": "path",
  74501. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74502. // "required": true,
  74503. // "type": "string"
  74504. // },
  74505. // "region": {
  74506. // "description": "Name of the region scoping this request.",
  74507. // "location": "path",
  74508. // "required": true,
  74509. // "type": "string"
  74510. // }
  74511. // },
  74512. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  74513. // "request": {
  74514. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  74515. // },
  74516. // "response": {
  74517. // "$ref": "RegionInstanceGroupsListInstances"
  74518. // },
  74519. // "scopes": [
  74520. // "https://www.googleapis.com/auth/cloud-platform",
  74521. // "https://www.googleapis.com/auth/compute",
  74522. // "https://www.googleapis.com/auth/compute.readonly"
  74523. // ]
  74524. // }
  74525. }
  74526. // Pages invokes f for each page of results.
  74527. // A non-nil error returned from f will halt the iteration.
  74528. // The provided context supersedes any context provided to the Context method.
  74529. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  74530. c.ctx_ = ctx
  74531. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74532. for {
  74533. x, err := c.Do()
  74534. if err != nil {
  74535. return err
  74536. }
  74537. if err := f(x); err != nil {
  74538. return err
  74539. }
  74540. if x.NextPageToken == "" {
  74541. return nil
  74542. }
  74543. c.PageToken(x.NextPageToken)
  74544. }
  74545. }
  74546. // method id "compute.regionInstanceGroups.setNamedPorts":
  74547. type RegionInstanceGroupsSetNamedPortsCall struct {
  74548. s *Service
  74549. project string
  74550. region string
  74551. instanceGroup string
  74552. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  74553. urlParams_ gensupport.URLParams
  74554. ctx_ context.Context
  74555. header_ http.Header
  74556. }
  74557. // SetNamedPorts: Sets the named ports for the specified regional
  74558. // instance group.
  74559. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  74560. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74561. c.project = project
  74562. c.region = region
  74563. c.instanceGroup = instanceGroup
  74564. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  74565. return c
  74566. }
  74567. // RequestId sets the optional parameter "requestId": An optional
  74568. // request ID to identify requests. Specify a unique request ID so that
  74569. // if you must retry your request, the server will know to ignore the
  74570. // request if it has already been completed.
  74571. //
  74572. // For example, consider a situation where you make an initial request
  74573. // and the request times out. If you make the request again with the
  74574. // same request ID, the server can check if original operation with the
  74575. // same request ID was received, and if so, will ignore the second
  74576. // request. This prevents clients from accidentally creating duplicate
  74577. // commitments.
  74578. //
  74579. // The request ID must be a valid UUID with the exception that zero UUID
  74580. // is not supported (00000000-0000-0000-0000-000000000000).
  74581. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  74582. c.urlParams_.Set("requestId", requestId)
  74583. return c
  74584. }
  74585. // Fields allows partial responses to be retrieved. See
  74586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74587. // for more information.
  74588. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  74589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74590. return c
  74591. }
  74592. // Context sets the context to be used in this call's Do method. Any
  74593. // pending HTTP request will be aborted if the provided context is
  74594. // canceled.
  74595. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  74596. c.ctx_ = ctx
  74597. return c
  74598. }
  74599. // Header returns an http.Header that can be modified by the caller to
  74600. // add HTTP headers to the request.
  74601. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  74602. if c.header_ == nil {
  74603. c.header_ = make(http.Header)
  74604. }
  74605. return c.header_
  74606. }
  74607. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  74608. reqHeaders := make(http.Header)
  74609. for k, v := range c.header_ {
  74610. reqHeaders[k] = v
  74611. }
  74612. reqHeaders.Set("User-Agent", c.s.userAgent())
  74613. var body io.Reader = nil
  74614. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  74615. if err != nil {
  74616. return nil, err
  74617. }
  74618. reqHeaders.Set("Content-Type", "application/json")
  74619. c.urlParams_.Set("alt", alt)
  74620. c.urlParams_.Set("prettyPrint", "false")
  74621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  74622. urls += "?" + c.urlParams_.Encode()
  74623. req, err := http.NewRequest("POST", urls, body)
  74624. if err != nil {
  74625. return nil, err
  74626. }
  74627. req.Header = reqHeaders
  74628. googleapi.Expand(req.URL, map[string]string{
  74629. "project": c.project,
  74630. "region": c.region,
  74631. "instanceGroup": c.instanceGroup,
  74632. })
  74633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74634. }
  74635. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  74636. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74637. // status code is an error. Response headers are in either
  74638. // *Operation.ServerResponse.Header or (if a response was returned at
  74639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74640. // to check whether the returned error was because
  74641. // http.StatusNotModified was returned.
  74642. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74643. gensupport.SetOptions(c.urlParams_, opts...)
  74644. res, err := c.doRequest("json")
  74645. if res != nil && res.StatusCode == http.StatusNotModified {
  74646. if res.Body != nil {
  74647. res.Body.Close()
  74648. }
  74649. return nil, &googleapi.Error{
  74650. Code: res.StatusCode,
  74651. Header: res.Header,
  74652. }
  74653. }
  74654. if err != nil {
  74655. return nil, err
  74656. }
  74657. defer googleapi.CloseBody(res)
  74658. if err := googleapi.CheckResponse(res); err != nil {
  74659. return nil, err
  74660. }
  74661. ret := &Operation{
  74662. ServerResponse: googleapi.ServerResponse{
  74663. Header: res.Header,
  74664. HTTPStatusCode: res.StatusCode,
  74665. },
  74666. }
  74667. target := &ret
  74668. if err := gensupport.DecodeResponse(target, res); err != nil {
  74669. return nil, err
  74670. }
  74671. return ret, nil
  74672. // {
  74673. // "description": "Sets the named ports for the specified regional instance group.",
  74674. // "httpMethod": "POST",
  74675. // "id": "compute.regionInstanceGroups.setNamedPorts",
  74676. // "parameterOrder": [
  74677. // "project",
  74678. // "region",
  74679. // "instanceGroup"
  74680. // ],
  74681. // "parameters": {
  74682. // "instanceGroup": {
  74683. // "description": "The name of the regional instance group where the named ports are updated.",
  74684. // "location": "path",
  74685. // "required": true,
  74686. // "type": "string"
  74687. // },
  74688. // "project": {
  74689. // "description": "Project ID for this request.",
  74690. // "location": "path",
  74691. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74692. // "required": true,
  74693. // "type": "string"
  74694. // },
  74695. // "region": {
  74696. // "description": "Name of the region scoping this request.",
  74697. // "location": "path",
  74698. // "required": true,
  74699. // "type": "string"
  74700. // },
  74701. // "requestId": {
  74702. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74703. // "location": "query",
  74704. // "type": "string"
  74705. // }
  74706. // },
  74707. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  74708. // "request": {
  74709. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  74710. // },
  74711. // "response": {
  74712. // "$ref": "Operation"
  74713. // },
  74714. // "scopes": [
  74715. // "https://www.googleapis.com/auth/cloud-platform",
  74716. // "https://www.googleapis.com/auth/compute"
  74717. // ]
  74718. // }
  74719. }
  74720. // method id "compute.regionOperations.delete":
  74721. type RegionOperationsDeleteCall struct {
  74722. s *Service
  74723. project string
  74724. region string
  74725. operation string
  74726. urlParams_ gensupport.URLParams
  74727. ctx_ context.Context
  74728. header_ http.Header
  74729. }
  74730. // Delete: Deletes the specified region-specific Operations resource.
  74731. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  74732. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  74733. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74734. c.project = project
  74735. c.region = region
  74736. c.operation = operation
  74737. return c
  74738. }
  74739. // Fields allows partial responses to be retrieved. See
  74740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74741. // for more information.
  74742. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  74743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74744. return c
  74745. }
  74746. // Context sets the context to be used in this call's Do method. Any
  74747. // pending HTTP request will be aborted if the provided context is
  74748. // canceled.
  74749. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  74750. c.ctx_ = ctx
  74751. return c
  74752. }
  74753. // Header returns an http.Header that can be modified by the caller to
  74754. // add HTTP headers to the request.
  74755. func (c *RegionOperationsDeleteCall) Header() http.Header {
  74756. if c.header_ == nil {
  74757. c.header_ = make(http.Header)
  74758. }
  74759. return c.header_
  74760. }
  74761. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  74762. reqHeaders := make(http.Header)
  74763. for k, v := range c.header_ {
  74764. reqHeaders[k] = v
  74765. }
  74766. reqHeaders.Set("User-Agent", c.s.userAgent())
  74767. var body io.Reader = nil
  74768. c.urlParams_.Set("alt", alt)
  74769. c.urlParams_.Set("prettyPrint", "false")
  74770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  74771. urls += "?" + c.urlParams_.Encode()
  74772. req, err := http.NewRequest("DELETE", urls, body)
  74773. if err != nil {
  74774. return nil, err
  74775. }
  74776. req.Header = reqHeaders
  74777. googleapi.Expand(req.URL, map[string]string{
  74778. "project": c.project,
  74779. "region": c.region,
  74780. "operation": c.operation,
  74781. })
  74782. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74783. }
  74784. // Do executes the "compute.regionOperations.delete" call.
  74785. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  74786. gensupport.SetOptions(c.urlParams_, opts...)
  74787. res, err := c.doRequest("json")
  74788. if err != nil {
  74789. return err
  74790. }
  74791. defer googleapi.CloseBody(res)
  74792. if err := googleapi.CheckResponse(res); err != nil {
  74793. return err
  74794. }
  74795. return nil
  74796. // {
  74797. // "description": "Deletes the specified region-specific Operations resource.",
  74798. // "httpMethod": "DELETE",
  74799. // "id": "compute.regionOperations.delete",
  74800. // "parameterOrder": [
  74801. // "project",
  74802. // "region",
  74803. // "operation"
  74804. // ],
  74805. // "parameters": {
  74806. // "operation": {
  74807. // "description": "Name of the Operations resource to delete.",
  74808. // "location": "path",
  74809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74810. // "required": true,
  74811. // "type": "string"
  74812. // },
  74813. // "project": {
  74814. // "description": "Project ID for this request.",
  74815. // "location": "path",
  74816. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74817. // "required": true,
  74818. // "type": "string"
  74819. // },
  74820. // "region": {
  74821. // "description": "Name of the region for this request.",
  74822. // "location": "path",
  74823. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74824. // "required": true,
  74825. // "type": "string"
  74826. // }
  74827. // },
  74828. // "path": "{project}/regions/{region}/operations/{operation}",
  74829. // "scopes": [
  74830. // "https://www.googleapis.com/auth/cloud-platform",
  74831. // "https://www.googleapis.com/auth/compute"
  74832. // ]
  74833. // }
  74834. }
  74835. // method id "compute.regionOperations.get":
  74836. type RegionOperationsGetCall struct {
  74837. s *Service
  74838. project string
  74839. region string
  74840. operation string
  74841. urlParams_ gensupport.URLParams
  74842. ifNoneMatch_ string
  74843. ctx_ context.Context
  74844. header_ http.Header
  74845. }
  74846. // Get: Retrieves the specified region-specific Operations resource.
  74847. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  74848. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  74849. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74850. c.project = project
  74851. c.region = region
  74852. c.operation = operation
  74853. return c
  74854. }
  74855. // Fields allows partial responses to be retrieved. See
  74856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74857. // for more information.
  74858. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  74859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74860. return c
  74861. }
  74862. // IfNoneMatch sets the optional parameter which makes the operation
  74863. // fail if the object's ETag matches the given value. This is useful for
  74864. // getting updates only after the object has changed since the last
  74865. // request. Use googleapi.IsNotModified to check whether the response
  74866. // error from Do is the result of In-None-Match.
  74867. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  74868. c.ifNoneMatch_ = entityTag
  74869. return c
  74870. }
  74871. // Context sets the context to be used in this call's Do method. Any
  74872. // pending HTTP request will be aborted if the provided context is
  74873. // canceled.
  74874. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  74875. c.ctx_ = ctx
  74876. return c
  74877. }
  74878. // Header returns an http.Header that can be modified by the caller to
  74879. // add HTTP headers to the request.
  74880. func (c *RegionOperationsGetCall) Header() http.Header {
  74881. if c.header_ == nil {
  74882. c.header_ = make(http.Header)
  74883. }
  74884. return c.header_
  74885. }
  74886. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  74887. reqHeaders := make(http.Header)
  74888. for k, v := range c.header_ {
  74889. reqHeaders[k] = v
  74890. }
  74891. reqHeaders.Set("User-Agent", c.s.userAgent())
  74892. if c.ifNoneMatch_ != "" {
  74893. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74894. }
  74895. var body io.Reader = nil
  74896. c.urlParams_.Set("alt", alt)
  74897. c.urlParams_.Set("prettyPrint", "false")
  74898. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  74899. urls += "?" + c.urlParams_.Encode()
  74900. req, err := http.NewRequest("GET", urls, body)
  74901. if err != nil {
  74902. return nil, err
  74903. }
  74904. req.Header = reqHeaders
  74905. googleapi.Expand(req.URL, map[string]string{
  74906. "project": c.project,
  74907. "region": c.region,
  74908. "operation": c.operation,
  74909. })
  74910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74911. }
  74912. // Do executes the "compute.regionOperations.get" call.
  74913. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74914. // status code is an error. Response headers are in either
  74915. // *Operation.ServerResponse.Header or (if a response was returned at
  74916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74917. // to check whether the returned error was because
  74918. // http.StatusNotModified was returned.
  74919. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74920. gensupport.SetOptions(c.urlParams_, opts...)
  74921. res, err := c.doRequest("json")
  74922. if res != nil && res.StatusCode == http.StatusNotModified {
  74923. if res.Body != nil {
  74924. res.Body.Close()
  74925. }
  74926. return nil, &googleapi.Error{
  74927. Code: res.StatusCode,
  74928. Header: res.Header,
  74929. }
  74930. }
  74931. if err != nil {
  74932. return nil, err
  74933. }
  74934. defer googleapi.CloseBody(res)
  74935. if err := googleapi.CheckResponse(res); err != nil {
  74936. return nil, err
  74937. }
  74938. ret := &Operation{
  74939. ServerResponse: googleapi.ServerResponse{
  74940. Header: res.Header,
  74941. HTTPStatusCode: res.StatusCode,
  74942. },
  74943. }
  74944. target := &ret
  74945. if err := gensupport.DecodeResponse(target, res); err != nil {
  74946. return nil, err
  74947. }
  74948. return ret, nil
  74949. // {
  74950. // "description": "Retrieves the specified region-specific Operations resource.",
  74951. // "httpMethod": "GET",
  74952. // "id": "compute.regionOperations.get",
  74953. // "parameterOrder": [
  74954. // "project",
  74955. // "region",
  74956. // "operation"
  74957. // ],
  74958. // "parameters": {
  74959. // "operation": {
  74960. // "description": "Name of the Operations resource to return.",
  74961. // "location": "path",
  74962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74963. // "required": true,
  74964. // "type": "string"
  74965. // },
  74966. // "project": {
  74967. // "description": "Project ID for this request.",
  74968. // "location": "path",
  74969. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74970. // "required": true,
  74971. // "type": "string"
  74972. // },
  74973. // "region": {
  74974. // "description": "Name of the region for this request.",
  74975. // "location": "path",
  74976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74977. // "required": true,
  74978. // "type": "string"
  74979. // }
  74980. // },
  74981. // "path": "{project}/regions/{region}/operations/{operation}",
  74982. // "response": {
  74983. // "$ref": "Operation"
  74984. // },
  74985. // "scopes": [
  74986. // "https://www.googleapis.com/auth/cloud-platform",
  74987. // "https://www.googleapis.com/auth/compute",
  74988. // "https://www.googleapis.com/auth/compute.readonly"
  74989. // ]
  74990. // }
  74991. }
  74992. // method id "compute.regionOperations.list":
  74993. type RegionOperationsListCall struct {
  74994. s *Service
  74995. project string
  74996. region string
  74997. urlParams_ gensupport.URLParams
  74998. ifNoneMatch_ string
  74999. ctx_ context.Context
  75000. header_ http.Header
  75001. }
  75002. // List: Retrieves a list of Operation resources contained within the
  75003. // specified region.
  75004. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  75005. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  75006. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75007. c.project = project
  75008. c.region = region
  75009. return c
  75010. }
  75011. // Filter sets the optional parameter "filter": A filter expression that
  75012. // filters resources listed in the response. The expression must specify
  75013. // the field name, a comparison operator, and the value that you want to
  75014. // use for filtering. The value must be a string, a number, or a
  75015. // boolean. The comparison operator must be either =, !=, >, or <.
  75016. //
  75017. // For example, if you are filtering Compute Engine instances, you can
  75018. // exclude instances named example-instance by specifying name !=
  75019. // example-instance.
  75020. //
  75021. // You can also filter nested fields. For example, you could specify
  75022. // scheduling.automaticRestart = false to include instances only if they
  75023. // are not scheduled for automatic restarts. You can use filtering on
  75024. // nested fields to filter based on resource labels.
  75025. //
  75026. // To filter on multiple expressions, provide each separate expression
  75027. // within parentheses. For example, (scheduling.automaticRestart = true)
  75028. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75029. // AND expression. However, you can include AND and OR expressions
  75030. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75031. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75032. // true).
  75033. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  75034. c.urlParams_.Set("filter", filter)
  75035. return c
  75036. }
  75037. // MaxResults sets the optional parameter "maxResults": The maximum
  75038. // number of results per page that should be returned. If the number of
  75039. // available results is larger than maxResults, Compute Engine returns a
  75040. // nextPageToken that can be used to get the next page of results in
  75041. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75042. // (Default: 500)
  75043. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  75044. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75045. return c
  75046. }
  75047. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75048. // a certain order. By default, results are returned in alphanumerical
  75049. // order based on the resource name.
  75050. //
  75051. // You can also sort results in descending order based on the creation
  75052. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75053. // based on the creationTimestamp field in reverse chronological order
  75054. // (newest result first). Use this to sort resources like operations so
  75055. // that the newest operation is returned first.
  75056. //
  75057. // Currently, only sorting by name or creationTimestamp desc is
  75058. // supported.
  75059. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  75060. c.urlParams_.Set("orderBy", orderBy)
  75061. return c
  75062. }
  75063. // PageToken sets the optional parameter "pageToken": Specifies a page
  75064. // token to use. Set pageToken to the nextPageToken returned by a
  75065. // previous list request to get the next page of results.
  75066. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  75067. c.urlParams_.Set("pageToken", pageToken)
  75068. return c
  75069. }
  75070. // Fields allows partial responses to be retrieved. See
  75071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75072. // for more information.
  75073. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  75074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75075. return c
  75076. }
  75077. // IfNoneMatch sets the optional parameter which makes the operation
  75078. // fail if the object's ETag matches the given value. This is useful for
  75079. // getting updates only after the object has changed since the last
  75080. // request. Use googleapi.IsNotModified to check whether the response
  75081. // error from Do is the result of In-None-Match.
  75082. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  75083. c.ifNoneMatch_ = entityTag
  75084. return c
  75085. }
  75086. // Context sets the context to be used in this call's Do method. Any
  75087. // pending HTTP request will be aborted if the provided context is
  75088. // canceled.
  75089. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  75090. c.ctx_ = ctx
  75091. return c
  75092. }
  75093. // Header returns an http.Header that can be modified by the caller to
  75094. // add HTTP headers to the request.
  75095. func (c *RegionOperationsListCall) Header() http.Header {
  75096. if c.header_ == nil {
  75097. c.header_ = make(http.Header)
  75098. }
  75099. return c.header_
  75100. }
  75101. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  75102. reqHeaders := make(http.Header)
  75103. for k, v := range c.header_ {
  75104. reqHeaders[k] = v
  75105. }
  75106. reqHeaders.Set("User-Agent", c.s.userAgent())
  75107. if c.ifNoneMatch_ != "" {
  75108. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75109. }
  75110. var body io.Reader = nil
  75111. c.urlParams_.Set("alt", alt)
  75112. c.urlParams_.Set("prettyPrint", "false")
  75113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  75114. urls += "?" + c.urlParams_.Encode()
  75115. req, err := http.NewRequest("GET", urls, body)
  75116. if err != nil {
  75117. return nil, err
  75118. }
  75119. req.Header = reqHeaders
  75120. googleapi.Expand(req.URL, map[string]string{
  75121. "project": c.project,
  75122. "region": c.region,
  75123. })
  75124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75125. }
  75126. // Do executes the "compute.regionOperations.list" call.
  75127. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  75128. // status code is an error. Response headers are in either
  75129. // *OperationList.ServerResponse.Header or (if a response was returned
  75130. // at all) in error.(*googleapi.Error).Header. Use
  75131. // googleapi.IsNotModified to check whether the returned error was
  75132. // because http.StatusNotModified was returned.
  75133. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  75134. gensupport.SetOptions(c.urlParams_, opts...)
  75135. res, err := c.doRequest("json")
  75136. if res != nil && res.StatusCode == http.StatusNotModified {
  75137. if res.Body != nil {
  75138. res.Body.Close()
  75139. }
  75140. return nil, &googleapi.Error{
  75141. Code: res.StatusCode,
  75142. Header: res.Header,
  75143. }
  75144. }
  75145. if err != nil {
  75146. return nil, err
  75147. }
  75148. defer googleapi.CloseBody(res)
  75149. if err := googleapi.CheckResponse(res); err != nil {
  75150. return nil, err
  75151. }
  75152. ret := &OperationList{
  75153. ServerResponse: googleapi.ServerResponse{
  75154. Header: res.Header,
  75155. HTTPStatusCode: res.StatusCode,
  75156. },
  75157. }
  75158. target := &ret
  75159. if err := gensupport.DecodeResponse(target, res); err != nil {
  75160. return nil, err
  75161. }
  75162. return ret, nil
  75163. // {
  75164. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  75165. // "httpMethod": "GET",
  75166. // "id": "compute.regionOperations.list",
  75167. // "parameterOrder": [
  75168. // "project",
  75169. // "region"
  75170. // ],
  75171. // "parameters": {
  75172. // "filter": {
  75173. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  75174. // "location": "query",
  75175. // "type": "string"
  75176. // },
  75177. // "maxResults": {
  75178. // "default": "500",
  75179. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  75180. // "format": "uint32",
  75181. // "location": "query",
  75182. // "minimum": "0",
  75183. // "type": "integer"
  75184. // },
  75185. // "orderBy": {
  75186. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  75187. // "location": "query",
  75188. // "type": "string"
  75189. // },
  75190. // "pageToken": {
  75191. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  75192. // "location": "query",
  75193. // "type": "string"
  75194. // },
  75195. // "project": {
  75196. // "description": "Project ID for this request.",
  75197. // "location": "path",
  75198. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75199. // "required": true,
  75200. // "type": "string"
  75201. // },
  75202. // "region": {
  75203. // "description": "Name of the region for this request.",
  75204. // "location": "path",
  75205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75206. // "required": true,
  75207. // "type": "string"
  75208. // }
  75209. // },
  75210. // "path": "{project}/regions/{region}/operations",
  75211. // "response": {
  75212. // "$ref": "OperationList"
  75213. // },
  75214. // "scopes": [
  75215. // "https://www.googleapis.com/auth/cloud-platform",
  75216. // "https://www.googleapis.com/auth/compute",
  75217. // "https://www.googleapis.com/auth/compute.readonly"
  75218. // ]
  75219. // }
  75220. }
  75221. // Pages invokes f for each page of results.
  75222. // A non-nil error returned from f will halt the iteration.
  75223. // The provided context supersedes any context provided to the Context method.
  75224. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  75225. c.ctx_ = ctx
  75226. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75227. for {
  75228. x, err := c.Do()
  75229. if err != nil {
  75230. return err
  75231. }
  75232. if err := f(x); err != nil {
  75233. return err
  75234. }
  75235. if x.NextPageToken == "" {
  75236. return nil
  75237. }
  75238. c.PageToken(x.NextPageToken)
  75239. }
  75240. }
  75241. // method id "compute.regions.get":
  75242. type RegionsGetCall struct {
  75243. s *Service
  75244. project string
  75245. region string
  75246. urlParams_ gensupport.URLParams
  75247. ifNoneMatch_ string
  75248. ctx_ context.Context
  75249. header_ http.Header
  75250. }
  75251. // Get: Returns the specified Region resource. Gets a list of available
  75252. // regions by making a list() request.
  75253. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  75254. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  75255. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75256. c.project = project
  75257. c.region = region
  75258. return c
  75259. }
  75260. // Fields allows partial responses to be retrieved. See
  75261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75262. // for more information.
  75263. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  75264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75265. return c
  75266. }
  75267. // IfNoneMatch sets the optional parameter which makes the operation
  75268. // fail if the object's ETag matches the given value. This is useful for
  75269. // getting updates only after the object has changed since the last
  75270. // request. Use googleapi.IsNotModified to check whether the response
  75271. // error from Do is the result of In-None-Match.
  75272. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  75273. c.ifNoneMatch_ = entityTag
  75274. return c
  75275. }
  75276. // Context sets the context to be used in this call's Do method. Any
  75277. // pending HTTP request will be aborted if the provided context is
  75278. // canceled.
  75279. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  75280. c.ctx_ = ctx
  75281. return c
  75282. }
  75283. // Header returns an http.Header that can be modified by the caller to
  75284. // add HTTP headers to the request.
  75285. func (c *RegionsGetCall) Header() http.Header {
  75286. if c.header_ == nil {
  75287. c.header_ = make(http.Header)
  75288. }
  75289. return c.header_
  75290. }
  75291. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  75292. reqHeaders := make(http.Header)
  75293. for k, v := range c.header_ {
  75294. reqHeaders[k] = v
  75295. }
  75296. reqHeaders.Set("User-Agent", c.s.userAgent())
  75297. if c.ifNoneMatch_ != "" {
  75298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75299. }
  75300. var body io.Reader = nil
  75301. c.urlParams_.Set("alt", alt)
  75302. c.urlParams_.Set("prettyPrint", "false")
  75303. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  75304. urls += "?" + c.urlParams_.Encode()
  75305. req, err := http.NewRequest("GET", urls, body)
  75306. if err != nil {
  75307. return nil, err
  75308. }
  75309. req.Header = reqHeaders
  75310. googleapi.Expand(req.URL, map[string]string{
  75311. "project": c.project,
  75312. "region": c.region,
  75313. })
  75314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75315. }
  75316. // Do executes the "compute.regions.get" call.
  75317. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  75318. // code is an error. Response headers are in either
  75319. // *Region.ServerResponse.Header or (if a response was returned at all)
  75320. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  75321. // check whether the returned error was because http.StatusNotModified
  75322. // was returned.
  75323. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  75324. gensupport.SetOptions(c.urlParams_, opts...)
  75325. res, err := c.doRequest("json")
  75326. if res != nil && res.StatusCode == http.StatusNotModified {
  75327. if res.Body != nil {
  75328. res.Body.Close()
  75329. }
  75330. return nil, &googleapi.Error{
  75331. Code: res.StatusCode,
  75332. Header: res.Header,
  75333. }
  75334. }
  75335. if err != nil {
  75336. return nil, err
  75337. }
  75338. defer googleapi.CloseBody(res)
  75339. if err := googleapi.CheckResponse(res); err != nil {
  75340. return nil, err
  75341. }
  75342. ret := &Region{
  75343. ServerResponse: googleapi.ServerResponse{
  75344. Header: res.Header,
  75345. HTTPStatusCode: res.StatusCode,
  75346. },
  75347. }
  75348. target := &ret
  75349. if err := gensupport.DecodeResponse(target, res); err != nil {
  75350. return nil, err
  75351. }
  75352. return ret, nil
  75353. // {
  75354. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  75355. // "httpMethod": "GET",
  75356. // "id": "compute.regions.get",
  75357. // "parameterOrder": [
  75358. // "project",
  75359. // "region"
  75360. // ],
  75361. // "parameters": {
  75362. // "project": {
  75363. // "description": "Project ID for this request.",
  75364. // "location": "path",
  75365. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75366. // "required": true,
  75367. // "type": "string"
  75368. // },
  75369. // "region": {
  75370. // "description": "Name of the region resource to return.",
  75371. // "location": "path",
  75372. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75373. // "required": true,
  75374. // "type": "string"
  75375. // }
  75376. // },
  75377. // "path": "{project}/regions/{region}",
  75378. // "response": {
  75379. // "$ref": "Region"
  75380. // },
  75381. // "scopes": [
  75382. // "https://www.googleapis.com/auth/cloud-platform",
  75383. // "https://www.googleapis.com/auth/compute",
  75384. // "https://www.googleapis.com/auth/compute.readonly"
  75385. // ]
  75386. // }
  75387. }
  75388. // method id "compute.regions.list":
  75389. type RegionsListCall struct {
  75390. s *Service
  75391. project string
  75392. urlParams_ gensupport.URLParams
  75393. ifNoneMatch_ string
  75394. ctx_ context.Context
  75395. header_ http.Header
  75396. }
  75397. // List: Retrieves the list of region resources available to the
  75398. // specified project.
  75399. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  75400. func (r *RegionsService) List(project string) *RegionsListCall {
  75401. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75402. c.project = project
  75403. return c
  75404. }
  75405. // Filter sets the optional parameter "filter": A filter expression that
  75406. // filters resources listed in the response. The expression must specify
  75407. // the field name, a comparison operator, and the value that you want to
  75408. // use for filtering. The value must be a string, a number, or a
  75409. // boolean. The comparison operator must be either =, !=, >, or <.
  75410. //
  75411. // For example, if you are filtering Compute Engine instances, you can
  75412. // exclude instances named example-instance by specifying name !=
  75413. // example-instance.
  75414. //
  75415. // You can also filter nested fields. For example, you could specify
  75416. // scheduling.automaticRestart = false to include instances only if they
  75417. // are not scheduled for automatic restarts. You can use filtering on
  75418. // nested fields to filter based on resource labels.
  75419. //
  75420. // To filter on multiple expressions, provide each separate expression
  75421. // within parentheses. For example, (scheduling.automaticRestart = true)
  75422. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75423. // AND expression. However, you can include AND and OR expressions
  75424. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75425. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75426. // true).
  75427. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  75428. c.urlParams_.Set("filter", filter)
  75429. return c
  75430. }
  75431. // MaxResults sets the optional parameter "maxResults": The maximum
  75432. // number of results per page that should be returned. If the number of
  75433. // available results is larger than maxResults, Compute Engine returns a
  75434. // nextPageToken that can be used to get the next page of results in
  75435. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75436. // (Default: 500)
  75437. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  75438. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75439. return c
  75440. }
  75441. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75442. // a certain order. By default, results are returned in alphanumerical
  75443. // order based on the resource name.
  75444. //
  75445. // You can also sort results in descending order based on the creation
  75446. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75447. // based on the creationTimestamp field in reverse chronological order
  75448. // (newest result first). Use this to sort resources like operations so
  75449. // that the newest operation is returned first.
  75450. //
  75451. // Currently, only sorting by name or creationTimestamp desc is
  75452. // supported.
  75453. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  75454. c.urlParams_.Set("orderBy", orderBy)
  75455. return c
  75456. }
  75457. // PageToken sets the optional parameter "pageToken": Specifies a page
  75458. // token to use. Set pageToken to the nextPageToken returned by a
  75459. // previous list request to get the next page of results.
  75460. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  75461. c.urlParams_.Set("pageToken", pageToken)
  75462. return c
  75463. }
  75464. // Fields allows partial responses to be retrieved. See
  75465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75466. // for more information.
  75467. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  75468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75469. return c
  75470. }
  75471. // IfNoneMatch sets the optional parameter which makes the operation
  75472. // fail if the object's ETag matches the given value. This is useful for
  75473. // getting updates only after the object has changed since the last
  75474. // request. Use googleapi.IsNotModified to check whether the response
  75475. // error from Do is the result of In-None-Match.
  75476. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  75477. c.ifNoneMatch_ = entityTag
  75478. return c
  75479. }
  75480. // Context sets the context to be used in this call's Do method. Any
  75481. // pending HTTP request will be aborted if the provided context is
  75482. // canceled.
  75483. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  75484. c.ctx_ = ctx
  75485. return c
  75486. }
  75487. // Header returns an http.Header that can be modified by the caller to
  75488. // add HTTP headers to the request.
  75489. func (c *RegionsListCall) Header() http.Header {
  75490. if c.header_ == nil {
  75491. c.header_ = make(http.Header)
  75492. }
  75493. return c.header_
  75494. }
  75495. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  75496. reqHeaders := make(http.Header)
  75497. for k, v := range c.header_ {
  75498. reqHeaders[k] = v
  75499. }
  75500. reqHeaders.Set("User-Agent", c.s.userAgent())
  75501. if c.ifNoneMatch_ != "" {
  75502. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75503. }
  75504. var body io.Reader = nil
  75505. c.urlParams_.Set("alt", alt)
  75506. c.urlParams_.Set("prettyPrint", "false")
  75507. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  75508. urls += "?" + c.urlParams_.Encode()
  75509. req, err := http.NewRequest("GET", urls, body)
  75510. if err != nil {
  75511. return nil, err
  75512. }
  75513. req.Header = reqHeaders
  75514. googleapi.Expand(req.URL, map[string]string{
  75515. "project": c.project,
  75516. })
  75517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75518. }
  75519. // Do executes the "compute.regions.list" call.
  75520. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  75521. // status code is an error. Response headers are in either
  75522. // *RegionList.ServerResponse.Header or (if a response was returned at
  75523. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75524. // to check whether the returned error was because
  75525. // http.StatusNotModified was returned.
  75526. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  75527. gensupport.SetOptions(c.urlParams_, opts...)
  75528. res, err := c.doRequest("json")
  75529. if res != nil && res.StatusCode == http.StatusNotModified {
  75530. if res.Body != nil {
  75531. res.Body.Close()
  75532. }
  75533. return nil, &googleapi.Error{
  75534. Code: res.StatusCode,
  75535. Header: res.Header,
  75536. }
  75537. }
  75538. if err != nil {
  75539. return nil, err
  75540. }
  75541. defer googleapi.CloseBody(res)
  75542. if err := googleapi.CheckResponse(res); err != nil {
  75543. return nil, err
  75544. }
  75545. ret := &RegionList{
  75546. ServerResponse: googleapi.ServerResponse{
  75547. Header: res.Header,
  75548. HTTPStatusCode: res.StatusCode,
  75549. },
  75550. }
  75551. target := &ret
  75552. if err := gensupport.DecodeResponse(target, res); err != nil {
  75553. return nil, err
  75554. }
  75555. return ret, nil
  75556. // {
  75557. // "description": "Retrieves the list of region resources available to the specified project.",
  75558. // "httpMethod": "GET",
  75559. // "id": "compute.regions.list",
  75560. // "parameterOrder": [
  75561. // "project"
  75562. // ],
  75563. // "parameters": {
  75564. // "filter": {
  75565. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  75566. // "location": "query",
  75567. // "type": "string"
  75568. // },
  75569. // "maxResults": {
  75570. // "default": "500",
  75571. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  75572. // "format": "uint32",
  75573. // "location": "query",
  75574. // "minimum": "0",
  75575. // "type": "integer"
  75576. // },
  75577. // "orderBy": {
  75578. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  75579. // "location": "query",
  75580. // "type": "string"
  75581. // },
  75582. // "pageToken": {
  75583. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  75584. // "location": "query",
  75585. // "type": "string"
  75586. // },
  75587. // "project": {
  75588. // "description": "Project ID for this request.",
  75589. // "location": "path",
  75590. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75591. // "required": true,
  75592. // "type": "string"
  75593. // }
  75594. // },
  75595. // "path": "{project}/regions",
  75596. // "response": {
  75597. // "$ref": "RegionList"
  75598. // },
  75599. // "scopes": [
  75600. // "https://www.googleapis.com/auth/cloud-platform",
  75601. // "https://www.googleapis.com/auth/compute",
  75602. // "https://www.googleapis.com/auth/compute.readonly"
  75603. // ]
  75604. // }
  75605. }
  75606. // Pages invokes f for each page of results.
  75607. // A non-nil error returned from f will halt the iteration.
  75608. // The provided context supersedes any context provided to the Context method.
  75609. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  75610. c.ctx_ = ctx
  75611. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75612. for {
  75613. x, err := c.Do()
  75614. if err != nil {
  75615. return err
  75616. }
  75617. if err := f(x); err != nil {
  75618. return err
  75619. }
  75620. if x.NextPageToken == "" {
  75621. return nil
  75622. }
  75623. c.PageToken(x.NextPageToken)
  75624. }
  75625. }
  75626. // method id "compute.routers.aggregatedList":
  75627. type RoutersAggregatedListCall struct {
  75628. s *Service
  75629. project string
  75630. urlParams_ gensupport.URLParams
  75631. ifNoneMatch_ string
  75632. ctx_ context.Context
  75633. header_ http.Header
  75634. }
  75635. // AggregatedList: Retrieves an aggregated list of routers.
  75636. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  75637. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75638. c.project = project
  75639. return c
  75640. }
  75641. // Filter sets the optional parameter "filter": A filter expression that
  75642. // filters resources listed in the response. The expression must specify
  75643. // the field name, a comparison operator, and the value that you want to
  75644. // use for filtering. The value must be a string, a number, or a
  75645. // boolean. The comparison operator must be either =, !=, >, or <.
  75646. //
  75647. // For example, if you are filtering Compute Engine instances, you can
  75648. // exclude instances named example-instance by specifying name !=
  75649. // example-instance.
  75650. //
  75651. // You can also filter nested fields. For example, you could specify
  75652. // scheduling.automaticRestart = false to include instances only if they
  75653. // are not scheduled for automatic restarts. You can use filtering on
  75654. // nested fields to filter based on resource labels.
  75655. //
  75656. // To filter on multiple expressions, provide each separate expression
  75657. // within parentheses. For example, (scheduling.automaticRestart = true)
  75658. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75659. // AND expression. However, you can include AND and OR expressions
  75660. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75661. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75662. // true).
  75663. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  75664. c.urlParams_.Set("filter", filter)
  75665. return c
  75666. }
  75667. // MaxResults sets the optional parameter "maxResults": The maximum
  75668. // number of results per page that should be returned. If the number of
  75669. // available results is larger than maxResults, Compute Engine returns a
  75670. // nextPageToken that can be used to get the next page of results in
  75671. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75672. // (Default: 500)
  75673. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  75674. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75675. return c
  75676. }
  75677. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75678. // a certain order. By default, results are returned in alphanumerical
  75679. // order based on the resource name.
  75680. //
  75681. // You can also sort results in descending order based on the creation
  75682. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75683. // based on the creationTimestamp field in reverse chronological order
  75684. // (newest result first). Use this to sort resources like operations so
  75685. // that the newest operation is returned first.
  75686. //
  75687. // Currently, only sorting by name or creationTimestamp desc is
  75688. // supported.
  75689. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  75690. c.urlParams_.Set("orderBy", orderBy)
  75691. return c
  75692. }
  75693. // PageToken sets the optional parameter "pageToken": Specifies a page
  75694. // token to use. Set pageToken to the nextPageToken returned by a
  75695. // previous list request to get the next page of results.
  75696. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  75697. c.urlParams_.Set("pageToken", pageToken)
  75698. return c
  75699. }
  75700. // Fields allows partial responses to be retrieved. See
  75701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75702. // for more information.
  75703. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  75704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75705. return c
  75706. }
  75707. // IfNoneMatch sets the optional parameter which makes the operation
  75708. // fail if the object's ETag matches the given value. This is useful for
  75709. // getting updates only after the object has changed since the last
  75710. // request. Use googleapi.IsNotModified to check whether the response
  75711. // error from Do is the result of In-None-Match.
  75712. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  75713. c.ifNoneMatch_ = entityTag
  75714. return c
  75715. }
  75716. // Context sets the context to be used in this call's Do method. Any
  75717. // pending HTTP request will be aborted if the provided context is
  75718. // canceled.
  75719. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  75720. c.ctx_ = ctx
  75721. return c
  75722. }
  75723. // Header returns an http.Header that can be modified by the caller to
  75724. // add HTTP headers to the request.
  75725. func (c *RoutersAggregatedListCall) Header() http.Header {
  75726. if c.header_ == nil {
  75727. c.header_ = make(http.Header)
  75728. }
  75729. return c.header_
  75730. }
  75731. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  75732. reqHeaders := make(http.Header)
  75733. for k, v := range c.header_ {
  75734. reqHeaders[k] = v
  75735. }
  75736. reqHeaders.Set("User-Agent", c.s.userAgent())
  75737. if c.ifNoneMatch_ != "" {
  75738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75739. }
  75740. var body io.Reader = nil
  75741. c.urlParams_.Set("alt", alt)
  75742. c.urlParams_.Set("prettyPrint", "false")
  75743. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  75744. urls += "?" + c.urlParams_.Encode()
  75745. req, err := http.NewRequest("GET", urls, body)
  75746. if err != nil {
  75747. return nil, err
  75748. }
  75749. req.Header = reqHeaders
  75750. googleapi.Expand(req.URL, map[string]string{
  75751. "project": c.project,
  75752. })
  75753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75754. }
  75755. // Do executes the "compute.routers.aggregatedList" call.
  75756. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  75757. // non-2xx status code is an error. Response headers are in either
  75758. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  75759. // returned at all) in error.(*googleapi.Error).Header. Use
  75760. // googleapi.IsNotModified to check whether the returned error was
  75761. // because http.StatusNotModified was returned.
  75762. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  75763. gensupport.SetOptions(c.urlParams_, opts...)
  75764. res, err := c.doRequest("json")
  75765. if res != nil && res.StatusCode == http.StatusNotModified {
  75766. if res.Body != nil {
  75767. res.Body.Close()
  75768. }
  75769. return nil, &googleapi.Error{
  75770. Code: res.StatusCode,
  75771. Header: res.Header,
  75772. }
  75773. }
  75774. if err != nil {
  75775. return nil, err
  75776. }
  75777. defer googleapi.CloseBody(res)
  75778. if err := googleapi.CheckResponse(res); err != nil {
  75779. return nil, err
  75780. }
  75781. ret := &RouterAggregatedList{
  75782. ServerResponse: googleapi.ServerResponse{
  75783. Header: res.Header,
  75784. HTTPStatusCode: res.StatusCode,
  75785. },
  75786. }
  75787. target := &ret
  75788. if err := gensupport.DecodeResponse(target, res); err != nil {
  75789. return nil, err
  75790. }
  75791. return ret, nil
  75792. // {
  75793. // "description": "Retrieves an aggregated list of routers.",
  75794. // "httpMethod": "GET",
  75795. // "id": "compute.routers.aggregatedList",
  75796. // "parameterOrder": [
  75797. // "project"
  75798. // ],
  75799. // "parameters": {
  75800. // "filter": {
  75801. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  75802. // "location": "query",
  75803. // "type": "string"
  75804. // },
  75805. // "maxResults": {
  75806. // "default": "500",
  75807. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  75808. // "format": "uint32",
  75809. // "location": "query",
  75810. // "minimum": "0",
  75811. // "type": "integer"
  75812. // },
  75813. // "orderBy": {
  75814. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  75815. // "location": "query",
  75816. // "type": "string"
  75817. // },
  75818. // "pageToken": {
  75819. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  75820. // "location": "query",
  75821. // "type": "string"
  75822. // },
  75823. // "project": {
  75824. // "description": "Project ID for this request.",
  75825. // "location": "path",
  75826. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75827. // "required": true,
  75828. // "type": "string"
  75829. // }
  75830. // },
  75831. // "path": "{project}/aggregated/routers",
  75832. // "response": {
  75833. // "$ref": "RouterAggregatedList"
  75834. // },
  75835. // "scopes": [
  75836. // "https://www.googleapis.com/auth/cloud-platform",
  75837. // "https://www.googleapis.com/auth/compute",
  75838. // "https://www.googleapis.com/auth/compute.readonly"
  75839. // ]
  75840. // }
  75841. }
  75842. // Pages invokes f for each page of results.
  75843. // A non-nil error returned from f will halt the iteration.
  75844. // The provided context supersedes any context provided to the Context method.
  75845. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  75846. c.ctx_ = ctx
  75847. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75848. for {
  75849. x, err := c.Do()
  75850. if err != nil {
  75851. return err
  75852. }
  75853. if err := f(x); err != nil {
  75854. return err
  75855. }
  75856. if x.NextPageToken == "" {
  75857. return nil
  75858. }
  75859. c.PageToken(x.NextPageToken)
  75860. }
  75861. }
  75862. // method id "compute.routers.delete":
  75863. type RoutersDeleteCall struct {
  75864. s *Service
  75865. project string
  75866. region string
  75867. router string
  75868. urlParams_ gensupport.URLParams
  75869. ctx_ context.Context
  75870. header_ http.Header
  75871. }
  75872. // Delete: Deletes the specified Router resource.
  75873. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  75874. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75875. c.project = project
  75876. c.region = region
  75877. c.router = router
  75878. return c
  75879. }
  75880. // RequestId sets the optional parameter "requestId": An optional
  75881. // request ID to identify requests. Specify a unique request ID so that
  75882. // if you must retry your request, the server will know to ignore the
  75883. // request if it has already been completed.
  75884. //
  75885. // For example, consider a situation where you make an initial request
  75886. // and the request times out. If you make the request again with the
  75887. // same request ID, the server can check if original operation with the
  75888. // same request ID was received, and if so, will ignore the second
  75889. // request. This prevents clients from accidentally creating duplicate
  75890. // commitments.
  75891. //
  75892. // The request ID must be a valid UUID with the exception that zero UUID
  75893. // is not supported (00000000-0000-0000-0000-000000000000).
  75894. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  75895. c.urlParams_.Set("requestId", requestId)
  75896. return c
  75897. }
  75898. // Fields allows partial responses to be retrieved. See
  75899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75900. // for more information.
  75901. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  75902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75903. return c
  75904. }
  75905. // Context sets the context to be used in this call's Do method. Any
  75906. // pending HTTP request will be aborted if the provided context is
  75907. // canceled.
  75908. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  75909. c.ctx_ = ctx
  75910. return c
  75911. }
  75912. // Header returns an http.Header that can be modified by the caller to
  75913. // add HTTP headers to the request.
  75914. func (c *RoutersDeleteCall) Header() http.Header {
  75915. if c.header_ == nil {
  75916. c.header_ = make(http.Header)
  75917. }
  75918. return c.header_
  75919. }
  75920. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  75921. reqHeaders := make(http.Header)
  75922. for k, v := range c.header_ {
  75923. reqHeaders[k] = v
  75924. }
  75925. reqHeaders.Set("User-Agent", c.s.userAgent())
  75926. var body io.Reader = nil
  75927. c.urlParams_.Set("alt", alt)
  75928. c.urlParams_.Set("prettyPrint", "false")
  75929. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  75930. urls += "?" + c.urlParams_.Encode()
  75931. req, err := http.NewRequest("DELETE", urls, body)
  75932. if err != nil {
  75933. return nil, err
  75934. }
  75935. req.Header = reqHeaders
  75936. googleapi.Expand(req.URL, map[string]string{
  75937. "project": c.project,
  75938. "region": c.region,
  75939. "router": c.router,
  75940. })
  75941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75942. }
  75943. // Do executes the "compute.routers.delete" call.
  75944. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75945. // status code is an error. Response headers are in either
  75946. // *Operation.ServerResponse.Header or (if a response was returned at
  75947. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75948. // to check whether the returned error was because
  75949. // http.StatusNotModified was returned.
  75950. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75951. gensupport.SetOptions(c.urlParams_, opts...)
  75952. res, err := c.doRequest("json")
  75953. if res != nil && res.StatusCode == http.StatusNotModified {
  75954. if res.Body != nil {
  75955. res.Body.Close()
  75956. }
  75957. return nil, &googleapi.Error{
  75958. Code: res.StatusCode,
  75959. Header: res.Header,
  75960. }
  75961. }
  75962. if err != nil {
  75963. return nil, err
  75964. }
  75965. defer googleapi.CloseBody(res)
  75966. if err := googleapi.CheckResponse(res); err != nil {
  75967. return nil, err
  75968. }
  75969. ret := &Operation{
  75970. ServerResponse: googleapi.ServerResponse{
  75971. Header: res.Header,
  75972. HTTPStatusCode: res.StatusCode,
  75973. },
  75974. }
  75975. target := &ret
  75976. if err := gensupport.DecodeResponse(target, res); err != nil {
  75977. return nil, err
  75978. }
  75979. return ret, nil
  75980. // {
  75981. // "description": "Deletes the specified Router resource.",
  75982. // "httpMethod": "DELETE",
  75983. // "id": "compute.routers.delete",
  75984. // "parameterOrder": [
  75985. // "project",
  75986. // "region",
  75987. // "router"
  75988. // ],
  75989. // "parameters": {
  75990. // "project": {
  75991. // "description": "Project ID for this request.",
  75992. // "location": "path",
  75993. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75994. // "required": true,
  75995. // "type": "string"
  75996. // },
  75997. // "region": {
  75998. // "description": "Name of the region for this request.",
  75999. // "location": "path",
  76000. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76001. // "required": true,
  76002. // "type": "string"
  76003. // },
  76004. // "requestId": {
  76005. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76006. // "location": "query",
  76007. // "type": "string"
  76008. // },
  76009. // "router": {
  76010. // "description": "Name of the Router resource to delete.",
  76011. // "location": "path",
  76012. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76013. // "required": true,
  76014. // "type": "string"
  76015. // }
  76016. // },
  76017. // "path": "{project}/regions/{region}/routers/{router}",
  76018. // "response": {
  76019. // "$ref": "Operation"
  76020. // },
  76021. // "scopes": [
  76022. // "https://www.googleapis.com/auth/cloud-platform",
  76023. // "https://www.googleapis.com/auth/compute"
  76024. // ]
  76025. // }
  76026. }
  76027. // method id "compute.routers.get":
  76028. type RoutersGetCall struct {
  76029. s *Service
  76030. project string
  76031. region string
  76032. router string
  76033. urlParams_ gensupport.URLParams
  76034. ifNoneMatch_ string
  76035. ctx_ context.Context
  76036. header_ http.Header
  76037. }
  76038. // Get: Returns the specified Router resource. Gets a list of available
  76039. // routers by making a list() request.
  76040. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  76041. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76042. c.project = project
  76043. c.region = region
  76044. c.router = router
  76045. return c
  76046. }
  76047. // Fields allows partial responses to be retrieved. See
  76048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76049. // for more information.
  76050. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  76051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76052. return c
  76053. }
  76054. // IfNoneMatch sets the optional parameter which makes the operation
  76055. // fail if the object's ETag matches the given value. This is useful for
  76056. // getting updates only after the object has changed since the last
  76057. // request. Use googleapi.IsNotModified to check whether the response
  76058. // error from Do is the result of In-None-Match.
  76059. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  76060. c.ifNoneMatch_ = entityTag
  76061. return c
  76062. }
  76063. // Context sets the context to be used in this call's Do method. Any
  76064. // pending HTTP request will be aborted if the provided context is
  76065. // canceled.
  76066. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  76067. c.ctx_ = ctx
  76068. return c
  76069. }
  76070. // Header returns an http.Header that can be modified by the caller to
  76071. // add HTTP headers to the request.
  76072. func (c *RoutersGetCall) Header() http.Header {
  76073. if c.header_ == nil {
  76074. c.header_ = make(http.Header)
  76075. }
  76076. return c.header_
  76077. }
  76078. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  76079. reqHeaders := make(http.Header)
  76080. for k, v := range c.header_ {
  76081. reqHeaders[k] = v
  76082. }
  76083. reqHeaders.Set("User-Agent", c.s.userAgent())
  76084. if c.ifNoneMatch_ != "" {
  76085. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76086. }
  76087. var body io.Reader = nil
  76088. c.urlParams_.Set("alt", alt)
  76089. c.urlParams_.Set("prettyPrint", "false")
  76090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  76091. urls += "?" + c.urlParams_.Encode()
  76092. req, err := http.NewRequest("GET", urls, body)
  76093. if err != nil {
  76094. return nil, err
  76095. }
  76096. req.Header = reqHeaders
  76097. googleapi.Expand(req.URL, map[string]string{
  76098. "project": c.project,
  76099. "region": c.region,
  76100. "router": c.router,
  76101. })
  76102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76103. }
  76104. // Do executes the "compute.routers.get" call.
  76105. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  76106. // code is an error. Response headers are in either
  76107. // *Router.ServerResponse.Header or (if a response was returned at all)
  76108. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  76109. // check whether the returned error was because http.StatusNotModified
  76110. // was returned.
  76111. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  76112. gensupport.SetOptions(c.urlParams_, opts...)
  76113. res, err := c.doRequest("json")
  76114. if res != nil && res.StatusCode == http.StatusNotModified {
  76115. if res.Body != nil {
  76116. res.Body.Close()
  76117. }
  76118. return nil, &googleapi.Error{
  76119. Code: res.StatusCode,
  76120. Header: res.Header,
  76121. }
  76122. }
  76123. if err != nil {
  76124. return nil, err
  76125. }
  76126. defer googleapi.CloseBody(res)
  76127. if err := googleapi.CheckResponse(res); err != nil {
  76128. return nil, err
  76129. }
  76130. ret := &Router{
  76131. ServerResponse: googleapi.ServerResponse{
  76132. Header: res.Header,
  76133. HTTPStatusCode: res.StatusCode,
  76134. },
  76135. }
  76136. target := &ret
  76137. if err := gensupport.DecodeResponse(target, res); err != nil {
  76138. return nil, err
  76139. }
  76140. return ret, nil
  76141. // {
  76142. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  76143. // "httpMethod": "GET",
  76144. // "id": "compute.routers.get",
  76145. // "parameterOrder": [
  76146. // "project",
  76147. // "region",
  76148. // "router"
  76149. // ],
  76150. // "parameters": {
  76151. // "project": {
  76152. // "description": "Project ID for this request.",
  76153. // "location": "path",
  76154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76155. // "required": true,
  76156. // "type": "string"
  76157. // },
  76158. // "region": {
  76159. // "description": "Name of the region for this request.",
  76160. // "location": "path",
  76161. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76162. // "required": true,
  76163. // "type": "string"
  76164. // },
  76165. // "router": {
  76166. // "description": "Name of the Router resource to return.",
  76167. // "location": "path",
  76168. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76169. // "required": true,
  76170. // "type": "string"
  76171. // }
  76172. // },
  76173. // "path": "{project}/regions/{region}/routers/{router}",
  76174. // "response": {
  76175. // "$ref": "Router"
  76176. // },
  76177. // "scopes": [
  76178. // "https://www.googleapis.com/auth/cloud-platform",
  76179. // "https://www.googleapis.com/auth/compute",
  76180. // "https://www.googleapis.com/auth/compute.readonly"
  76181. // ]
  76182. // }
  76183. }
  76184. // method id "compute.routers.getNatMappingInfo":
  76185. type RoutersGetNatMappingInfoCall struct {
  76186. s *Service
  76187. project string
  76188. region string
  76189. router string
  76190. urlParams_ gensupport.URLParams
  76191. ifNoneMatch_ string
  76192. ctx_ context.Context
  76193. header_ http.Header
  76194. }
  76195. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  76196. // endpoints.
  76197. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  76198. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76199. c.project = project
  76200. c.region = region
  76201. c.router = router
  76202. return c
  76203. }
  76204. // Filter sets the optional parameter "filter": A filter expression that
  76205. // filters resources listed in the response. The expression must specify
  76206. // the field name, a comparison operator, and the value that you want to
  76207. // use for filtering. The value must be a string, a number, or a
  76208. // boolean. The comparison operator must be either =, !=, >, or <.
  76209. //
  76210. // For example, if you are filtering Compute Engine instances, you can
  76211. // exclude instances named example-instance by specifying name !=
  76212. // example-instance.
  76213. //
  76214. // You can also filter nested fields. For example, you could specify
  76215. // scheduling.automaticRestart = false to include instances only if they
  76216. // are not scheduled for automatic restarts. You can use filtering on
  76217. // nested fields to filter based on resource labels.
  76218. //
  76219. // To filter on multiple expressions, provide each separate expression
  76220. // within parentheses. For example, (scheduling.automaticRestart = true)
  76221. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76222. // AND expression. However, you can include AND and OR expressions
  76223. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76224. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76225. // true).
  76226. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  76227. c.urlParams_.Set("filter", filter)
  76228. return c
  76229. }
  76230. // MaxResults sets the optional parameter "maxResults": The maximum
  76231. // number of results per page that should be returned. If the number of
  76232. // available results is larger than maxResults, Compute Engine returns a
  76233. // nextPageToken that can be used to get the next page of results in
  76234. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76235. // (Default: 500)
  76236. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  76237. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76238. return c
  76239. }
  76240. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76241. // a certain order. By default, results are returned in alphanumerical
  76242. // order based on the resource name.
  76243. //
  76244. // You can also sort results in descending order based on the creation
  76245. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76246. // based on the creationTimestamp field in reverse chronological order
  76247. // (newest result first). Use this to sort resources like operations so
  76248. // that the newest operation is returned first.
  76249. //
  76250. // Currently, only sorting by name or creationTimestamp desc is
  76251. // supported.
  76252. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  76253. c.urlParams_.Set("orderBy", orderBy)
  76254. return c
  76255. }
  76256. // PageToken sets the optional parameter "pageToken": Specifies a page
  76257. // token to use. Set pageToken to the nextPageToken returned by a
  76258. // previous list request to get the next page of results.
  76259. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  76260. c.urlParams_.Set("pageToken", pageToken)
  76261. return c
  76262. }
  76263. // Fields allows partial responses to be retrieved. See
  76264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76265. // for more information.
  76266. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  76267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76268. return c
  76269. }
  76270. // IfNoneMatch sets the optional parameter which makes the operation
  76271. // fail if the object's ETag matches the given value. This is useful for
  76272. // getting updates only after the object has changed since the last
  76273. // request. Use googleapi.IsNotModified to check whether the response
  76274. // error from Do is the result of In-None-Match.
  76275. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  76276. c.ifNoneMatch_ = entityTag
  76277. return c
  76278. }
  76279. // Context sets the context to be used in this call's Do method. Any
  76280. // pending HTTP request will be aborted if the provided context is
  76281. // canceled.
  76282. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  76283. c.ctx_ = ctx
  76284. return c
  76285. }
  76286. // Header returns an http.Header that can be modified by the caller to
  76287. // add HTTP headers to the request.
  76288. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  76289. if c.header_ == nil {
  76290. c.header_ = make(http.Header)
  76291. }
  76292. return c.header_
  76293. }
  76294. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  76295. reqHeaders := make(http.Header)
  76296. for k, v := range c.header_ {
  76297. reqHeaders[k] = v
  76298. }
  76299. reqHeaders.Set("User-Agent", c.s.userAgent())
  76300. if c.ifNoneMatch_ != "" {
  76301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76302. }
  76303. var body io.Reader = nil
  76304. c.urlParams_.Set("alt", alt)
  76305. c.urlParams_.Set("prettyPrint", "false")
  76306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  76307. urls += "?" + c.urlParams_.Encode()
  76308. req, err := http.NewRequest("GET", urls, body)
  76309. if err != nil {
  76310. return nil, err
  76311. }
  76312. req.Header = reqHeaders
  76313. googleapi.Expand(req.URL, map[string]string{
  76314. "project": c.project,
  76315. "region": c.region,
  76316. "router": c.router,
  76317. })
  76318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76319. }
  76320. // Do executes the "compute.routers.getNatMappingInfo" call.
  76321. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  76322. // Any non-2xx status code is an error. Response headers are in either
  76323. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  76324. // was returned at all) in error.(*googleapi.Error).Header. Use
  76325. // googleapi.IsNotModified to check whether the returned error was
  76326. // because http.StatusNotModified was returned.
  76327. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  76328. gensupport.SetOptions(c.urlParams_, opts...)
  76329. res, err := c.doRequest("json")
  76330. if res != nil && res.StatusCode == http.StatusNotModified {
  76331. if res.Body != nil {
  76332. res.Body.Close()
  76333. }
  76334. return nil, &googleapi.Error{
  76335. Code: res.StatusCode,
  76336. Header: res.Header,
  76337. }
  76338. }
  76339. if err != nil {
  76340. return nil, err
  76341. }
  76342. defer googleapi.CloseBody(res)
  76343. if err := googleapi.CheckResponse(res); err != nil {
  76344. return nil, err
  76345. }
  76346. ret := &VmEndpointNatMappingsList{
  76347. ServerResponse: googleapi.ServerResponse{
  76348. Header: res.Header,
  76349. HTTPStatusCode: res.StatusCode,
  76350. },
  76351. }
  76352. target := &ret
  76353. if err := gensupport.DecodeResponse(target, res); err != nil {
  76354. return nil, err
  76355. }
  76356. return ret, nil
  76357. // {
  76358. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  76359. // "httpMethod": "GET",
  76360. // "id": "compute.routers.getNatMappingInfo",
  76361. // "parameterOrder": [
  76362. // "project",
  76363. // "region",
  76364. // "router"
  76365. // ],
  76366. // "parameters": {
  76367. // "filter": {
  76368. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  76369. // "location": "query",
  76370. // "type": "string"
  76371. // },
  76372. // "maxResults": {
  76373. // "default": "500",
  76374. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  76375. // "format": "uint32",
  76376. // "location": "query",
  76377. // "minimum": "0",
  76378. // "type": "integer"
  76379. // },
  76380. // "orderBy": {
  76381. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  76382. // "location": "query",
  76383. // "type": "string"
  76384. // },
  76385. // "pageToken": {
  76386. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  76387. // "location": "query",
  76388. // "type": "string"
  76389. // },
  76390. // "project": {
  76391. // "description": "Project ID for this request.",
  76392. // "location": "path",
  76393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76394. // "required": true,
  76395. // "type": "string"
  76396. // },
  76397. // "region": {
  76398. // "description": "Name of the region for this request.",
  76399. // "location": "path",
  76400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76401. // "required": true,
  76402. // "type": "string"
  76403. // },
  76404. // "router": {
  76405. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  76406. // "location": "path",
  76407. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76408. // "required": true,
  76409. // "type": "string"
  76410. // }
  76411. // },
  76412. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  76413. // "response": {
  76414. // "$ref": "VmEndpointNatMappingsList"
  76415. // },
  76416. // "scopes": [
  76417. // "https://www.googleapis.com/auth/cloud-platform",
  76418. // "https://www.googleapis.com/auth/compute",
  76419. // "https://www.googleapis.com/auth/compute.readonly"
  76420. // ]
  76421. // }
  76422. }
  76423. // Pages invokes f for each page of results.
  76424. // A non-nil error returned from f will halt the iteration.
  76425. // The provided context supersedes any context provided to the Context method.
  76426. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  76427. c.ctx_ = ctx
  76428. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76429. for {
  76430. x, err := c.Do()
  76431. if err != nil {
  76432. return err
  76433. }
  76434. if err := f(x); err != nil {
  76435. return err
  76436. }
  76437. if x.NextPageToken == "" {
  76438. return nil
  76439. }
  76440. c.PageToken(x.NextPageToken)
  76441. }
  76442. }
  76443. // method id "compute.routers.getRouterStatus":
  76444. type RoutersGetRouterStatusCall struct {
  76445. s *Service
  76446. project string
  76447. region string
  76448. router string
  76449. urlParams_ gensupport.URLParams
  76450. ifNoneMatch_ string
  76451. ctx_ context.Context
  76452. header_ http.Header
  76453. }
  76454. // GetRouterStatus: Retrieves runtime information of the specified
  76455. // router.
  76456. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  76457. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76458. c.project = project
  76459. c.region = region
  76460. c.router = router
  76461. return c
  76462. }
  76463. // Fields allows partial responses to be retrieved. See
  76464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76465. // for more information.
  76466. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  76467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76468. return c
  76469. }
  76470. // IfNoneMatch sets the optional parameter which makes the operation
  76471. // fail if the object's ETag matches the given value. This is useful for
  76472. // getting updates only after the object has changed since the last
  76473. // request. Use googleapi.IsNotModified to check whether the response
  76474. // error from Do is the result of In-None-Match.
  76475. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  76476. c.ifNoneMatch_ = entityTag
  76477. return c
  76478. }
  76479. // Context sets the context to be used in this call's Do method. Any
  76480. // pending HTTP request will be aborted if the provided context is
  76481. // canceled.
  76482. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  76483. c.ctx_ = ctx
  76484. return c
  76485. }
  76486. // Header returns an http.Header that can be modified by the caller to
  76487. // add HTTP headers to the request.
  76488. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  76489. if c.header_ == nil {
  76490. c.header_ = make(http.Header)
  76491. }
  76492. return c.header_
  76493. }
  76494. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  76495. reqHeaders := make(http.Header)
  76496. for k, v := range c.header_ {
  76497. reqHeaders[k] = v
  76498. }
  76499. reqHeaders.Set("User-Agent", c.s.userAgent())
  76500. if c.ifNoneMatch_ != "" {
  76501. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76502. }
  76503. var body io.Reader = nil
  76504. c.urlParams_.Set("alt", alt)
  76505. c.urlParams_.Set("prettyPrint", "false")
  76506. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  76507. urls += "?" + c.urlParams_.Encode()
  76508. req, err := http.NewRequest("GET", urls, body)
  76509. if err != nil {
  76510. return nil, err
  76511. }
  76512. req.Header = reqHeaders
  76513. googleapi.Expand(req.URL, map[string]string{
  76514. "project": c.project,
  76515. "region": c.region,
  76516. "router": c.router,
  76517. })
  76518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76519. }
  76520. // Do executes the "compute.routers.getRouterStatus" call.
  76521. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  76522. // non-2xx status code is an error. Response headers are in either
  76523. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  76524. // returned at all) in error.(*googleapi.Error).Header. Use
  76525. // googleapi.IsNotModified to check whether the returned error was
  76526. // because http.StatusNotModified was returned.
  76527. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  76528. gensupport.SetOptions(c.urlParams_, opts...)
  76529. res, err := c.doRequest("json")
  76530. if res != nil && res.StatusCode == http.StatusNotModified {
  76531. if res.Body != nil {
  76532. res.Body.Close()
  76533. }
  76534. return nil, &googleapi.Error{
  76535. Code: res.StatusCode,
  76536. Header: res.Header,
  76537. }
  76538. }
  76539. if err != nil {
  76540. return nil, err
  76541. }
  76542. defer googleapi.CloseBody(res)
  76543. if err := googleapi.CheckResponse(res); err != nil {
  76544. return nil, err
  76545. }
  76546. ret := &RouterStatusResponse{
  76547. ServerResponse: googleapi.ServerResponse{
  76548. Header: res.Header,
  76549. HTTPStatusCode: res.StatusCode,
  76550. },
  76551. }
  76552. target := &ret
  76553. if err := gensupport.DecodeResponse(target, res); err != nil {
  76554. return nil, err
  76555. }
  76556. return ret, nil
  76557. // {
  76558. // "description": "Retrieves runtime information of the specified router.",
  76559. // "httpMethod": "GET",
  76560. // "id": "compute.routers.getRouterStatus",
  76561. // "parameterOrder": [
  76562. // "project",
  76563. // "region",
  76564. // "router"
  76565. // ],
  76566. // "parameters": {
  76567. // "project": {
  76568. // "description": "Project ID for this request.",
  76569. // "location": "path",
  76570. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76571. // "required": true,
  76572. // "type": "string"
  76573. // },
  76574. // "region": {
  76575. // "description": "Name of the region for this request.",
  76576. // "location": "path",
  76577. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76578. // "required": true,
  76579. // "type": "string"
  76580. // },
  76581. // "router": {
  76582. // "description": "Name of the Router resource to query.",
  76583. // "location": "path",
  76584. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76585. // "required": true,
  76586. // "type": "string"
  76587. // }
  76588. // },
  76589. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  76590. // "response": {
  76591. // "$ref": "RouterStatusResponse"
  76592. // },
  76593. // "scopes": [
  76594. // "https://www.googleapis.com/auth/cloud-platform",
  76595. // "https://www.googleapis.com/auth/compute",
  76596. // "https://www.googleapis.com/auth/compute.readonly"
  76597. // ]
  76598. // }
  76599. }
  76600. // method id "compute.routers.insert":
  76601. type RoutersInsertCall struct {
  76602. s *Service
  76603. project string
  76604. region string
  76605. router *Router
  76606. urlParams_ gensupport.URLParams
  76607. ctx_ context.Context
  76608. header_ http.Header
  76609. }
  76610. // Insert: Creates a Router resource in the specified project and region
  76611. // using the data included in the request.
  76612. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  76613. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76614. c.project = project
  76615. c.region = region
  76616. c.router = router
  76617. return c
  76618. }
  76619. // RequestId sets the optional parameter "requestId": An optional
  76620. // request ID to identify requests. Specify a unique request ID so that
  76621. // if you must retry your request, the server will know to ignore the
  76622. // request if it has already been completed.
  76623. //
  76624. // For example, consider a situation where you make an initial request
  76625. // and the request times out. If you make the request again with the
  76626. // same request ID, the server can check if original operation with the
  76627. // same request ID was received, and if so, will ignore the second
  76628. // request. This prevents clients from accidentally creating duplicate
  76629. // commitments.
  76630. //
  76631. // The request ID must be a valid UUID with the exception that zero UUID
  76632. // is not supported (00000000-0000-0000-0000-000000000000).
  76633. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  76634. c.urlParams_.Set("requestId", requestId)
  76635. return c
  76636. }
  76637. // Fields allows partial responses to be retrieved. See
  76638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76639. // for more information.
  76640. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  76641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76642. return c
  76643. }
  76644. // Context sets the context to be used in this call's Do method. Any
  76645. // pending HTTP request will be aborted if the provided context is
  76646. // canceled.
  76647. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  76648. c.ctx_ = ctx
  76649. return c
  76650. }
  76651. // Header returns an http.Header that can be modified by the caller to
  76652. // add HTTP headers to the request.
  76653. func (c *RoutersInsertCall) Header() http.Header {
  76654. if c.header_ == nil {
  76655. c.header_ = make(http.Header)
  76656. }
  76657. return c.header_
  76658. }
  76659. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  76660. reqHeaders := make(http.Header)
  76661. for k, v := range c.header_ {
  76662. reqHeaders[k] = v
  76663. }
  76664. reqHeaders.Set("User-Agent", c.s.userAgent())
  76665. var body io.Reader = nil
  76666. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  76667. if err != nil {
  76668. return nil, err
  76669. }
  76670. reqHeaders.Set("Content-Type", "application/json")
  76671. c.urlParams_.Set("alt", alt)
  76672. c.urlParams_.Set("prettyPrint", "false")
  76673. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  76674. urls += "?" + c.urlParams_.Encode()
  76675. req, err := http.NewRequest("POST", urls, body)
  76676. if err != nil {
  76677. return nil, err
  76678. }
  76679. req.Header = reqHeaders
  76680. googleapi.Expand(req.URL, map[string]string{
  76681. "project": c.project,
  76682. "region": c.region,
  76683. })
  76684. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76685. }
  76686. // Do executes the "compute.routers.insert" call.
  76687. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76688. // status code is an error. Response headers are in either
  76689. // *Operation.ServerResponse.Header or (if a response was returned at
  76690. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76691. // to check whether the returned error was because
  76692. // http.StatusNotModified was returned.
  76693. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76694. gensupport.SetOptions(c.urlParams_, opts...)
  76695. res, err := c.doRequest("json")
  76696. if res != nil && res.StatusCode == http.StatusNotModified {
  76697. if res.Body != nil {
  76698. res.Body.Close()
  76699. }
  76700. return nil, &googleapi.Error{
  76701. Code: res.StatusCode,
  76702. Header: res.Header,
  76703. }
  76704. }
  76705. if err != nil {
  76706. return nil, err
  76707. }
  76708. defer googleapi.CloseBody(res)
  76709. if err := googleapi.CheckResponse(res); err != nil {
  76710. return nil, err
  76711. }
  76712. ret := &Operation{
  76713. ServerResponse: googleapi.ServerResponse{
  76714. Header: res.Header,
  76715. HTTPStatusCode: res.StatusCode,
  76716. },
  76717. }
  76718. target := &ret
  76719. if err := gensupport.DecodeResponse(target, res); err != nil {
  76720. return nil, err
  76721. }
  76722. return ret, nil
  76723. // {
  76724. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  76725. // "httpMethod": "POST",
  76726. // "id": "compute.routers.insert",
  76727. // "parameterOrder": [
  76728. // "project",
  76729. // "region"
  76730. // ],
  76731. // "parameters": {
  76732. // "project": {
  76733. // "description": "Project ID for this request.",
  76734. // "location": "path",
  76735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76736. // "required": true,
  76737. // "type": "string"
  76738. // },
  76739. // "region": {
  76740. // "description": "Name of the region for this request.",
  76741. // "location": "path",
  76742. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76743. // "required": true,
  76744. // "type": "string"
  76745. // },
  76746. // "requestId": {
  76747. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76748. // "location": "query",
  76749. // "type": "string"
  76750. // }
  76751. // },
  76752. // "path": "{project}/regions/{region}/routers",
  76753. // "request": {
  76754. // "$ref": "Router"
  76755. // },
  76756. // "response": {
  76757. // "$ref": "Operation"
  76758. // },
  76759. // "scopes": [
  76760. // "https://www.googleapis.com/auth/cloud-platform",
  76761. // "https://www.googleapis.com/auth/compute"
  76762. // ]
  76763. // }
  76764. }
  76765. // method id "compute.routers.list":
  76766. type RoutersListCall struct {
  76767. s *Service
  76768. project string
  76769. region string
  76770. urlParams_ gensupport.URLParams
  76771. ifNoneMatch_ string
  76772. ctx_ context.Context
  76773. header_ http.Header
  76774. }
  76775. // List: Retrieves a list of Router resources available to the specified
  76776. // project.
  76777. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  76778. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76779. c.project = project
  76780. c.region = region
  76781. return c
  76782. }
  76783. // Filter sets the optional parameter "filter": A filter expression that
  76784. // filters resources listed in the response. The expression must specify
  76785. // the field name, a comparison operator, and the value that you want to
  76786. // use for filtering. The value must be a string, a number, or a
  76787. // boolean. The comparison operator must be either =, !=, >, or <.
  76788. //
  76789. // For example, if you are filtering Compute Engine instances, you can
  76790. // exclude instances named example-instance by specifying name !=
  76791. // example-instance.
  76792. //
  76793. // You can also filter nested fields. For example, you could specify
  76794. // scheduling.automaticRestart = false to include instances only if they
  76795. // are not scheduled for automatic restarts. You can use filtering on
  76796. // nested fields to filter based on resource labels.
  76797. //
  76798. // To filter on multiple expressions, provide each separate expression
  76799. // within parentheses. For example, (scheduling.automaticRestart = true)
  76800. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76801. // AND expression. However, you can include AND and OR expressions
  76802. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76803. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76804. // true).
  76805. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  76806. c.urlParams_.Set("filter", filter)
  76807. return c
  76808. }
  76809. // MaxResults sets the optional parameter "maxResults": The maximum
  76810. // number of results per page that should be returned. If the number of
  76811. // available results is larger than maxResults, Compute Engine returns a
  76812. // nextPageToken that can be used to get the next page of results in
  76813. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76814. // (Default: 500)
  76815. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  76816. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76817. return c
  76818. }
  76819. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76820. // a certain order. By default, results are returned in alphanumerical
  76821. // order based on the resource name.
  76822. //
  76823. // You can also sort results in descending order based on the creation
  76824. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76825. // based on the creationTimestamp field in reverse chronological order
  76826. // (newest result first). Use this to sort resources like operations so
  76827. // that the newest operation is returned first.
  76828. //
  76829. // Currently, only sorting by name or creationTimestamp desc is
  76830. // supported.
  76831. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  76832. c.urlParams_.Set("orderBy", orderBy)
  76833. return c
  76834. }
  76835. // PageToken sets the optional parameter "pageToken": Specifies a page
  76836. // token to use. Set pageToken to the nextPageToken returned by a
  76837. // previous list request to get the next page of results.
  76838. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  76839. c.urlParams_.Set("pageToken", pageToken)
  76840. return c
  76841. }
  76842. // Fields allows partial responses to be retrieved. See
  76843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76844. // for more information.
  76845. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  76846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76847. return c
  76848. }
  76849. // IfNoneMatch sets the optional parameter which makes the operation
  76850. // fail if the object's ETag matches the given value. This is useful for
  76851. // getting updates only after the object has changed since the last
  76852. // request. Use googleapi.IsNotModified to check whether the response
  76853. // error from Do is the result of In-None-Match.
  76854. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  76855. c.ifNoneMatch_ = entityTag
  76856. return c
  76857. }
  76858. // Context sets the context to be used in this call's Do method. Any
  76859. // pending HTTP request will be aborted if the provided context is
  76860. // canceled.
  76861. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  76862. c.ctx_ = ctx
  76863. return c
  76864. }
  76865. // Header returns an http.Header that can be modified by the caller to
  76866. // add HTTP headers to the request.
  76867. func (c *RoutersListCall) Header() http.Header {
  76868. if c.header_ == nil {
  76869. c.header_ = make(http.Header)
  76870. }
  76871. return c.header_
  76872. }
  76873. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  76874. reqHeaders := make(http.Header)
  76875. for k, v := range c.header_ {
  76876. reqHeaders[k] = v
  76877. }
  76878. reqHeaders.Set("User-Agent", c.s.userAgent())
  76879. if c.ifNoneMatch_ != "" {
  76880. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76881. }
  76882. var body io.Reader = nil
  76883. c.urlParams_.Set("alt", alt)
  76884. c.urlParams_.Set("prettyPrint", "false")
  76885. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  76886. urls += "?" + c.urlParams_.Encode()
  76887. req, err := http.NewRequest("GET", urls, body)
  76888. if err != nil {
  76889. return nil, err
  76890. }
  76891. req.Header = reqHeaders
  76892. googleapi.Expand(req.URL, map[string]string{
  76893. "project": c.project,
  76894. "region": c.region,
  76895. })
  76896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76897. }
  76898. // Do executes the "compute.routers.list" call.
  76899. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  76900. // status code is an error. Response headers are in either
  76901. // *RouterList.ServerResponse.Header or (if a response was returned at
  76902. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76903. // to check whether the returned error was because
  76904. // http.StatusNotModified was returned.
  76905. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  76906. gensupport.SetOptions(c.urlParams_, opts...)
  76907. res, err := c.doRequest("json")
  76908. if res != nil && res.StatusCode == http.StatusNotModified {
  76909. if res.Body != nil {
  76910. res.Body.Close()
  76911. }
  76912. return nil, &googleapi.Error{
  76913. Code: res.StatusCode,
  76914. Header: res.Header,
  76915. }
  76916. }
  76917. if err != nil {
  76918. return nil, err
  76919. }
  76920. defer googleapi.CloseBody(res)
  76921. if err := googleapi.CheckResponse(res); err != nil {
  76922. return nil, err
  76923. }
  76924. ret := &RouterList{
  76925. ServerResponse: googleapi.ServerResponse{
  76926. Header: res.Header,
  76927. HTTPStatusCode: res.StatusCode,
  76928. },
  76929. }
  76930. target := &ret
  76931. if err := gensupport.DecodeResponse(target, res); err != nil {
  76932. return nil, err
  76933. }
  76934. return ret, nil
  76935. // {
  76936. // "description": "Retrieves a list of Router resources available to the specified project.",
  76937. // "httpMethod": "GET",
  76938. // "id": "compute.routers.list",
  76939. // "parameterOrder": [
  76940. // "project",
  76941. // "region"
  76942. // ],
  76943. // "parameters": {
  76944. // "filter": {
  76945. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  76946. // "location": "query",
  76947. // "type": "string"
  76948. // },
  76949. // "maxResults": {
  76950. // "default": "500",
  76951. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  76952. // "format": "uint32",
  76953. // "location": "query",
  76954. // "minimum": "0",
  76955. // "type": "integer"
  76956. // },
  76957. // "orderBy": {
  76958. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  76959. // "location": "query",
  76960. // "type": "string"
  76961. // },
  76962. // "pageToken": {
  76963. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  76964. // "location": "query",
  76965. // "type": "string"
  76966. // },
  76967. // "project": {
  76968. // "description": "Project ID for this request.",
  76969. // "location": "path",
  76970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76971. // "required": true,
  76972. // "type": "string"
  76973. // },
  76974. // "region": {
  76975. // "description": "Name of the region for this request.",
  76976. // "location": "path",
  76977. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76978. // "required": true,
  76979. // "type": "string"
  76980. // }
  76981. // },
  76982. // "path": "{project}/regions/{region}/routers",
  76983. // "response": {
  76984. // "$ref": "RouterList"
  76985. // },
  76986. // "scopes": [
  76987. // "https://www.googleapis.com/auth/cloud-platform",
  76988. // "https://www.googleapis.com/auth/compute",
  76989. // "https://www.googleapis.com/auth/compute.readonly"
  76990. // ]
  76991. // }
  76992. }
  76993. // Pages invokes f for each page of results.
  76994. // A non-nil error returned from f will halt the iteration.
  76995. // The provided context supersedes any context provided to the Context method.
  76996. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  76997. c.ctx_ = ctx
  76998. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76999. for {
  77000. x, err := c.Do()
  77001. if err != nil {
  77002. return err
  77003. }
  77004. if err := f(x); err != nil {
  77005. return err
  77006. }
  77007. if x.NextPageToken == "" {
  77008. return nil
  77009. }
  77010. c.PageToken(x.NextPageToken)
  77011. }
  77012. }
  77013. // method id "compute.routers.patch":
  77014. type RoutersPatchCall struct {
  77015. s *Service
  77016. project string
  77017. region string
  77018. router string
  77019. router2 *Router
  77020. urlParams_ gensupport.URLParams
  77021. ctx_ context.Context
  77022. header_ http.Header
  77023. }
  77024. // Patch: Patches the specified Router resource with the data included
  77025. // in the request. This method supports PATCH semantics and uses JSON
  77026. // merge patch format and processing rules.
  77027. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  77028. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77029. c.project = project
  77030. c.region = region
  77031. c.router = router
  77032. c.router2 = router2
  77033. return c
  77034. }
  77035. // RequestId sets the optional parameter "requestId": An optional
  77036. // request ID to identify requests. Specify a unique request ID so that
  77037. // if you must retry your request, the server will know to ignore the
  77038. // request if it has already been completed.
  77039. //
  77040. // For example, consider a situation where you make an initial request
  77041. // and the request times out. If you make the request again with the
  77042. // same request ID, the server can check if original operation with the
  77043. // same request ID was received, and if so, will ignore the second
  77044. // request. This prevents clients from accidentally creating duplicate
  77045. // commitments.
  77046. //
  77047. // The request ID must be a valid UUID with the exception that zero UUID
  77048. // is not supported (00000000-0000-0000-0000-000000000000).
  77049. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  77050. c.urlParams_.Set("requestId", requestId)
  77051. return c
  77052. }
  77053. // Fields allows partial responses to be retrieved. See
  77054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77055. // for more information.
  77056. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  77057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77058. return c
  77059. }
  77060. // Context sets the context to be used in this call's Do method. Any
  77061. // pending HTTP request will be aborted if the provided context is
  77062. // canceled.
  77063. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  77064. c.ctx_ = ctx
  77065. return c
  77066. }
  77067. // Header returns an http.Header that can be modified by the caller to
  77068. // add HTTP headers to the request.
  77069. func (c *RoutersPatchCall) Header() http.Header {
  77070. if c.header_ == nil {
  77071. c.header_ = make(http.Header)
  77072. }
  77073. return c.header_
  77074. }
  77075. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  77076. reqHeaders := make(http.Header)
  77077. for k, v := range c.header_ {
  77078. reqHeaders[k] = v
  77079. }
  77080. reqHeaders.Set("User-Agent", c.s.userAgent())
  77081. var body io.Reader = nil
  77082. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  77083. if err != nil {
  77084. return nil, err
  77085. }
  77086. reqHeaders.Set("Content-Type", "application/json")
  77087. c.urlParams_.Set("alt", alt)
  77088. c.urlParams_.Set("prettyPrint", "false")
  77089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  77090. urls += "?" + c.urlParams_.Encode()
  77091. req, err := http.NewRequest("PATCH", urls, body)
  77092. if err != nil {
  77093. return nil, err
  77094. }
  77095. req.Header = reqHeaders
  77096. googleapi.Expand(req.URL, map[string]string{
  77097. "project": c.project,
  77098. "region": c.region,
  77099. "router": c.router,
  77100. })
  77101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77102. }
  77103. // Do executes the "compute.routers.patch" call.
  77104. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77105. // status code is an error. Response headers are in either
  77106. // *Operation.ServerResponse.Header or (if a response was returned at
  77107. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77108. // to check whether the returned error was because
  77109. // http.StatusNotModified was returned.
  77110. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77111. gensupport.SetOptions(c.urlParams_, opts...)
  77112. res, err := c.doRequest("json")
  77113. if res != nil && res.StatusCode == http.StatusNotModified {
  77114. if res.Body != nil {
  77115. res.Body.Close()
  77116. }
  77117. return nil, &googleapi.Error{
  77118. Code: res.StatusCode,
  77119. Header: res.Header,
  77120. }
  77121. }
  77122. if err != nil {
  77123. return nil, err
  77124. }
  77125. defer googleapi.CloseBody(res)
  77126. if err := googleapi.CheckResponse(res); err != nil {
  77127. return nil, err
  77128. }
  77129. ret := &Operation{
  77130. ServerResponse: googleapi.ServerResponse{
  77131. Header: res.Header,
  77132. HTTPStatusCode: res.StatusCode,
  77133. },
  77134. }
  77135. target := &ret
  77136. if err := gensupport.DecodeResponse(target, res); err != nil {
  77137. return nil, err
  77138. }
  77139. return ret, nil
  77140. // {
  77141. // "description": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
  77142. // "httpMethod": "PATCH",
  77143. // "id": "compute.routers.patch",
  77144. // "parameterOrder": [
  77145. // "project",
  77146. // "region",
  77147. // "router"
  77148. // ],
  77149. // "parameters": {
  77150. // "project": {
  77151. // "description": "Project ID for this request.",
  77152. // "location": "path",
  77153. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77154. // "required": true,
  77155. // "type": "string"
  77156. // },
  77157. // "region": {
  77158. // "description": "Name of the region for this request.",
  77159. // "location": "path",
  77160. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77161. // "required": true,
  77162. // "type": "string"
  77163. // },
  77164. // "requestId": {
  77165. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77166. // "location": "query",
  77167. // "type": "string"
  77168. // },
  77169. // "router": {
  77170. // "description": "Name of the Router resource to patch.",
  77171. // "location": "path",
  77172. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77173. // "required": true,
  77174. // "type": "string"
  77175. // }
  77176. // },
  77177. // "path": "{project}/regions/{region}/routers/{router}",
  77178. // "request": {
  77179. // "$ref": "Router"
  77180. // },
  77181. // "response": {
  77182. // "$ref": "Operation"
  77183. // },
  77184. // "scopes": [
  77185. // "https://www.googleapis.com/auth/cloud-platform",
  77186. // "https://www.googleapis.com/auth/compute"
  77187. // ]
  77188. // }
  77189. }
  77190. // method id "compute.routers.preview":
  77191. type RoutersPreviewCall struct {
  77192. s *Service
  77193. project string
  77194. region string
  77195. router string
  77196. router2 *Router
  77197. urlParams_ gensupport.URLParams
  77198. ctx_ context.Context
  77199. header_ http.Header
  77200. }
  77201. // Preview: Preview fields auto-generated during router create and
  77202. // update operations. Calling this method does NOT create or update the
  77203. // router.
  77204. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  77205. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77206. c.project = project
  77207. c.region = region
  77208. c.router = router
  77209. c.router2 = router2
  77210. return c
  77211. }
  77212. // Fields allows partial responses to be retrieved. See
  77213. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77214. // for more information.
  77215. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  77216. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77217. return c
  77218. }
  77219. // Context sets the context to be used in this call's Do method. Any
  77220. // pending HTTP request will be aborted if the provided context is
  77221. // canceled.
  77222. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  77223. c.ctx_ = ctx
  77224. return c
  77225. }
  77226. // Header returns an http.Header that can be modified by the caller to
  77227. // add HTTP headers to the request.
  77228. func (c *RoutersPreviewCall) Header() http.Header {
  77229. if c.header_ == nil {
  77230. c.header_ = make(http.Header)
  77231. }
  77232. return c.header_
  77233. }
  77234. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  77235. reqHeaders := make(http.Header)
  77236. for k, v := range c.header_ {
  77237. reqHeaders[k] = v
  77238. }
  77239. reqHeaders.Set("User-Agent", c.s.userAgent())
  77240. var body io.Reader = nil
  77241. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  77242. if err != nil {
  77243. return nil, err
  77244. }
  77245. reqHeaders.Set("Content-Type", "application/json")
  77246. c.urlParams_.Set("alt", alt)
  77247. c.urlParams_.Set("prettyPrint", "false")
  77248. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  77249. urls += "?" + c.urlParams_.Encode()
  77250. req, err := http.NewRequest("POST", urls, body)
  77251. if err != nil {
  77252. return nil, err
  77253. }
  77254. req.Header = reqHeaders
  77255. googleapi.Expand(req.URL, map[string]string{
  77256. "project": c.project,
  77257. "region": c.region,
  77258. "router": c.router,
  77259. })
  77260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77261. }
  77262. // Do executes the "compute.routers.preview" call.
  77263. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  77264. // non-2xx status code is an error. Response headers are in either
  77265. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  77266. // returned at all) in error.(*googleapi.Error).Header. Use
  77267. // googleapi.IsNotModified to check whether the returned error was
  77268. // because http.StatusNotModified was returned.
  77269. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  77270. gensupport.SetOptions(c.urlParams_, opts...)
  77271. res, err := c.doRequest("json")
  77272. if res != nil && res.StatusCode == http.StatusNotModified {
  77273. if res.Body != nil {
  77274. res.Body.Close()
  77275. }
  77276. return nil, &googleapi.Error{
  77277. Code: res.StatusCode,
  77278. Header: res.Header,
  77279. }
  77280. }
  77281. if err != nil {
  77282. return nil, err
  77283. }
  77284. defer googleapi.CloseBody(res)
  77285. if err := googleapi.CheckResponse(res); err != nil {
  77286. return nil, err
  77287. }
  77288. ret := &RoutersPreviewResponse{
  77289. ServerResponse: googleapi.ServerResponse{
  77290. Header: res.Header,
  77291. HTTPStatusCode: res.StatusCode,
  77292. },
  77293. }
  77294. target := &ret
  77295. if err := gensupport.DecodeResponse(target, res); err != nil {
  77296. return nil, err
  77297. }
  77298. return ret, nil
  77299. // {
  77300. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  77301. // "httpMethod": "POST",
  77302. // "id": "compute.routers.preview",
  77303. // "parameterOrder": [
  77304. // "project",
  77305. // "region",
  77306. // "router"
  77307. // ],
  77308. // "parameters": {
  77309. // "project": {
  77310. // "description": "Project ID for this request.",
  77311. // "location": "path",
  77312. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77313. // "required": true,
  77314. // "type": "string"
  77315. // },
  77316. // "region": {
  77317. // "description": "Name of the region for this request.",
  77318. // "location": "path",
  77319. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77320. // "required": true,
  77321. // "type": "string"
  77322. // },
  77323. // "router": {
  77324. // "description": "Name of the Router resource to query.",
  77325. // "location": "path",
  77326. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77327. // "required": true,
  77328. // "type": "string"
  77329. // }
  77330. // },
  77331. // "path": "{project}/regions/{region}/routers/{router}/preview",
  77332. // "request": {
  77333. // "$ref": "Router"
  77334. // },
  77335. // "response": {
  77336. // "$ref": "RoutersPreviewResponse"
  77337. // },
  77338. // "scopes": [
  77339. // "https://www.googleapis.com/auth/cloud-platform",
  77340. // "https://www.googleapis.com/auth/compute",
  77341. // "https://www.googleapis.com/auth/compute.readonly"
  77342. // ]
  77343. // }
  77344. }
  77345. // method id "compute.routers.update":
  77346. type RoutersUpdateCall struct {
  77347. s *Service
  77348. project string
  77349. region string
  77350. router string
  77351. router2 *Router
  77352. urlParams_ gensupport.URLParams
  77353. ctx_ context.Context
  77354. header_ http.Header
  77355. }
  77356. // Update: Updates the specified Router resource with the data included
  77357. // in the request.
  77358. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  77359. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77360. c.project = project
  77361. c.region = region
  77362. c.router = router
  77363. c.router2 = router2
  77364. return c
  77365. }
  77366. // RequestId sets the optional parameter "requestId": An optional
  77367. // request ID to identify requests. Specify a unique request ID so that
  77368. // if you must retry your request, the server will know to ignore the
  77369. // request if it has already been completed.
  77370. //
  77371. // For example, consider a situation where you make an initial request
  77372. // and the request times out. If you make the request again with the
  77373. // same request ID, the server can check if original operation with the
  77374. // same request ID was received, and if so, will ignore the second
  77375. // request. This prevents clients from accidentally creating duplicate
  77376. // commitments.
  77377. //
  77378. // The request ID must be a valid UUID with the exception that zero UUID
  77379. // is not supported (00000000-0000-0000-0000-000000000000).
  77380. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  77381. c.urlParams_.Set("requestId", requestId)
  77382. return c
  77383. }
  77384. // Fields allows partial responses to be retrieved. See
  77385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77386. // for more information.
  77387. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  77388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77389. return c
  77390. }
  77391. // Context sets the context to be used in this call's Do method. Any
  77392. // pending HTTP request will be aborted if the provided context is
  77393. // canceled.
  77394. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  77395. c.ctx_ = ctx
  77396. return c
  77397. }
  77398. // Header returns an http.Header that can be modified by the caller to
  77399. // add HTTP headers to the request.
  77400. func (c *RoutersUpdateCall) Header() http.Header {
  77401. if c.header_ == nil {
  77402. c.header_ = make(http.Header)
  77403. }
  77404. return c.header_
  77405. }
  77406. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  77407. reqHeaders := make(http.Header)
  77408. for k, v := range c.header_ {
  77409. reqHeaders[k] = v
  77410. }
  77411. reqHeaders.Set("User-Agent", c.s.userAgent())
  77412. var body io.Reader = nil
  77413. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  77414. if err != nil {
  77415. return nil, err
  77416. }
  77417. reqHeaders.Set("Content-Type", "application/json")
  77418. c.urlParams_.Set("alt", alt)
  77419. c.urlParams_.Set("prettyPrint", "false")
  77420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  77421. urls += "?" + c.urlParams_.Encode()
  77422. req, err := http.NewRequest("PUT", urls, body)
  77423. if err != nil {
  77424. return nil, err
  77425. }
  77426. req.Header = reqHeaders
  77427. googleapi.Expand(req.URL, map[string]string{
  77428. "project": c.project,
  77429. "region": c.region,
  77430. "router": c.router,
  77431. })
  77432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77433. }
  77434. // Do executes the "compute.routers.update" call.
  77435. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77436. // status code is an error. Response headers are in either
  77437. // *Operation.ServerResponse.Header or (if a response was returned at
  77438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77439. // to check whether the returned error was because
  77440. // http.StatusNotModified was returned.
  77441. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77442. gensupport.SetOptions(c.urlParams_, opts...)
  77443. res, err := c.doRequest("json")
  77444. if res != nil && res.StatusCode == http.StatusNotModified {
  77445. if res.Body != nil {
  77446. res.Body.Close()
  77447. }
  77448. return nil, &googleapi.Error{
  77449. Code: res.StatusCode,
  77450. Header: res.Header,
  77451. }
  77452. }
  77453. if err != nil {
  77454. return nil, err
  77455. }
  77456. defer googleapi.CloseBody(res)
  77457. if err := googleapi.CheckResponse(res); err != nil {
  77458. return nil, err
  77459. }
  77460. ret := &Operation{
  77461. ServerResponse: googleapi.ServerResponse{
  77462. Header: res.Header,
  77463. HTTPStatusCode: res.StatusCode,
  77464. },
  77465. }
  77466. target := &ret
  77467. if err := gensupport.DecodeResponse(target, res); err != nil {
  77468. return nil, err
  77469. }
  77470. return ret, nil
  77471. // {
  77472. // "description": "Updates the specified Router resource with the data included in the request.",
  77473. // "httpMethod": "PUT",
  77474. // "id": "compute.routers.update",
  77475. // "parameterOrder": [
  77476. // "project",
  77477. // "region",
  77478. // "router"
  77479. // ],
  77480. // "parameters": {
  77481. // "project": {
  77482. // "description": "Project ID for this request.",
  77483. // "location": "path",
  77484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77485. // "required": true,
  77486. // "type": "string"
  77487. // },
  77488. // "region": {
  77489. // "description": "Name of the region for this request.",
  77490. // "location": "path",
  77491. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77492. // "required": true,
  77493. // "type": "string"
  77494. // },
  77495. // "requestId": {
  77496. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77497. // "location": "query",
  77498. // "type": "string"
  77499. // },
  77500. // "router": {
  77501. // "description": "Name of the Router resource to update.",
  77502. // "location": "path",
  77503. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77504. // "required": true,
  77505. // "type": "string"
  77506. // }
  77507. // },
  77508. // "path": "{project}/regions/{region}/routers/{router}",
  77509. // "request": {
  77510. // "$ref": "Router"
  77511. // },
  77512. // "response": {
  77513. // "$ref": "Operation"
  77514. // },
  77515. // "scopes": [
  77516. // "https://www.googleapis.com/auth/cloud-platform",
  77517. // "https://www.googleapis.com/auth/compute"
  77518. // ]
  77519. // }
  77520. }
  77521. // method id "compute.routes.delete":
  77522. type RoutesDeleteCall struct {
  77523. s *Service
  77524. project string
  77525. route string
  77526. urlParams_ gensupport.URLParams
  77527. ctx_ context.Context
  77528. header_ http.Header
  77529. }
  77530. // Delete: Deletes the specified Route resource.
  77531. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  77532. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  77533. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77534. c.project = project
  77535. c.route = route
  77536. return c
  77537. }
  77538. // RequestId sets the optional parameter "requestId": An optional
  77539. // request ID to identify requests. Specify a unique request ID so that
  77540. // if you must retry your request, the server will know to ignore the
  77541. // request if it has already been completed.
  77542. //
  77543. // For example, consider a situation where you make an initial request
  77544. // and the request times out. If you make the request again with the
  77545. // same request ID, the server can check if original operation with the
  77546. // same request ID was received, and if so, will ignore the second
  77547. // request. This prevents clients from accidentally creating duplicate
  77548. // commitments.
  77549. //
  77550. // The request ID must be a valid UUID with the exception that zero UUID
  77551. // is not supported (00000000-0000-0000-0000-000000000000).
  77552. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  77553. c.urlParams_.Set("requestId", requestId)
  77554. return c
  77555. }
  77556. // Fields allows partial responses to be retrieved. See
  77557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77558. // for more information.
  77559. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  77560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77561. return c
  77562. }
  77563. // Context sets the context to be used in this call's Do method. Any
  77564. // pending HTTP request will be aborted if the provided context is
  77565. // canceled.
  77566. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  77567. c.ctx_ = ctx
  77568. return c
  77569. }
  77570. // Header returns an http.Header that can be modified by the caller to
  77571. // add HTTP headers to the request.
  77572. func (c *RoutesDeleteCall) Header() http.Header {
  77573. if c.header_ == nil {
  77574. c.header_ = make(http.Header)
  77575. }
  77576. return c.header_
  77577. }
  77578. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  77579. reqHeaders := make(http.Header)
  77580. for k, v := range c.header_ {
  77581. reqHeaders[k] = v
  77582. }
  77583. reqHeaders.Set("User-Agent", c.s.userAgent())
  77584. var body io.Reader = nil
  77585. c.urlParams_.Set("alt", alt)
  77586. c.urlParams_.Set("prettyPrint", "false")
  77587. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  77588. urls += "?" + c.urlParams_.Encode()
  77589. req, err := http.NewRequest("DELETE", urls, body)
  77590. if err != nil {
  77591. return nil, err
  77592. }
  77593. req.Header = reqHeaders
  77594. googleapi.Expand(req.URL, map[string]string{
  77595. "project": c.project,
  77596. "route": c.route,
  77597. })
  77598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77599. }
  77600. // Do executes the "compute.routes.delete" call.
  77601. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77602. // status code is an error. Response headers are in either
  77603. // *Operation.ServerResponse.Header or (if a response was returned at
  77604. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77605. // to check whether the returned error was because
  77606. // http.StatusNotModified was returned.
  77607. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77608. gensupport.SetOptions(c.urlParams_, opts...)
  77609. res, err := c.doRequest("json")
  77610. if res != nil && res.StatusCode == http.StatusNotModified {
  77611. if res.Body != nil {
  77612. res.Body.Close()
  77613. }
  77614. return nil, &googleapi.Error{
  77615. Code: res.StatusCode,
  77616. Header: res.Header,
  77617. }
  77618. }
  77619. if err != nil {
  77620. return nil, err
  77621. }
  77622. defer googleapi.CloseBody(res)
  77623. if err := googleapi.CheckResponse(res); err != nil {
  77624. return nil, err
  77625. }
  77626. ret := &Operation{
  77627. ServerResponse: googleapi.ServerResponse{
  77628. Header: res.Header,
  77629. HTTPStatusCode: res.StatusCode,
  77630. },
  77631. }
  77632. target := &ret
  77633. if err := gensupport.DecodeResponse(target, res); err != nil {
  77634. return nil, err
  77635. }
  77636. return ret, nil
  77637. // {
  77638. // "description": "Deletes the specified Route resource.",
  77639. // "httpMethod": "DELETE",
  77640. // "id": "compute.routes.delete",
  77641. // "parameterOrder": [
  77642. // "project",
  77643. // "route"
  77644. // ],
  77645. // "parameters": {
  77646. // "project": {
  77647. // "description": "Project ID for this request.",
  77648. // "location": "path",
  77649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77650. // "required": true,
  77651. // "type": "string"
  77652. // },
  77653. // "requestId": {
  77654. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77655. // "location": "query",
  77656. // "type": "string"
  77657. // },
  77658. // "route": {
  77659. // "description": "Name of the Route resource to delete.",
  77660. // "location": "path",
  77661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77662. // "required": true,
  77663. // "type": "string"
  77664. // }
  77665. // },
  77666. // "path": "{project}/global/routes/{route}",
  77667. // "response": {
  77668. // "$ref": "Operation"
  77669. // },
  77670. // "scopes": [
  77671. // "https://www.googleapis.com/auth/cloud-platform",
  77672. // "https://www.googleapis.com/auth/compute"
  77673. // ]
  77674. // }
  77675. }
  77676. // method id "compute.routes.get":
  77677. type RoutesGetCall struct {
  77678. s *Service
  77679. project string
  77680. route string
  77681. urlParams_ gensupport.URLParams
  77682. ifNoneMatch_ string
  77683. ctx_ context.Context
  77684. header_ http.Header
  77685. }
  77686. // Get: Returns the specified Route resource. Gets a list of available
  77687. // routes by making a list() request.
  77688. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  77689. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  77690. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77691. c.project = project
  77692. c.route = route
  77693. return c
  77694. }
  77695. // Fields allows partial responses to be retrieved. See
  77696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77697. // for more information.
  77698. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  77699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77700. return c
  77701. }
  77702. // IfNoneMatch sets the optional parameter which makes the operation
  77703. // fail if the object's ETag matches the given value. This is useful for
  77704. // getting updates only after the object has changed since the last
  77705. // request. Use googleapi.IsNotModified to check whether the response
  77706. // error from Do is the result of In-None-Match.
  77707. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  77708. c.ifNoneMatch_ = entityTag
  77709. return c
  77710. }
  77711. // Context sets the context to be used in this call's Do method. Any
  77712. // pending HTTP request will be aborted if the provided context is
  77713. // canceled.
  77714. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  77715. c.ctx_ = ctx
  77716. return c
  77717. }
  77718. // Header returns an http.Header that can be modified by the caller to
  77719. // add HTTP headers to the request.
  77720. func (c *RoutesGetCall) Header() http.Header {
  77721. if c.header_ == nil {
  77722. c.header_ = make(http.Header)
  77723. }
  77724. return c.header_
  77725. }
  77726. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  77727. reqHeaders := make(http.Header)
  77728. for k, v := range c.header_ {
  77729. reqHeaders[k] = v
  77730. }
  77731. reqHeaders.Set("User-Agent", c.s.userAgent())
  77732. if c.ifNoneMatch_ != "" {
  77733. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77734. }
  77735. var body io.Reader = nil
  77736. c.urlParams_.Set("alt", alt)
  77737. c.urlParams_.Set("prettyPrint", "false")
  77738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  77739. urls += "?" + c.urlParams_.Encode()
  77740. req, err := http.NewRequest("GET", urls, body)
  77741. if err != nil {
  77742. return nil, err
  77743. }
  77744. req.Header = reqHeaders
  77745. googleapi.Expand(req.URL, map[string]string{
  77746. "project": c.project,
  77747. "route": c.route,
  77748. })
  77749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77750. }
  77751. // Do executes the "compute.routes.get" call.
  77752. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  77753. // code is an error. Response headers are in either
  77754. // *Route.ServerResponse.Header or (if a response was returned at all)
  77755. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77756. // check whether the returned error was because http.StatusNotModified
  77757. // was returned.
  77758. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  77759. gensupport.SetOptions(c.urlParams_, opts...)
  77760. res, err := c.doRequest("json")
  77761. if res != nil && res.StatusCode == http.StatusNotModified {
  77762. if res.Body != nil {
  77763. res.Body.Close()
  77764. }
  77765. return nil, &googleapi.Error{
  77766. Code: res.StatusCode,
  77767. Header: res.Header,
  77768. }
  77769. }
  77770. if err != nil {
  77771. return nil, err
  77772. }
  77773. defer googleapi.CloseBody(res)
  77774. if err := googleapi.CheckResponse(res); err != nil {
  77775. return nil, err
  77776. }
  77777. ret := &Route{
  77778. ServerResponse: googleapi.ServerResponse{
  77779. Header: res.Header,
  77780. HTTPStatusCode: res.StatusCode,
  77781. },
  77782. }
  77783. target := &ret
  77784. if err := gensupport.DecodeResponse(target, res); err != nil {
  77785. return nil, err
  77786. }
  77787. return ret, nil
  77788. // {
  77789. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  77790. // "httpMethod": "GET",
  77791. // "id": "compute.routes.get",
  77792. // "parameterOrder": [
  77793. // "project",
  77794. // "route"
  77795. // ],
  77796. // "parameters": {
  77797. // "project": {
  77798. // "description": "Project ID for this request.",
  77799. // "location": "path",
  77800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77801. // "required": true,
  77802. // "type": "string"
  77803. // },
  77804. // "route": {
  77805. // "description": "Name of the Route resource to return.",
  77806. // "location": "path",
  77807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77808. // "required": true,
  77809. // "type": "string"
  77810. // }
  77811. // },
  77812. // "path": "{project}/global/routes/{route}",
  77813. // "response": {
  77814. // "$ref": "Route"
  77815. // },
  77816. // "scopes": [
  77817. // "https://www.googleapis.com/auth/cloud-platform",
  77818. // "https://www.googleapis.com/auth/compute",
  77819. // "https://www.googleapis.com/auth/compute.readonly"
  77820. // ]
  77821. // }
  77822. }
  77823. // method id "compute.routes.insert":
  77824. type RoutesInsertCall struct {
  77825. s *Service
  77826. project string
  77827. route *Route
  77828. urlParams_ gensupport.URLParams
  77829. ctx_ context.Context
  77830. header_ http.Header
  77831. }
  77832. // Insert: Creates a Route resource in the specified project using the
  77833. // data included in the request.
  77834. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  77835. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  77836. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77837. c.project = project
  77838. c.route = route
  77839. return c
  77840. }
  77841. // RequestId sets the optional parameter "requestId": An optional
  77842. // request ID to identify requests. Specify a unique request ID so that
  77843. // if you must retry your request, the server will know to ignore the
  77844. // request if it has already been completed.
  77845. //
  77846. // For example, consider a situation where you make an initial request
  77847. // and the request times out. If you make the request again with the
  77848. // same request ID, the server can check if original operation with the
  77849. // same request ID was received, and if so, will ignore the second
  77850. // request. This prevents clients from accidentally creating duplicate
  77851. // commitments.
  77852. //
  77853. // The request ID must be a valid UUID with the exception that zero UUID
  77854. // is not supported (00000000-0000-0000-0000-000000000000).
  77855. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  77856. c.urlParams_.Set("requestId", requestId)
  77857. return c
  77858. }
  77859. // Fields allows partial responses to be retrieved. See
  77860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77861. // for more information.
  77862. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  77863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77864. return c
  77865. }
  77866. // Context sets the context to be used in this call's Do method. Any
  77867. // pending HTTP request will be aborted if the provided context is
  77868. // canceled.
  77869. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  77870. c.ctx_ = ctx
  77871. return c
  77872. }
  77873. // Header returns an http.Header that can be modified by the caller to
  77874. // add HTTP headers to the request.
  77875. func (c *RoutesInsertCall) Header() http.Header {
  77876. if c.header_ == nil {
  77877. c.header_ = make(http.Header)
  77878. }
  77879. return c.header_
  77880. }
  77881. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  77882. reqHeaders := make(http.Header)
  77883. for k, v := range c.header_ {
  77884. reqHeaders[k] = v
  77885. }
  77886. reqHeaders.Set("User-Agent", c.s.userAgent())
  77887. var body io.Reader = nil
  77888. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  77889. if err != nil {
  77890. return nil, err
  77891. }
  77892. reqHeaders.Set("Content-Type", "application/json")
  77893. c.urlParams_.Set("alt", alt)
  77894. c.urlParams_.Set("prettyPrint", "false")
  77895. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  77896. urls += "?" + c.urlParams_.Encode()
  77897. req, err := http.NewRequest("POST", urls, body)
  77898. if err != nil {
  77899. return nil, err
  77900. }
  77901. req.Header = reqHeaders
  77902. googleapi.Expand(req.URL, map[string]string{
  77903. "project": c.project,
  77904. })
  77905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77906. }
  77907. // Do executes the "compute.routes.insert" call.
  77908. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77909. // status code is an error. Response headers are in either
  77910. // *Operation.ServerResponse.Header or (if a response was returned at
  77911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77912. // to check whether the returned error was because
  77913. // http.StatusNotModified was returned.
  77914. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77915. gensupport.SetOptions(c.urlParams_, opts...)
  77916. res, err := c.doRequest("json")
  77917. if res != nil && res.StatusCode == http.StatusNotModified {
  77918. if res.Body != nil {
  77919. res.Body.Close()
  77920. }
  77921. return nil, &googleapi.Error{
  77922. Code: res.StatusCode,
  77923. Header: res.Header,
  77924. }
  77925. }
  77926. if err != nil {
  77927. return nil, err
  77928. }
  77929. defer googleapi.CloseBody(res)
  77930. if err := googleapi.CheckResponse(res); err != nil {
  77931. return nil, err
  77932. }
  77933. ret := &Operation{
  77934. ServerResponse: googleapi.ServerResponse{
  77935. Header: res.Header,
  77936. HTTPStatusCode: res.StatusCode,
  77937. },
  77938. }
  77939. target := &ret
  77940. if err := gensupport.DecodeResponse(target, res); err != nil {
  77941. return nil, err
  77942. }
  77943. return ret, nil
  77944. // {
  77945. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  77946. // "httpMethod": "POST",
  77947. // "id": "compute.routes.insert",
  77948. // "parameterOrder": [
  77949. // "project"
  77950. // ],
  77951. // "parameters": {
  77952. // "project": {
  77953. // "description": "Project ID for this request.",
  77954. // "location": "path",
  77955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77956. // "required": true,
  77957. // "type": "string"
  77958. // },
  77959. // "requestId": {
  77960. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77961. // "location": "query",
  77962. // "type": "string"
  77963. // }
  77964. // },
  77965. // "path": "{project}/global/routes",
  77966. // "request": {
  77967. // "$ref": "Route"
  77968. // },
  77969. // "response": {
  77970. // "$ref": "Operation"
  77971. // },
  77972. // "scopes": [
  77973. // "https://www.googleapis.com/auth/cloud-platform",
  77974. // "https://www.googleapis.com/auth/compute"
  77975. // ]
  77976. // }
  77977. }
  77978. // method id "compute.routes.list":
  77979. type RoutesListCall struct {
  77980. s *Service
  77981. project string
  77982. urlParams_ gensupport.URLParams
  77983. ifNoneMatch_ string
  77984. ctx_ context.Context
  77985. header_ http.Header
  77986. }
  77987. // List: Retrieves the list of Route resources available to the
  77988. // specified project.
  77989. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  77990. func (r *RoutesService) List(project string) *RoutesListCall {
  77991. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77992. c.project = project
  77993. return c
  77994. }
  77995. // Filter sets the optional parameter "filter": A filter expression that
  77996. // filters resources listed in the response. The expression must specify
  77997. // the field name, a comparison operator, and the value that you want to
  77998. // use for filtering. The value must be a string, a number, or a
  77999. // boolean. The comparison operator must be either =, !=, >, or <.
  78000. //
  78001. // For example, if you are filtering Compute Engine instances, you can
  78002. // exclude instances named example-instance by specifying name !=
  78003. // example-instance.
  78004. //
  78005. // You can also filter nested fields. For example, you could specify
  78006. // scheduling.automaticRestart = false to include instances only if they
  78007. // are not scheduled for automatic restarts. You can use filtering on
  78008. // nested fields to filter based on resource labels.
  78009. //
  78010. // To filter on multiple expressions, provide each separate expression
  78011. // within parentheses. For example, (scheduling.automaticRestart = true)
  78012. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78013. // AND expression. However, you can include AND and OR expressions
  78014. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78015. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78016. // true).
  78017. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  78018. c.urlParams_.Set("filter", filter)
  78019. return c
  78020. }
  78021. // MaxResults sets the optional parameter "maxResults": The maximum
  78022. // number of results per page that should be returned. If the number of
  78023. // available results is larger than maxResults, Compute Engine returns a
  78024. // nextPageToken that can be used to get the next page of results in
  78025. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78026. // (Default: 500)
  78027. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  78028. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78029. return c
  78030. }
  78031. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78032. // a certain order. By default, results are returned in alphanumerical
  78033. // order based on the resource name.
  78034. //
  78035. // You can also sort results in descending order based on the creation
  78036. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78037. // based on the creationTimestamp field in reverse chronological order
  78038. // (newest result first). Use this to sort resources like operations so
  78039. // that the newest operation is returned first.
  78040. //
  78041. // Currently, only sorting by name or creationTimestamp desc is
  78042. // supported.
  78043. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  78044. c.urlParams_.Set("orderBy", orderBy)
  78045. return c
  78046. }
  78047. // PageToken sets the optional parameter "pageToken": Specifies a page
  78048. // token to use. Set pageToken to the nextPageToken returned by a
  78049. // previous list request to get the next page of results.
  78050. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  78051. c.urlParams_.Set("pageToken", pageToken)
  78052. return c
  78053. }
  78054. // Fields allows partial responses to be retrieved. See
  78055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78056. // for more information.
  78057. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  78058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78059. return c
  78060. }
  78061. // IfNoneMatch sets the optional parameter which makes the operation
  78062. // fail if the object's ETag matches the given value. This is useful for
  78063. // getting updates only after the object has changed since the last
  78064. // request. Use googleapi.IsNotModified to check whether the response
  78065. // error from Do is the result of In-None-Match.
  78066. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  78067. c.ifNoneMatch_ = entityTag
  78068. return c
  78069. }
  78070. // Context sets the context to be used in this call's Do method. Any
  78071. // pending HTTP request will be aborted if the provided context is
  78072. // canceled.
  78073. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  78074. c.ctx_ = ctx
  78075. return c
  78076. }
  78077. // Header returns an http.Header that can be modified by the caller to
  78078. // add HTTP headers to the request.
  78079. func (c *RoutesListCall) Header() http.Header {
  78080. if c.header_ == nil {
  78081. c.header_ = make(http.Header)
  78082. }
  78083. return c.header_
  78084. }
  78085. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  78086. reqHeaders := make(http.Header)
  78087. for k, v := range c.header_ {
  78088. reqHeaders[k] = v
  78089. }
  78090. reqHeaders.Set("User-Agent", c.s.userAgent())
  78091. if c.ifNoneMatch_ != "" {
  78092. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78093. }
  78094. var body io.Reader = nil
  78095. c.urlParams_.Set("alt", alt)
  78096. c.urlParams_.Set("prettyPrint", "false")
  78097. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  78098. urls += "?" + c.urlParams_.Encode()
  78099. req, err := http.NewRequest("GET", urls, body)
  78100. if err != nil {
  78101. return nil, err
  78102. }
  78103. req.Header = reqHeaders
  78104. googleapi.Expand(req.URL, map[string]string{
  78105. "project": c.project,
  78106. })
  78107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78108. }
  78109. // Do executes the "compute.routes.list" call.
  78110. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  78111. // status code is an error. Response headers are in either
  78112. // *RouteList.ServerResponse.Header or (if a response was returned at
  78113. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78114. // to check whether the returned error was because
  78115. // http.StatusNotModified was returned.
  78116. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  78117. gensupport.SetOptions(c.urlParams_, opts...)
  78118. res, err := c.doRequest("json")
  78119. if res != nil && res.StatusCode == http.StatusNotModified {
  78120. if res.Body != nil {
  78121. res.Body.Close()
  78122. }
  78123. return nil, &googleapi.Error{
  78124. Code: res.StatusCode,
  78125. Header: res.Header,
  78126. }
  78127. }
  78128. if err != nil {
  78129. return nil, err
  78130. }
  78131. defer googleapi.CloseBody(res)
  78132. if err := googleapi.CheckResponse(res); err != nil {
  78133. return nil, err
  78134. }
  78135. ret := &RouteList{
  78136. ServerResponse: googleapi.ServerResponse{
  78137. Header: res.Header,
  78138. HTTPStatusCode: res.StatusCode,
  78139. },
  78140. }
  78141. target := &ret
  78142. if err := gensupport.DecodeResponse(target, res); err != nil {
  78143. return nil, err
  78144. }
  78145. return ret, nil
  78146. // {
  78147. // "description": "Retrieves the list of Route resources available to the specified project.",
  78148. // "httpMethod": "GET",
  78149. // "id": "compute.routes.list",
  78150. // "parameterOrder": [
  78151. // "project"
  78152. // ],
  78153. // "parameters": {
  78154. // "filter": {
  78155. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78156. // "location": "query",
  78157. // "type": "string"
  78158. // },
  78159. // "maxResults": {
  78160. // "default": "500",
  78161. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78162. // "format": "uint32",
  78163. // "location": "query",
  78164. // "minimum": "0",
  78165. // "type": "integer"
  78166. // },
  78167. // "orderBy": {
  78168. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78169. // "location": "query",
  78170. // "type": "string"
  78171. // },
  78172. // "pageToken": {
  78173. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78174. // "location": "query",
  78175. // "type": "string"
  78176. // },
  78177. // "project": {
  78178. // "description": "Project ID for this request.",
  78179. // "location": "path",
  78180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78181. // "required": true,
  78182. // "type": "string"
  78183. // }
  78184. // },
  78185. // "path": "{project}/global/routes",
  78186. // "response": {
  78187. // "$ref": "RouteList"
  78188. // },
  78189. // "scopes": [
  78190. // "https://www.googleapis.com/auth/cloud-platform",
  78191. // "https://www.googleapis.com/auth/compute",
  78192. // "https://www.googleapis.com/auth/compute.readonly"
  78193. // ]
  78194. // }
  78195. }
  78196. // Pages invokes f for each page of results.
  78197. // A non-nil error returned from f will halt the iteration.
  78198. // The provided context supersedes any context provided to the Context method.
  78199. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  78200. c.ctx_ = ctx
  78201. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78202. for {
  78203. x, err := c.Do()
  78204. if err != nil {
  78205. return err
  78206. }
  78207. if err := f(x); err != nil {
  78208. return err
  78209. }
  78210. if x.NextPageToken == "" {
  78211. return nil
  78212. }
  78213. c.PageToken(x.NextPageToken)
  78214. }
  78215. }
  78216. // method id "compute.securityPolicies.addRule":
  78217. type SecurityPoliciesAddRuleCall struct {
  78218. s *Service
  78219. project string
  78220. securityPolicy string
  78221. securitypolicyrule *SecurityPolicyRule
  78222. urlParams_ gensupport.URLParams
  78223. ctx_ context.Context
  78224. header_ http.Header
  78225. }
  78226. // AddRule: Inserts a rule into a security policy.
  78227. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  78228. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78229. c.project = project
  78230. c.securityPolicy = securityPolicy
  78231. c.securitypolicyrule = securitypolicyrule
  78232. return c
  78233. }
  78234. // Fields allows partial responses to be retrieved. See
  78235. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78236. // for more information.
  78237. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  78238. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78239. return c
  78240. }
  78241. // Context sets the context to be used in this call's Do method. Any
  78242. // pending HTTP request will be aborted if the provided context is
  78243. // canceled.
  78244. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  78245. c.ctx_ = ctx
  78246. return c
  78247. }
  78248. // Header returns an http.Header that can be modified by the caller to
  78249. // add HTTP headers to the request.
  78250. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  78251. if c.header_ == nil {
  78252. c.header_ = make(http.Header)
  78253. }
  78254. return c.header_
  78255. }
  78256. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  78257. reqHeaders := make(http.Header)
  78258. for k, v := range c.header_ {
  78259. reqHeaders[k] = v
  78260. }
  78261. reqHeaders.Set("User-Agent", c.s.userAgent())
  78262. var body io.Reader = nil
  78263. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  78264. if err != nil {
  78265. return nil, err
  78266. }
  78267. reqHeaders.Set("Content-Type", "application/json")
  78268. c.urlParams_.Set("alt", alt)
  78269. c.urlParams_.Set("prettyPrint", "false")
  78270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  78271. urls += "?" + c.urlParams_.Encode()
  78272. req, err := http.NewRequest("POST", urls, body)
  78273. if err != nil {
  78274. return nil, err
  78275. }
  78276. req.Header = reqHeaders
  78277. googleapi.Expand(req.URL, map[string]string{
  78278. "project": c.project,
  78279. "securityPolicy": c.securityPolicy,
  78280. })
  78281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78282. }
  78283. // Do executes the "compute.securityPolicies.addRule" call.
  78284. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78285. // status code is an error. Response headers are in either
  78286. // *Operation.ServerResponse.Header or (if a response was returned at
  78287. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78288. // to check whether the returned error was because
  78289. // http.StatusNotModified was returned.
  78290. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78291. gensupport.SetOptions(c.urlParams_, opts...)
  78292. res, err := c.doRequest("json")
  78293. if res != nil && res.StatusCode == http.StatusNotModified {
  78294. if res.Body != nil {
  78295. res.Body.Close()
  78296. }
  78297. return nil, &googleapi.Error{
  78298. Code: res.StatusCode,
  78299. Header: res.Header,
  78300. }
  78301. }
  78302. if err != nil {
  78303. return nil, err
  78304. }
  78305. defer googleapi.CloseBody(res)
  78306. if err := googleapi.CheckResponse(res); err != nil {
  78307. return nil, err
  78308. }
  78309. ret := &Operation{
  78310. ServerResponse: googleapi.ServerResponse{
  78311. Header: res.Header,
  78312. HTTPStatusCode: res.StatusCode,
  78313. },
  78314. }
  78315. target := &ret
  78316. if err := gensupport.DecodeResponse(target, res); err != nil {
  78317. return nil, err
  78318. }
  78319. return ret, nil
  78320. // {
  78321. // "description": "Inserts a rule into a security policy.",
  78322. // "httpMethod": "POST",
  78323. // "id": "compute.securityPolicies.addRule",
  78324. // "parameterOrder": [
  78325. // "project",
  78326. // "securityPolicy"
  78327. // ],
  78328. // "parameters": {
  78329. // "project": {
  78330. // "description": "Project ID for this request.",
  78331. // "location": "path",
  78332. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78333. // "required": true,
  78334. // "type": "string"
  78335. // },
  78336. // "securityPolicy": {
  78337. // "description": "Name of the security policy to update.",
  78338. // "location": "path",
  78339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78340. // "required": true,
  78341. // "type": "string"
  78342. // }
  78343. // },
  78344. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  78345. // "request": {
  78346. // "$ref": "SecurityPolicyRule"
  78347. // },
  78348. // "response": {
  78349. // "$ref": "Operation"
  78350. // },
  78351. // "scopes": [
  78352. // "https://www.googleapis.com/auth/cloud-platform",
  78353. // "https://www.googleapis.com/auth/compute"
  78354. // ]
  78355. // }
  78356. }
  78357. // method id "compute.securityPolicies.delete":
  78358. type SecurityPoliciesDeleteCall struct {
  78359. s *Service
  78360. project string
  78361. securityPolicy string
  78362. urlParams_ gensupport.URLParams
  78363. ctx_ context.Context
  78364. header_ http.Header
  78365. }
  78366. // Delete: Deletes the specified policy.
  78367. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  78368. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78369. c.project = project
  78370. c.securityPolicy = securityPolicy
  78371. return c
  78372. }
  78373. // RequestId sets the optional parameter "requestId": An optional
  78374. // request ID to identify requests. Specify a unique request ID so that
  78375. // if you must retry your request, the server will know to ignore the
  78376. // request if it has already been completed.
  78377. //
  78378. // For example, consider a situation where you make an initial request
  78379. // and the request times out. If you make the request again with the
  78380. // same request ID, the server can check if original operation with the
  78381. // same request ID was received, and if so, will ignore the second
  78382. // request. This prevents clients from accidentally creating duplicate
  78383. // commitments.
  78384. //
  78385. // The request ID must be a valid UUID with the exception that zero UUID
  78386. // is not supported (00000000-0000-0000-0000-000000000000).
  78387. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  78388. c.urlParams_.Set("requestId", requestId)
  78389. return c
  78390. }
  78391. // Fields allows partial responses to be retrieved. See
  78392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78393. // for more information.
  78394. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  78395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78396. return c
  78397. }
  78398. // Context sets the context to be used in this call's Do method. Any
  78399. // pending HTTP request will be aborted if the provided context is
  78400. // canceled.
  78401. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  78402. c.ctx_ = ctx
  78403. return c
  78404. }
  78405. // Header returns an http.Header that can be modified by the caller to
  78406. // add HTTP headers to the request.
  78407. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  78408. if c.header_ == nil {
  78409. c.header_ = make(http.Header)
  78410. }
  78411. return c.header_
  78412. }
  78413. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  78414. reqHeaders := make(http.Header)
  78415. for k, v := range c.header_ {
  78416. reqHeaders[k] = v
  78417. }
  78418. reqHeaders.Set("User-Agent", c.s.userAgent())
  78419. var body io.Reader = nil
  78420. c.urlParams_.Set("alt", alt)
  78421. c.urlParams_.Set("prettyPrint", "false")
  78422. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  78423. urls += "?" + c.urlParams_.Encode()
  78424. req, err := http.NewRequest("DELETE", urls, body)
  78425. if err != nil {
  78426. return nil, err
  78427. }
  78428. req.Header = reqHeaders
  78429. googleapi.Expand(req.URL, map[string]string{
  78430. "project": c.project,
  78431. "securityPolicy": c.securityPolicy,
  78432. })
  78433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78434. }
  78435. // Do executes the "compute.securityPolicies.delete" call.
  78436. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78437. // status code is an error. Response headers are in either
  78438. // *Operation.ServerResponse.Header or (if a response was returned at
  78439. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78440. // to check whether the returned error was because
  78441. // http.StatusNotModified was returned.
  78442. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78443. gensupport.SetOptions(c.urlParams_, opts...)
  78444. res, err := c.doRequest("json")
  78445. if res != nil && res.StatusCode == http.StatusNotModified {
  78446. if res.Body != nil {
  78447. res.Body.Close()
  78448. }
  78449. return nil, &googleapi.Error{
  78450. Code: res.StatusCode,
  78451. Header: res.Header,
  78452. }
  78453. }
  78454. if err != nil {
  78455. return nil, err
  78456. }
  78457. defer googleapi.CloseBody(res)
  78458. if err := googleapi.CheckResponse(res); err != nil {
  78459. return nil, err
  78460. }
  78461. ret := &Operation{
  78462. ServerResponse: googleapi.ServerResponse{
  78463. Header: res.Header,
  78464. HTTPStatusCode: res.StatusCode,
  78465. },
  78466. }
  78467. target := &ret
  78468. if err := gensupport.DecodeResponse(target, res); err != nil {
  78469. return nil, err
  78470. }
  78471. return ret, nil
  78472. // {
  78473. // "description": "Deletes the specified policy.",
  78474. // "httpMethod": "DELETE",
  78475. // "id": "compute.securityPolicies.delete",
  78476. // "parameterOrder": [
  78477. // "project",
  78478. // "securityPolicy"
  78479. // ],
  78480. // "parameters": {
  78481. // "project": {
  78482. // "description": "Project ID for this request.",
  78483. // "location": "path",
  78484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78485. // "required": true,
  78486. // "type": "string"
  78487. // },
  78488. // "requestId": {
  78489. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78490. // "location": "query",
  78491. // "type": "string"
  78492. // },
  78493. // "securityPolicy": {
  78494. // "description": "Name of the security policy to delete.",
  78495. // "location": "path",
  78496. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78497. // "required": true,
  78498. // "type": "string"
  78499. // }
  78500. // },
  78501. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  78502. // "response": {
  78503. // "$ref": "Operation"
  78504. // },
  78505. // "scopes": [
  78506. // "https://www.googleapis.com/auth/cloud-platform",
  78507. // "https://www.googleapis.com/auth/compute"
  78508. // ]
  78509. // }
  78510. }
  78511. // method id "compute.securityPolicies.get":
  78512. type SecurityPoliciesGetCall struct {
  78513. s *Service
  78514. project string
  78515. securityPolicy string
  78516. urlParams_ gensupport.URLParams
  78517. ifNoneMatch_ string
  78518. ctx_ context.Context
  78519. header_ http.Header
  78520. }
  78521. // Get: List all of the ordered rules present in a single specified
  78522. // policy.
  78523. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  78524. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78525. c.project = project
  78526. c.securityPolicy = securityPolicy
  78527. return c
  78528. }
  78529. // Fields allows partial responses to be retrieved. See
  78530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78531. // for more information.
  78532. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  78533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78534. return c
  78535. }
  78536. // IfNoneMatch sets the optional parameter which makes the operation
  78537. // fail if the object's ETag matches the given value. This is useful for
  78538. // getting updates only after the object has changed since the last
  78539. // request. Use googleapi.IsNotModified to check whether the response
  78540. // error from Do is the result of In-None-Match.
  78541. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  78542. c.ifNoneMatch_ = entityTag
  78543. return c
  78544. }
  78545. // Context sets the context to be used in this call's Do method. Any
  78546. // pending HTTP request will be aborted if the provided context is
  78547. // canceled.
  78548. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  78549. c.ctx_ = ctx
  78550. return c
  78551. }
  78552. // Header returns an http.Header that can be modified by the caller to
  78553. // add HTTP headers to the request.
  78554. func (c *SecurityPoliciesGetCall) Header() http.Header {
  78555. if c.header_ == nil {
  78556. c.header_ = make(http.Header)
  78557. }
  78558. return c.header_
  78559. }
  78560. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  78561. reqHeaders := make(http.Header)
  78562. for k, v := range c.header_ {
  78563. reqHeaders[k] = v
  78564. }
  78565. reqHeaders.Set("User-Agent", c.s.userAgent())
  78566. if c.ifNoneMatch_ != "" {
  78567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78568. }
  78569. var body io.Reader = nil
  78570. c.urlParams_.Set("alt", alt)
  78571. c.urlParams_.Set("prettyPrint", "false")
  78572. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  78573. urls += "?" + c.urlParams_.Encode()
  78574. req, err := http.NewRequest("GET", urls, body)
  78575. if err != nil {
  78576. return nil, err
  78577. }
  78578. req.Header = reqHeaders
  78579. googleapi.Expand(req.URL, map[string]string{
  78580. "project": c.project,
  78581. "securityPolicy": c.securityPolicy,
  78582. })
  78583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78584. }
  78585. // Do executes the "compute.securityPolicies.get" call.
  78586. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  78587. // status code is an error. Response headers are in either
  78588. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  78589. // at all) in error.(*googleapi.Error).Header. Use
  78590. // googleapi.IsNotModified to check whether the returned error was
  78591. // because http.StatusNotModified was returned.
  78592. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  78593. gensupport.SetOptions(c.urlParams_, opts...)
  78594. res, err := c.doRequest("json")
  78595. if res != nil && res.StatusCode == http.StatusNotModified {
  78596. if res.Body != nil {
  78597. res.Body.Close()
  78598. }
  78599. return nil, &googleapi.Error{
  78600. Code: res.StatusCode,
  78601. Header: res.Header,
  78602. }
  78603. }
  78604. if err != nil {
  78605. return nil, err
  78606. }
  78607. defer googleapi.CloseBody(res)
  78608. if err := googleapi.CheckResponse(res); err != nil {
  78609. return nil, err
  78610. }
  78611. ret := &SecurityPolicy{
  78612. ServerResponse: googleapi.ServerResponse{
  78613. Header: res.Header,
  78614. HTTPStatusCode: res.StatusCode,
  78615. },
  78616. }
  78617. target := &ret
  78618. if err := gensupport.DecodeResponse(target, res); err != nil {
  78619. return nil, err
  78620. }
  78621. return ret, nil
  78622. // {
  78623. // "description": "List all of the ordered rules present in a single specified policy.",
  78624. // "httpMethod": "GET",
  78625. // "id": "compute.securityPolicies.get",
  78626. // "parameterOrder": [
  78627. // "project",
  78628. // "securityPolicy"
  78629. // ],
  78630. // "parameters": {
  78631. // "project": {
  78632. // "description": "Project ID for this request.",
  78633. // "location": "path",
  78634. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78635. // "required": true,
  78636. // "type": "string"
  78637. // },
  78638. // "securityPolicy": {
  78639. // "description": "Name of the security policy to get.",
  78640. // "location": "path",
  78641. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78642. // "required": true,
  78643. // "type": "string"
  78644. // }
  78645. // },
  78646. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  78647. // "response": {
  78648. // "$ref": "SecurityPolicy"
  78649. // },
  78650. // "scopes": [
  78651. // "https://www.googleapis.com/auth/cloud-platform",
  78652. // "https://www.googleapis.com/auth/compute",
  78653. // "https://www.googleapis.com/auth/compute.readonly"
  78654. // ]
  78655. // }
  78656. }
  78657. // method id "compute.securityPolicies.getRule":
  78658. type SecurityPoliciesGetRuleCall struct {
  78659. s *Service
  78660. project string
  78661. securityPolicy string
  78662. urlParams_ gensupport.URLParams
  78663. ifNoneMatch_ string
  78664. ctx_ context.Context
  78665. header_ http.Header
  78666. }
  78667. // GetRule: Gets a rule at the specified priority.
  78668. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  78669. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78670. c.project = project
  78671. c.securityPolicy = securityPolicy
  78672. return c
  78673. }
  78674. // Priority sets the optional parameter "priority": The priority of the
  78675. // rule to get from the security policy.
  78676. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  78677. c.urlParams_.Set("priority", fmt.Sprint(priority))
  78678. return c
  78679. }
  78680. // Fields allows partial responses to be retrieved. See
  78681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78682. // for more information.
  78683. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  78684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78685. return c
  78686. }
  78687. // IfNoneMatch sets the optional parameter which makes the operation
  78688. // fail if the object's ETag matches the given value. This is useful for
  78689. // getting updates only after the object has changed since the last
  78690. // request. Use googleapi.IsNotModified to check whether the response
  78691. // error from Do is the result of In-None-Match.
  78692. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  78693. c.ifNoneMatch_ = entityTag
  78694. return c
  78695. }
  78696. // Context sets the context to be used in this call's Do method. Any
  78697. // pending HTTP request will be aborted if the provided context is
  78698. // canceled.
  78699. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  78700. c.ctx_ = ctx
  78701. return c
  78702. }
  78703. // Header returns an http.Header that can be modified by the caller to
  78704. // add HTTP headers to the request.
  78705. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  78706. if c.header_ == nil {
  78707. c.header_ = make(http.Header)
  78708. }
  78709. return c.header_
  78710. }
  78711. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  78712. reqHeaders := make(http.Header)
  78713. for k, v := range c.header_ {
  78714. reqHeaders[k] = v
  78715. }
  78716. reqHeaders.Set("User-Agent", c.s.userAgent())
  78717. if c.ifNoneMatch_ != "" {
  78718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78719. }
  78720. var body io.Reader = nil
  78721. c.urlParams_.Set("alt", alt)
  78722. c.urlParams_.Set("prettyPrint", "false")
  78723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  78724. urls += "?" + c.urlParams_.Encode()
  78725. req, err := http.NewRequest("GET", urls, body)
  78726. if err != nil {
  78727. return nil, err
  78728. }
  78729. req.Header = reqHeaders
  78730. googleapi.Expand(req.URL, map[string]string{
  78731. "project": c.project,
  78732. "securityPolicy": c.securityPolicy,
  78733. })
  78734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78735. }
  78736. // Do executes the "compute.securityPolicies.getRule" call.
  78737. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  78738. // non-2xx status code is an error. Response headers are in either
  78739. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  78740. // returned at all) in error.(*googleapi.Error).Header. Use
  78741. // googleapi.IsNotModified to check whether the returned error was
  78742. // because http.StatusNotModified was returned.
  78743. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  78744. gensupport.SetOptions(c.urlParams_, opts...)
  78745. res, err := c.doRequest("json")
  78746. if res != nil && res.StatusCode == http.StatusNotModified {
  78747. if res.Body != nil {
  78748. res.Body.Close()
  78749. }
  78750. return nil, &googleapi.Error{
  78751. Code: res.StatusCode,
  78752. Header: res.Header,
  78753. }
  78754. }
  78755. if err != nil {
  78756. return nil, err
  78757. }
  78758. defer googleapi.CloseBody(res)
  78759. if err := googleapi.CheckResponse(res); err != nil {
  78760. return nil, err
  78761. }
  78762. ret := &SecurityPolicyRule{
  78763. ServerResponse: googleapi.ServerResponse{
  78764. Header: res.Header,
  78765. HTTPStatusCode: res.StatusCode,
  78766. },
  78767. }
  78768. target := &ret
  78769. if err := gensupport.DecodeResponse(target, res); err != nil {
  78770. return nil, err
  78771. }
  78772. return ret, nil
  78773. // {
  78774. // "description": "Gets a rule at the specified priority.",
  78775. // "httpMethod": "GET",
  78776. // "id": "compute.securityPolicies.getRule",
  78777. // "parameterOrder": [
  78778. // "project",
  78779. // "securityPolicy"
  78780. // ],
  78781. // "parameters": {
  78782. // "priority": {
  78783. // "description": "The priority of the rule to get from the security policy.",
  78784. // "format": "int32",
  78785. // "location": "query",
  78786. // "type": "integer"
  78787. // },
  78788. // "project": {
  78789. // "description": "Project ID for this request.",
  78790. // "location": "path",
  78791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78792. // "required": true,
  78793. // "type": "string"
  78794. // },
  78795. // "securityPolicy": {
  78796. // "description": "Name of the security policy to which the queried rule belongs.",
  78797. // "location": "path",
  78798. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78799. // "required": true,
  78800. // "type": "string"
  78801. // }
  78802. // },
  78803. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  78804. // "response": {
  78805. // "$ref": "SecurityPolicyRule"
  78806. // },
  78807. // "scopes": [
  78808. // "https://www.googleapis.com/auth/cloud-platform",
  78809. // "https://www.googleapis.com/auth/compute",
  78810. // "https://www.googleapis.com/auth/compute.readonly"
  78811. // ]
  78812. // }
  78813. }
  78814. // method id "compute.securityPolicies.insert":
  78815. type SecurityPoliciesInsertCall struct {
  78816. s *Service
  78817. project string
  78818. securitypolicy *SecurityPolicy
  78819. urlParams_ gensupport.URLParams
  78820. ctx_ context.Context
  78821. header_ http.Header
  78822. }
  78823. // Insert: Creates a new policy in the specified project using the data
  78824. // included in the request.
  78825. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  78826. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78827. c.project = project
  78828. c.securitypolicy = securitypolicy
  78829. return c
  78830. }
  78831. // RequestId sets the optional parameter "requestId": An optional
  78832. // request ID to identify requests. Specify a unique request ID so that
  78833. // if you must retry your request, the server will know to ignore the
  78834. // request if it has already been completed.
  78835. //
  78836. // For example, consider a situation where you make an initial request
  78837. // and the request times out. If you make the request again with the
  78838. // same request ID, the server can check if original operation with the
  78839. // same request ID was received, and if so, will ignore the second
  78840. // request. This prevents clients from accidentally creating duplicate
  78841. // commitments.
  78842. //
  78843. // The request ID must be a valid UUID with the exception that zero UUID
  78844. // is not supported (00000000-0000-0000-0000-000000000000).
  78845. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  78846. c.urlParams_.Set("requestId", requestId)
  78847. return c
  78848. }
  78849. // Fields allows partial responses to be retrieved. See
  78850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78851. // for more information.
  78852. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  78853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78854. return c
  78855. }
  78856. // Context sets the context to be used in this call's Do method. Any
  78857. // pending HTTP request will be aborted if the provided context is
  78858. // canceled.
  78859. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  78860. c.ctx_ = ctx
  78861. return c
  78862. }
  78863. // Header returns an http.Header that can be modified by the caller to
  78864. // add HTTP headers to the request.
  78865. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  78866. if c.header_ == nil {
  78867. c.header_ = make(http.Header)
  78868. }
  78869. return c.header_
  78870. }
  78871. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  78872. reqHeaders := make(http.Header)
  78873. for k, v := range c.header_ {
  78874. reqHeaders[k] = v
  78875. }
  78876. reqHeaders.Set("User-Agent", c.s.userAgent())
  78877. var body io.Reader = nil
  78878. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  78879. if err != nil {
  78880. return nil, err
  78881. }
  78882. reqHeaders.Set("Content-Type", "application/json")
  78883. c.urlParams_.Set("alt", alt)
  78884. c.urlParams_.Set("prettyPrint", "false")
  78885. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  78886. urls += "?" + c.urlParams_.Encode()
  78887. req, err := http.NewRequest("POST", urls, body)
  78888. if err != nil {
  78889. return nil, err
  78890. }
  78891. req.Header = reqHeaders
  78892. googleapi.Expand(req.URL, map[string]string{
  78893. "project": c.project,
  78894. })
  78895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78896. }
  78897. // Do executes the "compute.securityPolicies.insert" call.
  78898. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78899. // status code is an error. Response headers are in either
  78900. // *Operation.ServerResponse.Header or (if a response was returned at
  78901. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78902. // to check whether the returned error was because
  78903. // http.StatusNotModified was returned.
  78904. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78905. gensupport.SetOptions(c.urlParams_, opts...)
  78906. res, err := c.doRequest("json")
  78907. if res != nil && res.StatusCode == http.StatusNotModified {
  78908. if res.Body != nil {
  78909. res.Body.Close()
  78910. }
  78911. return nil, &googleapi.Error{
  78912. Code: res.StatusCode,
  78913. Header: res.Header,
  78914. }
  78915. }
  78916. if err != nil {
  78917. return nil, err
  78918. }
  78919. defer googleapi.CloseBody(res)
  78920. if err := googleapi.CheckResponse(res); err != nil {
  78921. return nil, err
  78922. }
  78923. ret := &Operation{
  78924. ServerResponse: googleapi.ServerResponse{
  78925. Header: res.Header,
  78926. HTTPStatusCode: res.StatusCode,
  78927. },
  78928. }
  78929. target := &ret
  78930. if err := gensupport.DecodeResponse(target, res); err != nil {
  78931. return nil, err
  78932. }
  78933. return ret, nil
  78934. // {
  78935. // "description": "Creates a new policy in the specified project using the data included in the request.",
  78936. // "httpMethod": "POST",
  78937. // "id": "compute.securityPolicies.insert",
  78938. // "parameterOrder": [
  78939. // "project"
  78940. // ],
  78941. // "parameters": {
  78942. // "project": {
  78943. // "description": "Project ID for this request.",
  78944. // "location": "path",
  78945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78946. // "required": true,
  78947. // "type": "string"
  78948. // },
  78949. // "requestId": {
  78950. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78951. // "location": "query",
  78952. // "type": "string"
  78953. // }
  78954. // },
  78955. // "path": "{project}/global/securityPolicies",
  78956. // "request": {
  78957. // "$ref": "SecurityPolicy"
  78958. // },
  78959. // "response": {
  78960. // "$ref": "Operation"
  78961. // },
  78962. // "scopes": [
  78963. // "https://www.googleapis.com/auth/cloud-platform",
  78964. // "https://www.googleapis.com/auth/compute"
  78965. // ]
  78966. // }
  78967. }
  78968. // method id "compute.securityPolicies.list":
  78969. type SecurityPoliciesListCall struct {
  78970. s *Service
  78971. project string
  78972. urlParams_ gensupport.URLParams
  78973. ifNoneMatch_ string
  78974. ctx_ context.Context
  78975. header_ http.Header
  78976. }
  78977. // List: List all the policies that have been configured for the
  78978. // specified project.
  78979. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  78980. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78981. c.project = project
  78982. return c
  78983. }
  78984. // Filter sets the optional parameter "filter": A filter expression that
  78985. // filters resources listed in the response. The expression must specify
  78986. // the field name, a comparison operator, and the value that you want to
  78987. // use for filtering. The value must be a string, a number, or a
  78988. // boolean. The comparison operator must be either =, !=, >, or <.
  78989. //
  78990. // For example, if you are filtering Compute Engine instances, you can
  78991. // exclude instances named example-instance by specifying name !=
  78992. // example-instance.
  78993. //
  78994. // You can also filter nested fields. For example, you could specify
  78995. // scheduling.automaticRestart = false to include instances only if they
  78996. // are not scheduled for automatic restarts. You can use filtering on
  78997. // nested fields to filter based on resource labels.
  78998. //
  78999. // To filter on multiple expressions, provide each separate expression
  79000. // within parentheses. For example, (scheduling.automaticRestart = true)
  79001. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79002. // AND expression. However, you can include AND and OR expressions
  79003. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79004. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79005. // true).
  79006. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  79007. c.urlParams_.Set("filter", filter)
  79008. return c
  79009. }
  79010. // MaxResults sets the optional parameter "maxResults": The maximum
  79011. // number of results per page that should be returned. If the number of
  79012. // available results is larger than maxResults, Compute Engine returns a
  79013. // nextPageToken that can be used to get the next page of results in
  79014. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79015. // (Default: 500)
  79016. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  79017. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79018. return c
  79019. }
  79020. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79021. // a certain order. By default, results are returned in alphanumerical
  79022. // order based on the resource name.
  79023. //
  79024. // You can also sort results in descending order based on the creation
  79025. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79026. // based on the creationTimestamp field in reverse chronological order
  79027. // (newest result first). Use this to sort resources like operations so
  79028. // that the newest operation is returned first.
  79029. //
  79030. // Currently, only sorting by name or creationTimestamp desc is
  79031. // supported.
  79032. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  79033. c.urlParams_.Set("orderBy", orderBy)
  79034. return c
  79035. }
  79036. // PageToken sets the optional parameter "pageToken": Specifies a page
  79037. // token to use. Set pageToken to the nextPageToken returned by a
  79038. // previous list request to get the next page of results.
  79039. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  79040. c.urlParams_.Set("pageToken", pageToken)
  79041. return c
  79042. }
  79043. // Fields allows partial responses to be retrieved. See
  79044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79045. // for more information.
  79046. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  79047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79048. return c
  79049. }
  79050. // IfNoneMatch sets the optional parameter which makes the operation
  79051. // fail if the object's ETag matches the given value. This is useful for
  79052. // getting updates only after the object has changed since the last
  79053. // request. Use googleapi.IsNotModified to check whether the response
  79054. // error from Do is the result of In-None-Match.
  79055. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  79056. c.ifNoneMatch_ = entityTag
  79057. return c
  79058. }
  79059. // Context sets the context to be used in this call's Do method. Any
  79060. // pending HTTP request will be aborted if the provided context is
  79061. // canceled.
  79062. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  79063. c.ctx_ = ctx
  79064. return c
  79065. }
  79066. // Header returns an http.Header that can be modified by the caller to
  79067. // add HTTP headers to the request.
  79068. func (c *SecurityPoliciesListCall) Header() http.Header {
  79069. if c.header_ == nil {
  79070. c.header_ = make(http.Header)
  79071. }
  79072. return c.header_
  79073. }
  79074. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  79075. reqHeaders := make(http.Header)
  79076. for k, v := range c.header_ {
  79077. reqHeaders[k] = v
  79078. }
  79079. reqHeaders.Set("User-Agent", c.s.userAgent())
  79080. if c.ifNoneMatch_ != "" {
  79081. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79082. }
  79083. var body io.Reader = nil
  79084. c.urlParams_.Set("alt", alt)
  79085. c.urlParams_.Set("prettyPrint", "false")
  79086. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  79087. urls += "?" + c.urlParams_.Encode()
  79088. req, err := http.NewRequest("GET", urls, body)
  79089. if err != nil {
  79090. return nil, err
  79091. }
  79092. req.Header = reqHeaders
  79093. googleapi.Expand(req.URL, map[string]string{
  79094. "project": c.project,
  79095. })
  79096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79097. }
  79098. // Do executes the "compute.securityPolicies.list" call.
  79099. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  79100. // non-2xx status code is an error. Response headers are in either
  79101. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  79102. // returned at all) in error.(*googleapi.Error).Header. Use
  79103. // googleapi.IsNotModified to check whether the returned error was
  79104. // because http.StatusNotModified was returned.
  79105. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  79106. gensupport.SetOptions(c.urlParams_, opts...)
  79107. res, err := c.doRequest("json")
  79108. if res != nil && res.StatusCode == http.StatusNotModified {
  79109. if res.Body != nil {
  79110. res.Body.Close()
  79111. }
  79112. return nil, &googleapi.Error{
  79113. Code: res.StatusCode,
  79114. Header: res.Header,
  79115. }
  79116. }
  79117. if err != nil {
  79118. return nil, err
  79119. }
  79120. defer googleapi.CloseBody(res)
  79121. if err := googleapi.CheckResponse(res); err != nil {
  79122. return nil, err
  79123. }
  79124. ret := &SecurityPolicyList{
  79125. ServerResponse: googleapi.ServerResponse{
  79126. Header: res.Header,
  79127. HTTPStatusCode: res.StatusCode,
  79128. },
  79129. }
  79130. target := &ret
  79131. if err := gensupport.DecodeResponse(target, res); err != nil {
  79132. return nil, err
  79133. }
  79134. return ret, nil
  79135. // {
  79136. // "description": "List all the policies that have been configured for the specified project.",
  79137. // "httpMethod": "GET",
  79138. // "id": "compute.securityPolicies.list",
  79139. // "parameterOrder": [
  79140. // "project"
  79141. // ],
  79142. // "parameters": {
  79143. // "filter": {
  79144. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79145. // "location": "query",
  79146. // "type": "string"
  79147. // },
  79148. // "maxResults": {
  79149. // "default": "500",
  79150. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79151. // "format": "uint32",
  79152. // "location": "query",
  79153. // "minimum": "0",
  79154. // "type": "integer"
  79155. // },
  79156. // "orderBy": {
  79157. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79158. // "location": "query",
  79159. // "type": "string"
  79160. // },
  79161. // "pageToken": {
  79162. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79163. // "location": "query",
  79164. // "type": "string"
  79165. // },
  79166. // "project": {
  79167. // "description": "Project ID for this request.",
  79168. // "location": "path",
  79169. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79170. // "required": true,
  79171. // "type": "string"
  79172. // }
  79173. // },
  79174. // "path": "{project}/global/securityPolicies",
  79175. // "response": {
  79176. // "$ref": "SecurityPolicyList"
  79177. // },
  79178. // "scopes": [
  79179. // "https://www.googleapis.com/auth/cloud-platform",
  79180. // "https://www.googleapis.com/auth/compute",
  79181. // "https://www.googleapis.com/auth/compute.readonly"
  79182. // ]
  79183. // }
  79184. }
  79185. // Pages invokes f for each page of results.
  79186. // A non-nil error returned from f will halt the iteration.
  79187. // The provided context supersedes any context provided to the Context method.
  79188. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  79189. c.ctx_ = ctx
  79190. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79191. for {
  79192. x, err := c.Do()
  79193. if err != nil {
  79194. return err
  79195. }
  79196. if err := f(x); err != nil {
  79197. return err
  79198. }
  79199. if x.NextPageToken == "" {
  79200. return nil
  79201. }
  79202. c.PageToken(x.NextPageToken)
  79203. }
  79204. }
  79205. // method id "compute.securityPolicies.patch":
  79206. type SecurityPoliciesPatchCall struct {
  79207. s *Service
  79208. project string
  79209. securityPolicy string
  79210. securitypolicy *SecurityPolicy
  79211. urlParams_ gensupport.URLParams
  79212. ctx_ context.Context
  79213. header_ http.Header
  79214. }
  79215. // Patch: Patches the specified policy with the data included in the
  79216. // request.
  79217. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  79218. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79219. c.project = project
  79220. c.securityPolicy = securityPolicy
  79221. c.securitypolicy = securitypolicy
  79222. return c
  79223. }
  79224. // RequestId sets the optional parameter "requestId": An optional
  79225. // request ID to identify requests. Specify a unique request ID so that
  79226. // if you must retry your request, the server will know to ignore the
  79227. // request if it has already been completed.
  79228. //
  79229. // For example, consider a situation where you make an initial request
  79230. // and the request times out. If you make the request again with the
  79231. // same request ID, the server can check if original operation with the
  79232. // same request ID was received, and if so, will ignore the second
  79233. // request. This prevents clients from accidentally creating duplicate
  79234. // commitments.
  79235. //
  79236. // The request ID must be a valid UUID with the exception that zero UUID
  79237. // is not supported (00000000-0000-0000-0000-000000000000).
  79238. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  79239. c.urlParams_.Set("requestId", requestId)
  79240. return c
  79241. }
  79242. // Fields allows partial responses to be retrieved. See
  79243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79244. // for more information.
  79245. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  79246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79247. return c
  79248. }
  79249. // Context sets the context to be used in this call's Do method. Any
  79250. // pending HTTP request will be aborted if the provided context is
  79251. // canceled.
  79252. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  79253. c.ctx_ = ctx
  79254. return c
  79255. }
  79256. // Header returns an http.Header that can be modified by the caller to
  79257. // add HTTP headers to the request.
  79258. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  79259. if c.header_ == nil {
  79260. c.header_ = make(http.Header)
  79261. }
  79262. return c.header_
  79263. }
  79264. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  79265. reqHeaders := make(http.Header)
  79266. for k, v := range c.header_ {
  79267. reqHeaders[k] = v
  79268. }
  79269. reqHeaders.Set("User-Agent", c.s.userAgent())
  79270. var body io.Reader = nil
  79271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  79272. if err != nil {
  79273. return nil, err
  79274. }
  79275. reqHeaders.Set("Content-Type", "application/json")
  79276. c.urlParams_.Set("alt", alt)
  79277. c.urlParams_.Set("prettyPrint", "false")
  79278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  79279. urls += "?" + c.urlParams_.Encode()
  79280. req, err := http.NewRequest("PATCH", urls, body)
  79281. if err != nil {
  79282. return nil, err
  79283. }
  79284. req.Header = reqHeaders
  79285. googleapi.Expand(req.URL, map[string]string{
  79286. "project": c.project,
  79287. "securityPolicy": c.securityPolicy,
  79288. })
  79289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79290. }
  79291. // Do executes the "compute.securityPolicies.patch" call.
  79292. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79293. // status code is an error. Response headers are in either
  79294. // *Operation.ServerResponse.Header or (if a response was returned at
  79295. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79296. // to check whether the returned error was because
  79297. // http.StatusNotModified was returned.
  79298. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79299. gensupport.SetOptions(c.urlParams_, opts...)
  79300. res, err := c.doRequest("json")
  79301. if res != nil && res.StatusCode == http.StatusNotModified {
  79302. if res.Body != nil {
  79303. res.Body.Close()
  79304. }
  79305. return nil, &googleapi.Error{
  79306. Code: res.StatusCode,
  79307. Header: res.Header,
  79308. }
  79309. }
  79310. if err != nil {
  79311. return nil, err
  79312. }
  79313. defer googleapi.CloseBody(res)
  79314. if err := googleapi.CheckResponse(res); err != nil {
  79315. return nil, err
  79316. }
  79317. ret := &Operation{
  79318. ServerResponse: googleapi.ServerResponse{
  79319. Header: res.Header,
  79320. HTTPStatusCode: res.StatusCode,
  79321. },
  79322. }
  79323. target := &ret
  79324. if err := gensupport.DecodeResponse(target, res); err != nil {
  79325. return nil, err
  79326. }
  79327. return ret, nil
  79328. // {
  79329. // "description": "Patches the specified policy with the data included in the request.",
  79330. // "httpMethod": "PATCH",
  79331. // "id": "compute.securityPolicies.patch",
  79332. // "parameterOrder": [
  79333. // "project",
  79334. // "securityPolicy"
  79335. // ],
  79336. // "parameters": {
  79337. // "project": {
  79338. // "description": "Project ID for this request.",
  79339. // "location": "path",
  79340. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79341. // "required": true,
  79342. // "type": "string"
  79343. // },
  79344. // "requestId": {
  79345. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79346. // "location": "query",
  79347. // "type": "string"
  79348. // },
  79349. // "securityPolicy": {
  79350. // "description": "Name of the security policy to update.",
  79351. // "location": "path",
  79352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79353. // "required": true,
  79354. // "type": "string"
  79355. // }
  79356. // },
  79357. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  79358. // "request": {
  79359. // "$ref": "SecurityPolicy"
  79360. // },
  79361. // "response": {
  79362. // "$ref": "Operation"
  79363. // },
  79364. // "scopes": [
  79365. // "https://www.googleapis.com/auth/cloud-platform",
  79366. // "https://www.googleapis.com/auth/compute"
  79367. // ]
  79368. // }
  79369. }
  79370. // method id "compute.securityPolicies.patchRule":
  79371. type SecurityPoliciesPatchRuleCall struct {
  79372. s *Service
  79373. project string
  79374. securityPolicy string
  79375. securitypolicyrule *SecurityPolicyRule
  79376. urlParams_ gensupport.URLParams
  79377. ctx_ context.Context
  79378. header_ http.Header
  79379. }
  79380. // PatchRule: Patches a rule at the specified priority.
  79381. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  79382. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79383. c.project = project
  79384. c.securityPolicy = securityPolicy
  79385. c.securitypolicyrule = securitypolicyrule
  79386. return c
  79387. }
  79388. // Priority sets the optional parameter "priority": The priority of the
  79389. // rule to patch.
  79390. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  79391. c.urlParams_.Set("priority", fmt.Sprint(priority))
  79392. return c
  79393. }
  79394. // Fields allows partial responses to be retrieved. See
  79395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79396. // for more information.
  79397. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  79398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79399. return c
  79400. }
  79401. // Context sets the context to be used in this call's Do method. Any
  79402. // pending HTTP request will be aborted if the provided context is
  79403. // canceled.
  79404. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  79405. c.ctx_ = ctx
  79406. return c
  79407. }
  79408. // Header returns an http.Header that can be modified by the caller to
  79409. // add HTTP headers to the request.
  79410. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  79411. if c.header_ == nil {
  79412. c.header_ = make(http.Header)
  79413. }
  79414. return c.header_
  79415. }
  79416. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  79417. reqHeaders := make(http.Header)
  79418. for k, v := range c.header_ {
  79419. reqHeaders[k] = v
  79420. }
  79421. reqHeaders.Set("User-Agent", c.s.userAgent())
  79422. var body io.Reader = nil
  79423. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  79424. if err != nil {
  79425. return nil, err
  79426. }
  79427. reqHeaders.Set("Content-Type", "application/json")
  79428. c.urlParams_.Set("alt", alt)
  79429. c.urlParams_.Set("prettyPrint", "false")
  79430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  79431. urls += "?" + c.urlParams_.Encode()
  79432. req, err := http.NewRequest("POST", urls, body)
  79433. if err != nil {
  79434. return nil, err
  79435. }
  79436. req.Header = reqHeaders
  79437. googleapi.Expand(req.URL, map[string]string{
  79438. "project": c.project,
  79439. "securityPolicy": c.securityPolicy,
  79440. })
  79441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79442. }
  79443. // Do executes the "compute.securityPolicies.patchRule" call.
  79444. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79445. // status code is an error. Response headers are in either
  79446. // *Operation.ServerResponse.Header or (if a response was returned at
  79447. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79448. // to check whether the returned error was because
  79449. // http.StatusNotModified was returned.
  79450. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79451. gensupport.SetOptions(c.urlParams_, opts...)
  79452. res, err := c.doRequest("json")
  79453. if res != nil && res.StatusCode == http.StatusNotModified {
  79454. if res.Body != nil {
  79455. res.Body.Close()
  79456. }
  79457. return nil, &googleapi.Error{
  79458. Code: res.StatusCode,
  79459. Header: res.Header,
  79460. }
  79461. }
  79462. if err != nil {
  79463. return nil, err
  79464. }
  79465. defer googleapi.CloseBody(res)
  79466. if err := googleapi.CheckResponse(res); err != nil {
  79467. return nil, err
  79468. }
  79469. ret := &Operation{
  79470. ServerResponse: googleapi.ServerResponse{
  79471. Header: res.Header,
  79472. HTTPStatusCode: res.StatusCode,
  79473. },
  79474. }
  79475. target := &ret
  79476. if err := gensupport.DecodeResponse(target, res); err != nil {
  79477. return nil, err
  79478. }
  79479. return ret, nil
  79480. // {
  79481. // "description": "Patches a rule at the specified priority.",
  79482. // "httpMethod": "POST",
  79483. // "id": "compute.securityPolicies.patchRule",
  79484. // "parameterOrder": [
  79485. // "project",
  79486. // "securityPolicy"
  79487. // ],
  79488. // "parameters": {
  79489. // "priority": {
  79490. // "description": "The priority of the rule to patch.",
  79491. // "format": "int32",
  79492. // "location": "query",
  79493. // "type": "integer"
  79494. // },
  79495. // "project": {
  79496. // "description": "Project ID for this request.",
  79497. // "location": "path",
  79498. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79499. // "required": true,
  79500. // "type": "string"
  79501. // },
  79502. // "securityPolicy": {
  79503. // "description": "Name of the security policy to update.",
  79504. // "location": "path",
  79505. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79506. // "required": true,
  79507. // "type": "string"
  79508. // }
  79509. // },
  79510. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  79511. // "request": {
  79512. // "$ref": "SecurityPolicyRule"
  79513. // },
  79514. // "response": {
  79515. // "$ref": "Operation"
  79516. // },
  79517. // "scopes": [
  79518. // "https://www.googleapis.com/auth/cloud-platform",
  79519. // "https://www.googleapis.com/auth/compute"
  79520. // ]
  79521. // }
  79522. }
  79523. // method id "compute.securityPolicies.removeRule":
  79524. type SecurityPoliciesRemoveRuleCall struct {
  79525. s *Service
  79526. project string
  79527. securityPolicy string
  79528. urlParams_ gensupport.URLParams
  79529. ctx_ context.Context
  79530. header_ http.Header
  79531. }
  79532. // RemoveRule: Deletes a rule at the specified priority.
  79533. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  79534. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79535. c.project = project
  79536. c.securityPolicy = securityPolicy
  79537. return c
  79538. }
  79539. // Priority sets the optional parameter "priority": The priority of the
  79540. // rule to remove from the security policy.
  79541. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  79542. c.urlParams_.Set("priority", fmt.Sprint(priority))
  79543. return c
  79544. }
  79545. // Fields allows partial responses to be retrieved. See
  79546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79547. // for more information.
  79548. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  79549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79550. return c
  79551. }
  79552. // Context sets the context to be used in this call's Do method. Any
  79553. // pending HTTP request will be aborted if the provided context is
  79554. // canceled.
  79555. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  79556. c.ctx_ = ctx
  79557. return c
  79558. }
  79559. // Header returns an http.Header that can be modified by the caller to
  79560. // add HTTP headers to the request.
  79561. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  79562. if c.header_ == nil {
  79563. c.header_ = make(http.Header)
  79564. }
  79565. return c.header_
  79566. }
  79567. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  79568. reqHeaders := make(http.Header)
  79569. for k, v := range c.header_ {
  79570. reqHeaders[k] = v
  79571. }
  79572. reqHeaders.Set("User-Agent", c.s.userAgent())
  79573. var body io.Reader = nil
  79574. c.urlParams_.Set("alt", alt)
  79575. c.urlParams_.Set("prettyPrint", "false")
  79576. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  79577. urls += "?" + c.urlParams_.Encode()
  79578. req, err := http.NewRequest("POST", urls, body)
  79579. if err != nil {
  79580. return nil, err
  79581. }
  79582. req.Header = reqHeaders
  79583. googleapi.Expand(req.URL, map[string]string{
  79584. "project": c.project,
  79585. "securityPolicy": c.securityPolicy,
  79586. })
  79587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79588. }
  79589. // Do executes the "compute.securityPolicies.removeRule" call.
  79590. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79591. // status code is an error. Response headers are in either
  79592. // *Operation.ServerResponse.Header or (if a response was returned at
  79593. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79594. // to check whether the returned error was because
  79595. // http.StatusNotModified was returned.
  79596. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79597. gensupport.SetOptions(c.urlParams_, opts...)
  79598. res, err := c.doRequest("json")
  79599. if res != nil && res.StatusCode == http.StatusNotModified {
  79600. if res.Body != nil {
  79601. res.Body.Close()
  79602. }
  79603. return nil, &googleapi.Error{
  79604. Code: res.StatusCode,
  79605. Header: res.Header,
  79606. }
  79607. }
  79608. if err != nil {
  79609. return nil, err
  79610. }
  79611. defer googleapi.CloseBody(res)
  79612. if err := googleapi.CheckResponse(res); err != nil {
  79613. return nil, err
  79614. }
  79615. ret := &Operation{
  79616. ServerResponse: googleapi.ServerResponse{
  79617. Header: res.Header,
  79618. HTTPStatusCode: res.StatusCode,
  79619. },
  79620. }
  79621. target := &ret
  79622. if err := gensupport.DecodeResponse(target, res); err != nil {
  79623. return nil, err
  79624. }
  79625. return ret, nil
  79626. // {
  79627. // "description": "Deletes a rule at the specified priority.",
  79628. // "httpMethod": "POST",
  79629. // "id": "compute.securityPolicies.removeRule",
  79630. // "parameterOrder": [
  79631. // "project",
  79632. // "securityPolicy"
  79633. // ],
  79634. // "parameters": {
  79635. // "priority": {
  79636. // "description": "The priority of the rule to remove from the security policy.",
  79637. // "format": "int32",
  79638. // "location": "query",
  79639. // "type": "integer"
  79640. // },
  79641. // "project": {
  79642. // "description": "Project ID for this request.",
  79643. // "location": "path",
  79644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79645. // "required": true,
  79646. // "type": "string"
  79647. // },
  79648. // "securityPolicy": {
  79649. // "description": "Name of the security policy to update.",
  79650. // "location": "path",
  79651. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79652. // "required": true,
  79653. // "type": "string"
  79654. // }
  79655. // },
  79656. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  79657. // "response": {
  79658. // "$ref": "Operation"
  79659. // },
  79660. // "scopes": [
  79661. // "https://www.googleapis.com/auth/cloud-platform",
  79662. // "https://www.googleapis.com/auth/compute"
  79663. // ]
  79664. // }
  79665. }
  79666. // method id "compute.snapshots.delete":
  79667. type SnapshotsDeleteCall struct {
  79668. s *Service
  79669. project string
  79670. snapshot string
  79671. urlParams_ gensupport.URLParams
  79672. ctx_ context.Context
  79673. header_ http.Header
  79674. }
  79675. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  79676. // deleting a single snapshot might not necessarily delete all the data
  79677. // on that snapshot. If any data on the snapshot that is marked for
  79678. // deletion is needed for subsequent snapshots, the data will be moved
  79679. // to the next corresponding snapshot.
  79680. //
  79681. // For more information, see Deleting snapshots.
  79682. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  79683. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  79684. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79685. c.project = project
  79686. c.snapshot = snapshot
  79687. return c
  79688. }
  79689. // RequestId sets the optional parameter "requestId": An optional
  79690. // request ID to identify requests. Specify a unique request ID so that
  79691. // if you must retry your request, the server will know to ignore the
  79692. // request if it has already been completed.
  79693. //
  79694. // For example, consider a situation where you make an initial request
  79695. // and the request times out. If you make the request again with the
  79696. // same request ID, the server can check if original operation with the
  79697. // same request ID was received, and if so, will ignore the second
  79698. // request. This prevents clients from accidentally creating duplicate
  79699. // commitments.
  79700. //
  79701. // The request ID must be a valid UUID with the exception that zero UUID
  79702. // is not supported (00000000-0000-0000-0000-000000000000).
  79703. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  79704. c.urlParams_.Set("requestId", requestId)
  79705. return c
  79706. }
  79707. // Fields allows partial responses to be retrieved. See
  79708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79709. // for more information.
  79710. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  79711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79712. return c
  79713. }
  79714. // Context sets the context to be used in this call's Do method. Any
  79715. // pending HTTP request will be aborted if the provided context is
  79716. // canceled.
  79717. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  79718. c.ctx_ = ctx
  79719. return c
  79720. }
  79721. // Header returns an http.Header that can be modified by the caller to
  79722. // add HTTP headers to the request.
  79723. func (c *SnapshotsDeleteCall) Header() http.Header {
  79724. if c.header_ == nil {
  79725. c.header_ = make(http.Header)
  79726. }
  79727. return c.header_
  79728. }
  79729. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  79730. reqHeaders := make(http.Header)
  79731. for k, v := range c.header_ {
  79732. reqHeaders[k] = v
  79733. }
  79734. reqHeaders.Set("User-Agent", c.s.userAgent())
  79735. var body io.Reader = nil
  79736. c.urlParams_.Set("alt", alt)
  79737. c.urlParams_.Set("prettyPrint", "false")
  79738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  79739. urls += "?" + c.urlParams_.Encode()
  79740. req, err := http.NewRequest("DELETE", urls, body)
  79741. if err != nil {
  79742. return nil, err
  79743. }
  79744. req.Header = reqHeaders
  79745. googleapi.Expand(req.URL, map[string]string{
  79746. "project": c.project,
  79747. "snapshot": c.snapshot,
  79748. })
  79749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79750. }
  79751. // Do executes the "compute.snapshots.delete" call.
  79752. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79753. // status code is an error. Response headers are in either
  79754. // *Operation.ServerResponse.Header or (if a response was returned at
  79755. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79756. // to check whether the returned error was because
  79757. // http.StatusNotModified was returned.
  79758. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79759. gensupport.SetOptions(c.urlParams_, opts...)
  79760. res, err := c.doRequest("json")
  79761. if res != nil && res.StatusCode == http.StatusNotModified {
  79762. if res.Body != nil {
  79763. res.Body.Close()
  79764. }
  79765. return nil, &googleapi.Error{
  79766. Code: res.StatusCode,
  79767. Header: res.Header,
  79768. }
  79769. }
  79770. if err != nil {
  79771. return nil, err
  79772. }
  79773. defer googleapi.CloseBody(res)
  79774. if err := googleapi.CheckResponse(res); err != nil {
  79775. return nil, err
  79776. }
  79777. ret := &Operation{
  79778. ServerResponse: googleapi.ServerResponse{
  79779. Header: res.Header,
  79780. HTTPStatusCode: res.StatusCode,
  79781. },
  79782. }
  79783. target := &ret
  79784. if err := gensupport.DecodeResponse(target, res); err != nil {
  79785. return nil, err
  79786. }
  79787. return ret, nil
  79788. // {
  79789. // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snapshots.",
  79790. // "httpMethod": "DELETE",
  79791. // "id": "compute.snapshots.delete",
  79792. // "parameterOrder": [
  79793. // "project",
  79794. // "snapshot"
  79795. // ],
  79796. // "parameters": {
  79797. // "project": {
  79798. // "description": "Project ID for this request.",
  79799. // "location": "path",
  79800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79801. // "required": true,
  79802. // "type": "string"
  79803. // },
  79804. // "requestId": {
  79805. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79806. // "location": "query",
  79807. // "type": "string"
  79808. // },
  79809. // "snapshot": {
  79810. // "description": "Name of the Snapshot resource to delete.",
  79811. // "location": "path",
  79812. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79813. // "required": true,
  79814. // "type": "string"
  79815. // }
  79816. // },
  79817. // "path": "{project}/global/snapshots/{snapshot}",
  79818. // "response": {
  79819. // "$ref": "Operation"
  79820. // },
  79821. // "scopes": [
  79822. // "https://www.googleapis.com/auth/cloud-platform",
  79823. // "https://www.googleapis.com/auth/compute"
  79824. // ]
  79825. // }
  79826. }
  79827. // method id "compute.snapshots.get":
  79828. type SnapshotsGetCall struct {
  79829. s *Service
  79830. project string
  79831. snapshot string
  79832. urlParams_ gensupport.URLParams
  79833. ifNoneMatch_ string
  79834. ctx_ context.Context
  79835. header_ http.Header
  79836. }
  79837. // Get: Returns the specified Snapshot resource. Gets a list of
  79838. // available snapshots by making a list() request.
  79839. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  79840. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  79841. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79842. c.project = project
  79843. c.snapshot = snapshot
  79844. return c
  79845. }
  79846. // Fields allows partial responses to be retrieved. See
  79847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79848. // for more information.
  79849. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  79850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79851. return c
  79852. }
  79853. // IfNoneMatch sets the optional parameter which makes the operation
  79854. // fail if the object's ETag matches the given value. This is useful for
  79855. // getting updates only after the object has changed since the last
  79856. // request. Use googleapi.IsNotModified to check whether the response
  79857. // error from Do is the result of In-None-Match.
  79858. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  79859. c.ifNoneMatch_ = entityTag
  79860. return c
  79861. }
  79862. // Context sets the context to be used in this call's Do method. Any
  79863. // pending HTTP request will be aborted if the provided context is
  79864. // canceled.
  79865. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  79866. c.ctx_ = ctx
  79867. return c
  79868. }
  79869. // Header returns an http.Header that can be modified by the caller to
  79870. // add HTTP headers to the request.
  79871. func (c *SnapshotsGetCall) Header() http.Header {
  79872. if c.header_ == nil {
  79873. c.header_ = make(http.Header)
  79874. }
  79875. return c.header_
  79876. }
  79877. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  79878. reqHeaders := make(http.Header)
  79879. for k, v := range c.header_ {
  79880. reqHeaders[k] = v
  79881. }
  79882. reqHeaders.Set("User-Agent", c.s.userAgent())
  79883. if c.ifNoneMatch_ != "" {
  79884. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79885. }
  79886. var body io.Reader = nil
  79887. c.urlParams_.Set("alt", alt)
  79888. c.urlParams_.Set("prettyPrint", "false")
  79889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  79890. urls += "?" + c.urlParams_.Encode()
  79891. req, err := http.NewRequest("GET", urls, body)
  79892. if err != nil {
  79893. return nil, err
  79894. }
  79895. req.Header = reqHeaders
  79896. googleapi.Expand(req.URL, map[string]string{
  79897. "project": c.project,
  79898. "snapshot": c.snapshot,
  79899. })
  79900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79901. }
  79902. // Do executes the "compute.snapshots.get" call.
  79903. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  79904. // code is an error. Response headers are in either
  79905. // *Snapshot.ServerResponse.Header or (if a response was returned at
  79906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79907. // to check whether the returned error was because
  79908. // http.StatusNotModified was returned.
  79909. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  79910. gensupport.SetOptions(c.urlParams_, opts...)
  79911. res, err := c.doRequest("json")
  79912. if res != nil && res.StatusCode == http.StatusNotModified {
  79913. if res.Body != nil {
  79914. res.Body.Close()
  79915. }
  79916. return nil, &googleapi.Error{
  79917. Code: res.StatusCode,
  79918. Header: res.Header,
  79919. }
  79920. }
  79921. if err != nil {
  79922. return nil, err
  79923. }
  79924. defer googleapi.CloseBody(res)
  79925. if err := googleapi.CheckResponse(res); err != nil {
  79926. return nil, err
  79927. }
  79928. ret := &Snapshot{
  79929. ServerResponse: googleapi.ServerResponse{
  79930. Header: res.Header,
  79931. HTTPStatusCode: res.StatusCode,
  79932. },
  79933. }
  79934. target := &ret
  79935. if err := gensupport.DecodeResponse(target, res); err != nil {
  79936. return nil, err
  79937. }
  79938. return ret, nil
  79939. // {
  79940. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  79941. // "httpMethod": "GET",
  79942. // "id": "compute.snapshots.get",
  79943. // "parameterOrder": [
  79944. // "project",
  79945. // "snapshot"
  79946. // ],
  79947. // "parameters": {
  79948. // "project": {
  79949. // "description": "Project ID for this request.",
  79950. // "location": "path",
  79951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79952. // "required": true,
  79953. // "type": "string"
  79954. // },
  79955. // "snapshot": {
  79956. // "description": "Name of the Snapshot resource to return.",
  79957. // "location": "path",
  79958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79959. // "required": true,
  79960. // "type": "string"
  79961. // }
  79962. // },
  79963. // "path": "{project}/global/snapshots/{snapshot}",
  79964. // "response": {
  79965. // "$ref": "Snapshot"
  79966. // },
  79967. // "scopes": [
  79968. // "https://www.googleapis.com/auth/cloud-platform",
  79969. // "https://www.googleapis.com/auth/compute",
  79970. // "https://www.googleapis.com/auth/compute.readonly"
  79971. // ]
  79972. // }
  79973. }
  79974. // method id "compute.snapshots.getIamPolicy":
  79975. type SnapshotsGetIamPolicyCall struct {
  79976. s *Service
  79977. project string
  79978. resource string
  79979. urlParams_ gensupport.URLParams
  79980. ifNoneMatch_ string
  79981. ctx_ context.Context
  79982. header_ http.Header
  79983. }
  79984. // GetIamPolicy: Gets the access control policy for a resource. May be
  79985. // empty if no such policy or resource exists.
  79986. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  79987. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79988. c.project = project
  79989. c.resource = resource
  79990. return c
  79991. }
  79992. // Fields allows partial responses to be retrieved. See
  79993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79994. // for more information.
  79995. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  79996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79997. return c
  79998. }
  79999. // IfNoneMatch sets the optional parameter which makes the operation
  80000. // fail if the object's ETag matches the given value. This is useful for
  80001. // getting updates only after the object has changed since the last
  80002. // request. Use googleapi.IsNotModified to check whether the response
  80003. // error from Do is the result of In-None-Match.
  80004. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  80005. c.ifNoneMatch_ = entityTag
  80006. return c
  80007. }
  80008. // Context sets the context to be used in this call's Do method. Any
  80009. // pending HTTP request will be aborted if the provided context is
  80010. // canceled.
  80011. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  80012. c.ctx_ = ctx
  80013. return c
  80014. }
  80015. // Header returns an http.Header that can be modified by the caller to
  80016. // add HTTP headers to the request.
  80017. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  80018. if c.header_ == nil {
  80019. c.header_ = make(http.Header)
  80020. }
  80021. return c.header_
  80022. }
  80023. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  80024. reqHeaders := make(http.Header)
  80025. for k, v := range c.header_ {
  80026. reqHeaders[k] = v
  80027. }
  80028. reqHeaders.Set("User-Agent", c.s.userAgent())
  80029. if c.ifNoneMatch_ != "" {
  80030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80031. }
  80032. var body io.Reader = nil
  80033. c.urlParams_.Set("alt", alt)
  80034. c.urlParams_.Set("prettyPrint", "false")
  80035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  80036. urls += "?" + c.urlParams_.Encode()
  80037. req, err := http.NewRequest("GET", urls, body)
  80038. if err != nil {
  80039. return nil, err
  80040. }
  80041. req.Header = reqHeaders
  80042. googleapi.Expand(req.URL, map[string]string{
  80043. "project": c.project,
  80044. "resource": c.resource,
  80045. })
  80046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80047. }
  80048. // Do executes the "compute.snapshots.getIamPolicy" call.
  80049. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  80050. // code is an error. Response headers are in either
  80051. // *Policy.ServerResponse.Header or (if a response was returned at all)
  80052. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80053. // check whether the returned error was because http.StatusNotModified
  80054. // was returned.
  80055. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  80056. gensupport.SetOptions(c.urlParams_, opts...)
  80057. res, err := c.doRequest("json")
  80058. if res != nil && res.StatusCode == http.StatusNotModified {
  80059. if res.Body != nil {
  80060. res.Body.Close()
  80061. }
  80062. return nil, &googleapi.Error{
  80063. Code: res.StatusCode,
  80064. Header: res.Header,
  80065. }
  80066. }
  80067. if err != nil {
  80068. return nil, err
  80069. }
  80070. defer googleapi.CloseBody(res)
  80071. if err := googleapi.CheckResponse(res); err != nil {
  80072. return nil, err
  80073. }
  80074. ret := &Policy{
  80075. ServerResponse: googleapi.ServerResponse{
  80076. Header: res.Header,
  80077. HTTPStatusCode: res.StatusCode,
  80078. },
  80079. }
  80080. target := &ret
  80081. if err := gensupport.DecodeResponse(target, res); err != nil {
  80082. return nil, err
  80083. }
  80084. return ret, nil
  80085. // {
  80086. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  80087. // "httpMethod": "GET",
  80088. // "id": "compute.snapshots.getIamPolicy",
  80089. // "parameterOrder": [
  80090. // "project",
  80091. // "resource"
  80092. // ],
  80093. // "parameters": {
  80094. // "project": {
  80095. // "description": "Project ID for this request.",
  80096. // "location": "path",
  80097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80098. // "required": true,
  80099. // "type": "string"
  80100. // },
  80101. // "resource": {
  80102. // "description": "Name or id of the resource for this request.",
  80103. // "location": "path",
  80104. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80105. // "required": true,
  80106. // "type": "string"
  80107. // }
  80108. // },
  80109. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  80110. // "response": {
  80111. // "$ref": "Policy"
  80112. // },
  80113. // "scopes": [
  80114. // "https://www.googleapis.com/auth/cloud-platform",
  80115. // "https://www.googleapis.com/auth/compute",
  80116. // "https://www.googleapis.com/auth/compute.readonly"
  80117. // ]
  80118. // }
  80119. }
  80120. // method id "compute.snapshots.list":
  80121. type SnapshotsListCall struct {
  80122. s *Service
  80123. project string
  80124. urlParams_ gensupport.URLParams
  80125. ifNoneMatch_ string
  80126. ctx_ context.Context
  80127. header_ http.Header
  80128. }
  80129. // List: Retrieves the list of Snapshot resources contained within the
  80130. // specified project.
  80131. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  80132. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  80133. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80134. c.project = project
  80135. return c
  80136. }
  80137. // Filter sets the optional parameter "filter": A filter expression that
  80138. // filters resources listed in the response. The expression must specify
  80139. // the field name, a comparison operator, and the value that you want to
  80140. // use for filtering. The value must be a string, a number, or a
  80141. // boolean. The comparison operator must be either =, !=, >, or <.
  80142. //
  80143. // For example, if you are filtering Compute Engine instances, you can
  80144. // exclude instances named example-instance by specifying name !=
  80145. // example-instance.
  80146. //
  80147. // You can also filter nested fields. For example, you could specify
  80148. // scheduling.automaticRestart = false to include instances only if they
  80149. // are not scheduled for automatic restarts. You can use filtering on
  80150. // nested fields to filter based on resource labels.
  80151. //
  80152. // To filter on multiple expressions, provide each separate expression
  80153. // within parentheses. For example, (scheduling.automaticRestart = true)
  80154. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80155. // AND expression. However, you can include AND and OR expressions
  80156. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80157. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80158. // true).
  80159. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  80160. c.urlParams_.Set("filter", filter)
  80161. return c
  80162. }
  80163. // MaxResults sets the optional parameter "maxResults": The maximum
  80164. // number of results per page that should be returned. If the number of
  80165. // available results is larger than maxResults, Compute Engine returns a
  80166. // nextPageToken that can be used to get the next page of results in
  80167. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80168. // (Default: 500)
  80169. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  80170. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80171. return c
  80172. }
  80173. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80174. // a certain order. By default, results are returned in alphanumerical
  80175. // order based on the resource name.
  80176. //
  80177. // You can also sort results in descending order based on the creation
  80178. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80179. // based on the creationTimestamp field in reverse chronological order
  80180. // (newest result first). Use this to sort resources like operations so
  80181. // that the newest operation is returned first.
  80182. //
  80183. // Currently, only sorting by name or creationTimestamp desc is
  80184. // supported.
  80185. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  80186. c.urlParams_.Set("orderBy", orderBy)
  80187. return c
  80188. }
  80189. // PageToken sets the optional parameter "pageToken": Specifies a page
  80190. // token to use. Set pageToken to the nextPageToken returned by a
  80191. // previous list request to get the next page of results.
  80192. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  80193. c.urlParams_.Set("pageToken", pageToken)
  80194. return c
  80195. }
  80196. // Fields allows partial responses to be retrieved. See
  80197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80198. // for more information.
  80199. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  80200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80201. return c
  80202. }
  80203. // IfNoneMatch sets the optional parameter which makes the operation
  80204. // fail if the object's ETag matches the given value. This is useful for
  80205. // getting updates only after the object has changed since the last
  80206. // request. Use googleapi.IsNotModified to check whether the response
  80207. // error from Do is the result of In-None-Match.
  80208. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  80209. c.ifNoneMatch_ = entityTag
  80210. return c
  80211. }
  80212. // Context sets the context to be used in this call's Do method. Any
  80213. // pending HTTP request will be aborted if the provided context is
  80214. // canceled.
  80215. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  80216. c.ctx_ = ctx
  80217. return c
  80218. }
  80219. // Header returns an http.Header that can be modified by the caller to
  80220. // add HTTP headers to the request.
  80221. func (c *SnapshotsListCall) Header() http.Header {
  80222. if c.header_ == nil {
  80223. c.header_ = make(http.Header)
  80224. }
  80225. return c.header_
  80226. }
  80227. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  80228. reqHeaders := make(http.Header)
  80229. for k, v := range c.header_ {
  80230. reqHeaders[k] = v
  80231. }
  80232. reqHeaders.Set("User-Agent", c.s.userAgent())
  80233. if c.ifNoneMatch_ != "" {
  80234. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80235. }
  80236. var body io.Reader = nil
  80237. c.urlParams_.Set("alt", alt)
  80238. c.urlParams_.Set("prettyPrint", "false")
  80239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  80240. urls += "?" + c.urlParams_.Encode()
  80241. req, err := http.NewRequest("GET", urls, body)
  80242. if err != nil {
  80243. return nil, err
  80244. }
  80245. req.Header = reqHeaders
  80246. googleapi.Expand(req.URL, map[string]string{
  80247. "project": c.project,
  80248. })
  80249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80250. }
  80251. // Do executes the "compute.snapshots.list" call.
  80252. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  80253. // status code is an error. Response headers are in either
  80254. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  80255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80256. // to check whether the returned error was because
  80257. // http.StatusNotModified was returned.
  80258. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  80259. gensupport.SetOptions(c.urlParams_, opts...)
  80260. res, err := c.doRequest("json")
  80261. if res != nil && res.StatusCode == http.StatusNotModified {
  80262. if res.Body != nil {
  80263. res.Body.Close()
  80264. }
  80265. return nil, &googleapi.Error{
  80266. Code: res.StatusCode,
  80267. Header: res.Header,
  80268. }
  80269. }
  80270. if err != nil {
  80271. return nil, err
  80272. }
  80273. defer googleapi.CloseBody(res)
  80274. if err := googleapi.CheckResponse(res); err != nil {
  80275. return nil, err
  80276. }
  80277. ret := &SnapshotList{
  80278. ServerResponse: googleapi.ServerResponse{
  80279. Header: res.Header,
  80280. HTTPStatusCode: res.StatusCode,
  80281. },
  80282. }
  80283. target := &ret
  80284. if err := gensupport.DecodeResponse(target, res); err != nil {
  80285. return nil, err
  80286. }
  80287. return ret, nil
  80288. // {
  80289. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  80290. // "httpMethod": "GET",
  80291. // "id": "compute.snapshots.list",
  80292. // "parameterOrder": [
  80293. // "project"
  80294. // ],
  80295. // "parameters": {
  80296. // "filter": {
  80297. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80298. // "location": "query",
  80299. // "type": "string"
  80300. // },
  80301. // "maxResults": {
  80302. // "default": "500",
  80303. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80304. // "format": "uint32",
  80305. // "location": "query",
  80306. // "minimum": "0",
  80307. // "type": "integer"
  80308. // },
  80309. // "orderBy": {
  80310. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80311. // "location": "query",
  80312. // "type": "string"
  80313. // },
  80314. // "pageToken": {
  80315. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80316. // "location": "query",
  80317. // "type": "string"
  80318. // },
  80319. // "project": {
  80320. // "description": "Project ID for this request.",
  80321. // "location": "path",
  80322. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80323. // "required": true,
  80324. // "type": "string"
  80325. // }
  80326. // },
  80327. // "path": "{project}/global/snapshots",
  80328. // "response": {
  80329. // "$ref": "SnapshotList"
  80330. // },
  80331. // "scopes": [
  80332. // "https://www.googleapis.com/auth/cloud-platform",
  80333. // "https://www.googleapis.com/auth/compute",
  80334. // "https://www.googleapis.com/auth/compute.readonly"
  80335. // ]
  80336. // }
  80337. }
  80338. // Pages invokes f for each page of results.
  80339. // A non-nil error returned from f will halt the iteration.
  80340. // The provided context supersedes any context provided to the Context method.
  80341. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  80342. c.ctx_ = ctx
  80343. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80344. for {
  80345. x, err := c.Do()
  80346. if err != nil {
  80347. return err
  80348. }
  80349. if err := f(x); err != nil {
  80350. return err
  80351. }
  80352. if x.NextPageToken == "" {
  80353. return nil
  80354. }
  80355. c.PageToken(x.NextPageToken)
  80356. }
  80357. }
  80358. // method id "compute.snapshots.setIamPolicy":
  80359. type SnapshotsSetIamPolicyCall struct {
  80360. s *Service
  80361. project string
  80362. resource string
  80363. globalsetpolicyrequest *GlobalSetPolicyRequest
  80364. urlParams_ gensupport.URLParams
  80365. ctx_ context.Context
  80366. header_ http.Header
  80367. }
  80368. // SetIamPolicy: Sets the access control policy on the specified
  80369. // resource. Replaces any existing policy.
  80370. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  80371. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80372. c.project = project
  80373. c.resource = resource
  80374. c.globalsetpolicyrequest = globalsetpolicyrequest
  80375. return c
  80376. }
  80377. // Fields allows partial responses to be retrieved. See
  80378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80379. // for more information.
  80380. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  80381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80382. return c
  80383. }
  80384. // Context sets the context to be used in this call's Do method. Any
  80385. // pending HTTP request will be aborted if the provided context is
  80386. // canceled.
  80387. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  80388. c.ctx_ = ctx
  80389. return c
  80390. }
  80391. // Header returns an http.Header that can be modified by the caller to
  80392. // add HTTP headers to the request.
  80393. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  80394. if c.header_ == nil {
  80395. c.header_ = make(http.Header)
  80396. }
  80397. return c.header_
  80398. }
  80399. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  80400. reqHeaders := make(http.Header)
  80401. for k, v := range c.header_ {
  80402. reqHeaders[k] = v
  80403. }
  80404. reqHeaders.Set("User-Agent", c.s.userAgent())
  80405. var body io.Reader = nil
  80406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  80407. if err != nil {
  80408. return nil, err
  80409. }
  80410. reqHeaders.Set("Content-Type", "application/json")
  80411. c.urlParams_.Set("alt", alt)
  80412. c.urlParams_.Set("prettyPrint", "false")
  80413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  80414. urls += "?" + c.urlParams_.Encode()
  80415. req, err := http.NewRequest("POST", urls, body)
  80416. if err != nil {
  80417. return nil, err
  80418. }
  80419. req.Header = reqHeaders
  80420. googleapi.Expand(req.URL, map[string]string{
  80421. "project": c.project,
  80422. "resource": c.resource,
  80423. })
  80424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80425. }
  80426. // Do executes the "compute.snapshots.setIamPolicy" call.
  80427. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  80428. // code is an error. Response headers are in either
  80429. // *Policy.ServerResponse.Header or (if a response was returned at all)
  80430. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80431. // check whether the returned error was because http.StatusNotModified
  80432. // was returned.
  80433. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  80434. gensupport.SetOptions(c.urlParams_, opts...)
  80435. res, err := c.doRequest("json")
  80436. if res != nil && res.StatusCode == http.StatusNotModified {
  80437. if res.Body != nil {
  80438. res.Body.Close()
  80439. }
  80440. return nil, &googleapi.Error{
  80441. Code: res.StatusCode,
  80442. Header: res.Header,
  80443. }
  80444. }
  80445. if err != nil {
  80446. return nil, err
  80447. }
  80448. defer googleapi.CloseBody(res)
  80449. if err := googleapi.CheckResponse(res); err != nil {
  80450. return nil, err
  80451. }
  80452. ret := &Policy{
  80453. ServerResponse: googleapi.ServerResponse{
  80454. Header: res.Header,
  80455. HTTPStatusCode: res.StatusCode,
  80456. },
  80457. }
  80458. target := &ret
  80459. if err := gensupport.DecodeResponse(target, res); err != nil {
  80460. return nil, err
  80461. }
  80462. return ret, nil
  80463. // {
  80464. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  80465. // "httpMethod": "POST",
  80466. // "id": "compute.snapshots.setIamPolicy",
  80467. // "parameterOrder": [
  80468. // "project",
  80469. // "resource"
  80470. // ],
  80471. // "parameters": {
  80472. // "project": {
  80473. // "description": "Project ID for this request.",
  80474. // "location": "path",
  80475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80476. // "required": true,
  80477. // "type": "string"
  80478. // },
  80479. // "resource": {
  80480. // "description": "Name or id of the resource for this request.",
  80481. // "location": "path",
  80482. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80483. // "required": true,
  80484. // "type": "string"
  80485. // }
  80486. // },
  80487. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  80488. // "request": {
  80489. // "$ref": "GlobalSetPolicyRequest"
  80490. // },
  80491. // "response": {
  80492. // "$ref": "Policy"
  80493. // },
  80494. // "scopes": [
  80495. // "https://www.googleapis.com/auth/cloud-platform",
  80496. // "https://www.googleapis.com/auth/compute"
  80497. // ]
  80498. // }
  80499. }
  80500. // method id "compute.snapshots.setLabels":
  80501. type SnapshotsSetLabelsCall struct {
  80502. s *Service
  80503. project string
  80504. resource string
  80505. globalsetlabelsrequest *GlobalSetLabelsRequest
  80506. urlParams_ gensupport.URLParams
  80507. ctx_ context.Context
  80508. header_ http.Header
  80509. }
  80510. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  80511. // read the Labeling Resources documentation.
  80512. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  80513. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80514. c.project = project
  80515. c.resource = resource
  80516. c.globalsetlabelsrequest = globalsetlabelsrequest
  80517. return c
  80518. }
  80519. // Fields allows partial responses to be retrieved. See
  80520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80521. // for more information.
  80522. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  80523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80524. return c
  80525. }
  80526. // Context sets the context to be used in this call's Do method. Any
  80527. // pending HTTP request will be aborted if the provided context is
  80528. // canceled.
  80529. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  80530. c.ctx_ = ctx
  80531. return c
  80532. }
  80533. // Header returns an http.Header that can be modified by the caller to
  80534. // add HTTP headers to the request.
  80535. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  80536. if c.header_ == nil {
  80537. c.header_ = make(http.Header)
  80538. }
  80539. return c.header_
  80540. }
  80541. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  80542. reqHeaders := make(http.Header)
  80543. for k, v := range c.header_ {
  80544. reqHeaders[k] = v
  80545. }
  80546. reqHeaders.Set("User-Agent", c.s.userAgent())
  80547. var body io.Reader = nil
  80548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  80549. if err != nil {
  80550. return nil, err
  80551. }
  80552. reqHeaders.Set("Content-Type", "application/json")
  80553. c.urlParams_.Set("alt", alt)
  80554. c.urlParams_.Set("prettyPrint", "false")
  80555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  80556. urls += "?" + c.urlParams_.Encode()
  80557. req, err := http.NewRequest("POST", urls, body)
  80558. if err != nil {
  80559. return nil, err
  80560. }
  80561. req.Header = reqHeaders
  80562. googleapi.Expand(req.URL, map[string]string{
  80563. "project": c.project,
  80564. "resource": c.resource,
  80565. })
  80566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80567. }
  80568. // Do executes the "compute.snapshots.setLabels" call.
  80569. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80570. // status code is an error. Response headers are in either
  80571. // *Operation.ServerResponse.Header or (if a response was returned at
  80572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80573. // to check whether the returned error was because
  80574. // http.StatusNotModified was returned.
  80575. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80576. gensupport.SetOptions(c.urlParams_, opts...)
  80577. res, err := c.doRequest("json")
  80578. if res != nil && res.StatusCode == http.StatusNotModified {
  80579. if res.Body != nil {
  80580. res.Body.Close()
  80581. }
  80582. return nil, &googleapi.Error{
  80583. Code: res.StatusCode,
  80584. Header: res.Header,
  80585. }
  80586. }
  80587. if err != nil {
  80588. return nil, err
  80589. }
  80590. defer googleapi.CloseBody(res)
  80591. if err := googleapi.CheckResponse(res); err != nil {
  80592. return nil, err
  80593. }
  80594. ret := &Operation{
  80595. ServerResponse: googleapi.ServerResponse{
  80596. Header: res.Header,
  80597. HTTPStatusCode: res.StatusCode,
  80598. },
  80599. }
  80600. target := &ret
  80601. if err := gensupport.DecodeResponse(target, res); err != nil {
  80602. return nil, err
  80603. }
  80604. return ret, nil
  80605. // {
  80606. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  80607. // "httpMethod": "POST",
  80608. // "id": "compute.snapshots.setLabels",
  80609. // "parameterOrder": [
  80610. // "project",
  80611. // "resource"
  80612. // ],
  80613. // "parameters": {
  80614. // "project": {
  80615. // "description": "Project ID for this request.",
  80616. // "location": "path",
  80617. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80618. // "required": true,
  80619. // "type": "string"
  80620. // },
  80621. // "resource": {
  80622. // "description": "Name or id of the resource for this request.",
  80623. // "location": "path",
  80624. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80625. // "required": true,
  80626. // "type": "string"
  80627. // }
  80628. // },
  80629. // "path": "{project}/global/snapshots/{resource}/setLabels",
  80630. // "request": {
  80631. // "$ref": "GlobalSetLabelsRequest"
  80632. // },
  80633. // "response": {
  80634. // "$ref": "Operation"
  80635. // },
  80636. // "scopes": [
  80637. // "https://www.googleapis.com/auth/cloud-platform",
  80638. // "https://www.googleapis.com/auth/compute"
  80639. // ]
  80640. // }
  80641. }
  80642. // method id "compute.snapshots.testIamPermissions":
  80643. type SnapshotsTestIamPermissionsCall struct {
  80644. s *Service
  80645. project string
  80646. resource string
  80647. testpermissionsrequest *TestPermissionsRequest
  80648. urlParams_ gensupport.URLParams
  80649. ctx_ context.Context
  80650. header_ http.Header
  80651. }
  80652. // TestIamPermissions: Returns permissions that a caller has on the
  80653. // specified resource.
  80654. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  80655. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80656. c.project = project
  80657. c.resource = resource
  80658. c.testpermissionsrequest = testpermissionsrequest
  80659. return c
  80660. }
  80661. // Fields allows partial responses to be retrieved. See
  80662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80663. // for more information.
  80664. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  80665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80666. return c
  80667. }
  80668. // Context sets the context to be used in this call's Do method. Any
  80669. // pending HTTP request will be aborted if the provided context is
  80670. // canceled.
  80671. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  80672. c.ctx_ = ctx
  80673. return c
  80674. }
  80675. // Header returns an http.Header that can be modified by the caller to
  80676. // add HTTP headers to the request.
  80677. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  80678. if c.header_ == nil {
  80679. c.header_ = make(http.Header)
  80680. }
  80681. return c.header_
  80682. }
  80683. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  80684. reqHeaders := make(http.Header)
  80685. for k, v := range c.header_ {
  80686. reqHeaders[k] = v
  80687. }
  80688. reqHeaders.Set("User-Agent", c.s.userAgent())
  80689. var body io.Reader = nil
  80690. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  80691. if err != nil {
  80692. return nil, err
  80693. }
  80694. reqHeaders.Set("Content-Type", "application/json")
  80695. c.urlParams_.Set("alt", alt)
  80696. c.urlParams_.Set("prettyPrint", "false")
  80697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  80698. urls += "?" + c.urlParams_.Encode()
  80699. req, err := http.NewRequest("POST", urls, body)
  80700. if err != nil {
  80701. return nil, err
  80702. }
  80703. req.Header = reqHeaders
  80704. googleapi.Expand(req.URL, map[string]string{
  80705. "project": c.project,
  80706. "resource": c.resource,
  80707. })
  80708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80709. }
  80710. // Do executes the "compute.snapshots.testIamPermissions" call.
  80711. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  80712. // non-2xx status code is an error. Response headers are in either
  80713. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  80714. // returned at all) in error.(*googleapi.Error).Header. Use
  80715. // googleapi.IsNotModified to check whether the returned error was
  80716. // because http.StatusNotModified was returned.
  80717. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  80718. gensupport.SetOptions(c.urlParams_, opts...)
  80719. res, err := c.doRequest("json")
  80720. if res != nil && res.StatusCode == http.StatusNotModified {
  80721. if res.Body != nil {
  80722. res.Body.Close()
  80723. }
  80724. return nil, &googleapi.Error{
  80725. Code: res.StatusCode,
  80726. Header: res.Header,
  80727. }
  80728. }
  80729. if err != nil {
  80730. return nil, err
  80731. }
  80732. defer googleapi.CloseBody(res)
  80733. if err := googleapi.CheckResponse(res); err != nil {
  80734. return nil, err
  80735. }
  80736. ret := &TestPermissionsResponse{
  80737. ServerResponse: googleapi.ServerResponse{
  80738. Header: res.Header,
  80739. HTTPStatusCode: res.StatusCode,
  80740. },
  80741. }
  80742. target := &ret
  80743. if err := gensupport.DecodeResponse(target, res); err != nil {
  80744. return nil, err
  80745. }
  80746. return ret, nil
  80747. // {
  80748. // "description": "Returns permissions that a caller has on the specified resource.",
  80749. // "httpMethod": "POST",
  80750. // "id": "compute.snapshots.testIamPermissions",
  80751. // "parameterOrder": [
  80752. // "project",
  80753. // "resource"
  80754. // ],
  80755. // "parameters": {
  80756. // "project": {
  80757. // "description": "Project ID for this request.",
  80758. // "location": "path",
  80759. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80760. // "required": true,
  80761. // "type": "string"
  80762. // },
  80763. // "resource": {
  80764. // "description": "Name or id of the resource for this request.",
  80765. // "location": "path",
  80766. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80767. // "required": true,
  80768. // "type": "string"
  80769. // }
  80770. // },
  80771. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  80772. // "request": {
  80773. // "$ref": "TestPermissionsRequest"
  80774. // },
  80775. // "response": {
  80776. // "$ref": "TestPermissionsResponse"
  80777. // },
  80778. // "scopes": [
  80779. // "https://www.googleapis.com/auth/cloud-platform",
  80780. // "https://www.googleapis.com/auth/compute",
  80781. // "https://www.googleapis.com/auth/compute.readonly"
  80782. // ]
  80783. // }
  80784. }
  80785. // method id "compute.sslCertificates.delete":
  80786. type SslCertificatesDeleteCall struct {
  80787. s *Service
  80788. project string
  80789. sslCertificate string
  80790. urlParams_ gensupport.URLParams
  80791. ctx_ context.Context
  80792. header_ http.Header
  80793. }
  80794. // Delete: Deletes the specified SslCertificate resource.
  80795. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  80796. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80797. c.project = project
  80798. c.sslCertificate = sslCertificate
  80799. return c
  80800. }
  80801. // RequestId sets the optional parameter "requestId": An optional
  80802. // request ID to identify requests. Specify a unique request ID so that
  80803. // if you must retry your request, the server will know to ignore the
  80804. // request if it has already been completed.
  80805. //
  80806. // For example, consider a situation where you make an initial request
  80807. // and the request times out. If you make the request again with the
  80808. // same request ID, the server can check if original operation with the
  80809. // same request ID was received, and if so, will ignore the second
  80810. // request. This prevents clients from accidentally creating duplicate
  80811. // commitments.
  80812. //
  80813. // The request ID must be a valid UUID with the exception that zero UUID
  80814. // is not supported (00000000-0000-0000-0000-000000000000).
  80815. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  80816. c.urlParams_.Set("requestId", requestId)
  80817. return c
  80818. }
  80819. // Fields allows partial responses to be retrieved. See
  80820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80821. // for more information.
  80822. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  80823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80824. return c
  80825. }
  80826. // Context sets the context to be used in this call's Do method. Any
  80827. // pending HTTP request will be aborted if the provided context is
  80828. // canceled.
  80829. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  80830. c.ctx_ = ctx
  80831. return c
  80832. }
  80833. // Header returns an http.Header that can be modified by the caller to
  80834. // add HTTP headers to the request.
  80835. func (c *SslCertificatesDeleteCall) Header() http.Header {
  80836. if c.header_ == nil {
  80837. c.header_ = make(http.Header)
  80838. }
  80839. return c.header_
  80840. }
  80841. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  80842. reqHeaders := make(http.Header)
  80843. for k, v := range c.header_ {
  80844. reqHeaders[k] = v
  80845. }
  80846. reqHeaders.Set("User-Agent", c.s.userAgent())
  80847. var body io.Reader = nil
  80848. c.urlParams_.Set("alt", alt)
  80849. c.urlParams_.Set("prettyPrint", "false")
  80850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  80851. urls += "?" + c.urlParams_.Encode()
  80852. req, err := http.NewRequest("DELETE", urls, body)
  80853. if err != nil {
  80854. return nil, err
  80855. }
  80856. req.Header = reqHeaders
  80857. googleapi.Expand(req.URL, map[string]string{
  80858. "project": c.project,
  80859. "sslCertificate": c.sslCertificate,
  80860. })
  80861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80862. }
  80863. // Do executes the "compute.sslCertificates.delete" call.
  80864. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80865. // status code is an error. Response headers are in either
  80866. // *Operation.ServerResponse.Header or (if a response was returned at
  80867. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80868. // to check whether the returned error was because
  80869. // http.StatusNotModified was returned.
  80870. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80871. gensupport.SetOptions(c.urlParams_, opts...)
  80872. res, err := c.doRequest("json")
  80873. if res != nil && res.StatusCode == http.StatusNotModified {
  80874. if res.Body != nil {
  80875. res.Body.Close()
  80876. }
  80877. return nil, &googleapi.Error{
  80878. Code: res.StatusCode,
  80879. Header: res.Header,
  80880. }
  80881. }
  80882. if err != nil {
  80883. return nil, err
  80884. }
  80885. defer googleapi.CloseBody(res)
  80886. if err := googleapi.CheckResponse(res); err != nil {
  80887. return nil, err
  80888. }
  80889. ret := &Operation{
  80890. ServerResponse: googleapi.ServerResponse{
  80891. Header: res.Header,
  80892. HTTPStatusCode: res.StatusCode,
  80893. },
  80894. }
  80895. target := &ret
  80896. if err := gensupport.DecodeResponse(target, res); err != nil {
  80897. return nil, err
  80898. }
  80899. return ret, nil
  80900. // {
  80901. // "description": "Deletes the specified SslCertificate resource.",
  80902. // "httpMethod": "DELETE",
  80903. // "id": "compute.sslCertificates.delete",
  80904. // "parameterOrder": [
  80905. // "project",
  80906. // "sslCertificate"
  80907. // ],
  80908. // "parameters": {
  80909. // "project": {
  80910. // "description": "Project ID for this request.",
  80911. // "location": "path",
  80912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80913. // "required": true,
  80914. // "type": "string"
  80915. // },
  80916. // "requestId": {
  80917. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80918. // "location": "query",
  80919. // "type": "string"
  80920. // },
  80921. // "sslCertificate": {
  80922. // "description": "Name of the SslCertificate resource to delete.",
  80923. // "location": "path",
  80924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80925. // "required": true,
  80926. // "type": "string"
  80927. // }
  80928. // },
  80929. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  80930. // "response": {
  80931. // "$ref": "Operation"
  80932. // },
  80933. // "scopes": [
  80934. // "https://www.googleapis.com/auth/cloud-platform",
  80935. // "https://www.googleapis.com/auth/compute"
  80936. // ]
  80937. // }
  80938. }
  80939. // method id "compute.sslCertificates.get":
  80940. type SslCertificatesGetCall struct {
  80941. s *Service
  80942. project string
  80943. sslCertificate string
  80944. urlParams_ gensupport.URLParams
  80945. ifNoneMatch_ string
  80946. ctx_ context.Context
  80947. header_ http.Header
  80948. }
  80949. // Get: Returns the specified SslCertificate resource. Gets a list of
  80950. // available SSL certificates by making a list() request.
  80951. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  80952. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80953. c.project = project
  80954. c.sslCertificate = sslCertificate
  80955. return c
  80956. }
  80957. // Fields allows partial responses to be retrieved. See
  80958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80959. // for more information.
  80960. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  80961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80962. return c
  80963. }
  80964. // IfNoneMatch sets the optional parameter which makes the operation
  80965. // fail if the object's ETag matches the given value. This is useful for
  80966. // getting updates only after the object has changed since the last
  80967. // request. Use googleapi.IsNotModified to check whether the response
  80968. // error from Do is the result of In-None-Match.
  80969. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  80970. c.ifNoneMatch_ = entityTag
  80971. return c
  80972. }
  80973. // Context sets the context to be used in this call's Do method. Any
  80974. // pending HTTP request will be aborted if the provided context is
  80975. // canceled.
  80976. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  80977. c.ctx_ = ctx
  80978. return c
  80979. }
  80980. // Header returns an http.Header that can be modified by the caller to
  80981. // add HTTP headers to the request.
  80982. func (c *SslCertificatesGetCall) Header() http.Header {
  80983. if c.header_ == nil {
  80984. c.header_ = make(http.Header)
  80985. }
  80986. return c.header_
  80987. }
  80988. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  80989. reqHeaders := make(http.Header)
  80990. for k, v := range c.header_ {
  80991. reqHeaders[k] = v
  80992. }
  80993. reqHeaders.Set("User-Agent", c.s.userAgent())
  80994. if c.ifNoneMatch_ != "" {
  80995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80996. }
  80997. var body io.Reader = nil
  80998. c.urlParams_.Set("alt", alt)
  80999. c.urlParams_.Set("prettyPrint", "false")
  81000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  81001. urls += "?" + c.urlParams_.Encode()
  81002. req, err := http.NewRequest("GET", urls, body)
  81003. if err != nil {
  81004. return nil, err
  81005. }
  81006. req.Header = reqHeaders
  81007. googleapi.Expand(req.URL, map[string]string{
  81008. "project": c.project,
  81009. "sslCertificate": c.sslCertificate,
  81010. })
  81011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81012. }
  81013. // Do executes the "compute.sslCertificates.get" call.
  81014. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  81015. // status code is an error. Response headers are in either
  81016. // *SslCertificate.ServerResponse.Header or (if a response was returned
  81017. // at all) in error.(*googleapi.Error).Header. Use
  81018. // googleapi.IsNotModified to check whether the returned error was
  81019. // because http.StatusNotModified was returned.
  81020. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  81021. gensupport.SetOptions(c.urlParams_, opts...)
  81022. res, err := c.doRequest("json")
  81023. if res != nil && res.StatusCode == http.StatusNotModified {
  81024. if res.Body != nil {
  81025. res.Body.Close()
  81026. }
  81027. return nil, &googleapi.Error{
  81028. Code: res.StatusCode,
  81029. Header: res.Header,
  81030. }
  81031. }
  81032. if err != nil {
  81033. return nil, err
  81034. }
  81035. defer googleapi.CloseBody(res)
  81036. if err := googleapi.CheckResponse(res); err != nil {
  81037. return nil, err
  81038. }
  81039. ret := &SslCertificate{
  81040. ServerResponse: googleapi.ServerResponse{
  81041. Header: res.Header,
  81042. HTTPStatusCode: res.StatusCode,
  81043. },
  81044. }
  81045. target := &ret
  81046. if err := gensupport.DecodeResponse(target, res); err != nil {
  81047. return nil, err
  81048. }
  81049. return ret, nil
  81050. // {
  81051. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  81052. // "httpMethod": "GET",
  81053. // "id": "compute.sslCertificates.get",
  81054. // "parameterOrder": [
  81055. // "project",
  81056. // "sslCertificate"
  81057. // ],
  81058. // "parameters": {
  81059. // "project": {
  81060. // "description": "Project ID for this request.",
  81061. // "location": "path",
  81062. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81063. // "required": true,
  81064. // "type": "string"
  81065. // },
  81066. // "sslCertificate": {
  81067. // "description": "Name of the SslCertificate resource to return.",
  81068. // "location": "path",
  81069. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81070. // "required": true,
  81071. // "type": "string"
  81072. // }
  81073. // },
  81074. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  81075. // "response": {
  81076. // "$ref": "SslCertificate"
  81077. // },
  81078. // "scopes": [
  81079. // "https://www.googleapis.com/auth/cloud-platform",
  81080. // "https://www.googleapis.com/auth/compute",
  81081. // "https://www.googleapis.com/auth/compute.readonly"
  81082. // ]
  81083. // }
  81084. }
  81085. // method id "compute.sslCertificates.insert":
  81086. type SslCertificatesInsertCall struct {
  81087. s *Service
  81088. project string
  81089. sslcertificate *SslCertificate
  81090. urlParams_ gensupport.URLParams
  81091. ctx_ context.Context
  81092. header_ http.Header
  81093. }
  81094. // Insert: Creates a SslCertificate resource in the specified project
  81095. // using the data included in the request.
  81096. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  81097. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81098. c.project = project
  81099. c.sslcertificate = sslcertificate
  81100. return c
  81101. }
  81102. // RequestId sets the optional parameter "requestId": An optional
  81103. // request ID to identify requests. Specify a unique request ID so that
  81104. // if you must retry your request, the server will know to ignore the
  81105. // request if it has already been completed.
  81106. //
  81107. // For example, consider a situation where you make an initial request
  81108. // and the request times out. If you make the request again with the
  81109. // same request ID, the server can check if original operation with the
  81110. // same request ID was received, and if so, will ignore the second
  81111. // request. This prevents clients from accidentally creating duplicate
  81112. // commitments.
  81113. //
  81114. // The request ID must be a valid UUID with the exception that zero UUID
  81115. // is not supported (00000000-0000-0000-0000-000000000000).
  81116. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  81117. c.urlParams_.Set("requestId", requestId)
  81118. return c
  81119. }
  81120. // Fields allows partial responses to be retrieved. See
  81121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81122. // for more information.
  81123. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  81124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81125. return c
  81126. }
  81127. // Context sets the context to be used in this call's Do method. Any
  81128. // pending HTTP request will be aborted if the provided context is
  81129. // canceled.
  81130. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  81131. c.ctx_ = ctx
  81132. return c
  81133. }
  81134. // Header returns an http.Header that can be modified by the caller to
  81135. // add HTTP headers to the request.
  81136. func (c *SslCertificatesInsertCall) Header() http.Header {
  81137. if c.header_ == nil {
  81138. c.header_ = make(http.Header)
  81139. }
  81140. return c.header_
  81141. }
  81142. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  81143. reqHeaders := make(http.Header)
  81144. for k, v := range c.header_ {
  81145. reqHeaders[k] = v
  81146. }
  81147. reqHeaders.Set("User-Agent", c.s.userAgent())
  81148. var body io.Reader = nil
  81149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  81150. if err != nil {
  81151. return nil, err
  81152. }
  81153. reqHeaders.Set("Content-Type", "application/json")
  81154. c.urlParams_.Set("alt", alt)
  81155. c.urlParams_.Set("prettyPrint", "false")
  81156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  81157. urls += "?" + c.urlParams_.Encode()
  81158. req, err := http.NewRequest("POST", urls, body)
  81159. if err != nil {
  81160. return nil, err
  81161. }
  81162. req.Header = reqHeaders
  81163. googleapi.Expand(req.URL, map[string]string{
  81164. "project": c.project,
  81165. })
  81166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81167. }
  81168. // Do executes the "compute.sslCertificates.insert" call.
  81169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81170. // status code is an error. Response headers are in either
  81171. // *Operation.ServerResponse.Header or (if a response was returned at
  81172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81173. // to check whether the returned error was because
  81174. // http.StatusNotModified was returned.
  81175. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81176. gensupport.SetOptions(c.urlParams_, opts...)
  81177. res, err := c.doRequest("json")
  81178. if res != nil && res.StatusCode == http.StatusNotModified {
  81179. if res.Body != nil {
  81180. res.Body.Close()
  81181. }
  81182. return nil, &googleapi.Error{
  81183. Code: res.StatusCode,
  81184. Header: res.Header,
  81185. }
  81186. }
  81187. if err != nil {
  81188. return nil, err
  81189. }
  81190. defer googleapi.CloseBody(res)
  81191. if err := googleapi.CheckResponse(res); err != nil {
  81192. return nil, err
  81193. }
  81194. ret := &Operation{
  81195. ServerResponse: googleapi.ServerResponse{
  81196. Header: res.Header,
  81197. HTTPStatusCode: res.StatusCode,
  81198. },
  81199. }
  81200. target := &ret
  81201. if err := gensupport.DecodeResponse(target, res); err != nil {
  81202. return nil, err
  81203. }
  81204. return ret, nil
  81205. // {
  81206. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  81207. // "httpMethod": "POST",
  81208. // "id": "compute.sslCertificates.insert",
  81209. // "parameterOrder": [
  81210. // "project"
  81211. // ],
  81212. // "parameters": {
  81213. // "project": {
  81214. // "description": "Project ID for this request.",
  81215. // "location": "path",
  81216. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81217. // "required": true,
  81218. // "type": "string"
  81219. // },
  81220. // "requestId": {
  81221. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81222. // "location": "query",
  81223. // "type": "string"
  81224. // }
  81225. // },
  81226. // "path": "{project}/global/sslCertificates",
  81227. // "request": {
  81228. // "$ref": "SslCertificate"
  81229. // },
  81230. // "response": {
  81231. // "$ref": "Operation"
  81232. // },
  81233. // "scopes": [
  81234. // "https://www.googleapis.com/auth/cloud-platform",
  81235. // "https://www.googleapis.com/auth/compute"
  81236. // ]
  81237. // }
  81238. }
  81239. // method id "compute.sslCertificates.list":
  81240. type SslCertificatesListCall struct {
  81241. s *Service
  81242. project string
  81243. urlParams_ gensupport.URLParams
  81244. ifNoneMatch_ string
  81245. ctx_ context.Context
  81246. header_ http.Header
  81247. }
  81248. // List: Retrieves the list of SslCertificate resources available to the
  81249. // specified project.
  81250. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  81251. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81252. c.project = project
  81253. return c
  81254. }
  81255. // Filter sets the optional parameter "filter": A filter expression that
  81256. // filters resources listed in the response. The expression must specify
  81257. // the field name, a comparison operator, and the value that you want to
  81258. // use for filtering. The value must be a string, a number, or a
  81259. // boolean. The comparison operator must be either =, !=, >, or <.
  81260. //
  81261. // For example, if you are filtering Compute Engine instances, you can
  81262. // exclude instances named example-instance by specifying name !=
  81263. // example-instance.
  81264. //
  81265. // You can also filter nested fields. For example, you could specify
  81266. // scheduling.automaticRestart = false to include instances only if they
  81267. // are not scheduled for automatic restarts. You can use filtering on
  81268. // nested fields to filter based on resource labels.
  81269. //
  81270. // To filter on multiple expressions, provide each separate expression
  81271. // within parentheses. For example, (scheduling.automaticRestart = true)
  81272. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81273. // AND expression. However, you can include AND and OR expressions
  81274. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81275. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81276. // true).
  81277. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  81278. c.urlParams_.Set("filter", filter)
  81279. return c
  81280. }
  81281. // MaxResults sets the optional parameter "maxResults": The maximum
  81282. // number of results per page that should be returned. If the number of
  81283. // available results is larger than maxResults, Compute Engine returns a
  81284. // nextPageToken that can be used to get the next page of results in
  81285. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81286. // (Default: 500)
  81287. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  81288. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81289. return c
  81290. }
  81291. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  81292. // a certain order. By default, results are returned in alphanumerical
  81293. // order based on the resource name.
  81294. //
  81295. // You can also sort results in descending order based on the creation
  81296. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81297. // based on the creationTimestamp field in reverse chronological order
  81298. // (newest result first). Use this to sort resources like operations so
  81299. // that the newest operation is returned first.
  81300. //
  81301. // Currently, only sorting by name or creationTimestamp desc is
  81302. // supported.
  81303. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  81304. c.urlParams_.Set("orderBy", orderBy)
  81305. return c
  81306. }
  81307. // PageToken sets the optional parameter "pageToken": Specifies a page
  81308. // token to use. Set pageToken to the nextPageToken returned by a
  81309. // previous list request to get the next page of results.
  81310. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  81311. c.urlParams_.Set("pageToken", pageToken)
  81312. return c
  81313. }
  81314. // Fields allows partial responses to be retrieved. See
  81315. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81316. // for more information.
  81317. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  81318. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81319. return c
  81320. }
  81321. // IfNoneMatch sets the optional parameter which makes the operation
  81322. // fail if the object's ETag matches the given value. This is useful for
  81323. // getting updates only after the object has changed since the last
  81324. // request. Use googleapi.IsNotModified to check whether the response
  81325. // error from Do is the result of In-None-Match.
  81326. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  81327. c.ifNoneMatch_ = entityTag
  81328. return c
  81329. }
  81330. // Context sets the context to be used in this call's Do method. Any
  81331. // pending HTTP request will be aborted if the provided context is
  81332. // canceled.
  81333. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  81334. c.ctx_ = ctx
  81335. return c
  81336. }
  81337. // Header returns an http.Header that can be modified by the caller to
  81338. // add HTTP headers to the request.
  81339. func (c *SslCertificatesListCall) Header() http.Header {
  81340. if c.header_ == nil {
  81341. c.header_ = make(http.Header)
  81342. }
  81343. return c.header_
  81344. }
  81345. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  81346. reqHeaders := make(http.Header)
  81347. for k, v := range c.header_ {
  81348. reqHeaders[k] = v
  81349. }
  81350. reqHeaders.Set("User-Agent", c.s.userAgent())
  81351. if c.ifNoneMatch_ != "" {
  81352. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81353. }
  81354. var body io.Reader = nil
  81355. c.urlParams_.Set("alt", alt)
  81356. c.urlParams_.Set("prettyPrint", "false")
  81357. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  81358. urls += "?" + c.urlParams_.Encode()
  81359. req, err := http.NewRequest("GET", urls, body)
  81360. if err != nil {
  81361. return nil, err
  81362. }
  81363. req.Header = reqHeaders
  81364. googleapi.Expand(req.URL, map[string]string{
  81365. "project": c.project,
  81366. })
  81367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81368. }
  81369. // Do executes the "compute.sslCertificates.list" call.
  81370. // Exactly one of *SslCertificateList or error will be non-nil. Any
  81371. // non-2xx status code is an error. Response headers are in either
  81372. // *SslCertificateList.ServerResponse.Header or (if a response was
  81373. // returned at all) in error.(*googleapi.Error).Header. Use
  81374. // googleapi.IsNotModified to check whether the returned error was
  81375. // because http.StatusNotModified was returned.
  81376. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  81377. gensupport.SetOptions(c.urlParams_, opts...)
  81378. res, err := c.doRequest("json")
  81379. if res != nil && res.StatusCode == http.StatusNotModified {
  81380. if res.Body != nil {
  81381. res.Body.Close()
  81382. }
  81383. return nil, &googleapi.Error{
  81384. Code: res.StatusCode,
  81385. Header: res.Header,
  81386. }
  81387. }
  81388. if err != nil {
  81389. return nil, err
  81390. }
  81391. defer googleapi.CloseBody(res)
  81392. if err := googleapi.CheckResponse(res); err != nil {
  81393. return nil, err
  81394. }
  81395. ret := &SslCertificateList{
  81396. ServerResponse: googleapi.ServerResponse{
  81397. Header: res.Header,
  81398. HTTPStatusCode: res.StatusCode,
  81399. },
  81400. }
  81401. target := &ret
  81402. if err := gensupport.DecodeResponse(target, res); err != nil {
  81403. return nil, err
  81404. }
  81405. return ret, nil
  81406. // {
  81407. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  81408. // "httpMethod": "GET",
  81409. // "id": "compute.sslCertificates.list",
  81410. // "parameterOrder": [
  81411. // "project"
  81412. // ],
  81413. // "parameters": {
  81414. // "filter": {
  81415. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  81416. // "location": "query",
  81417. // "type": "string"
  81418. // },
  81419. // "maxResults": {
  81420. // "default": "500",
  81421. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  81422. // "format": "uint32",
  81423. // "location": "query",
  81424. // "minimum": "0",
  81425. // "type": "integer"
  81426. // },
  81427. // "orderBy": {
  81428. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  81429. // "location": "query",
  81430. // "type": "string"
  81431. // },
  81432. // "pageToken": {
  81433. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  81434. // "location": "query",
  81435. // "type": "string"
  81436. // },
  81437. // "project": {
  81438. // "description": "Project ID for this request.",
  81439. // "location": "path",
  81440. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81441. // "required": true,
  81442. // "type": "string"
  81443. // }
  81444. // },
  81445. // "path": "{project}/global/sslCertificates",
  81446. // "response": {
  81447. // "$ref": "SslCertificateList"
  81448. // },
  81449. // "scopes": [
  81450. // "https://www.googleapis.com/auth/cloud-platform",
  81451. // "https://www.googleapis.com/auth/compute",
  81452. // "https://www.googleapis.com/auth/compute.readonly"
  81453. // ]
  81454. // }
  81455. }
  81456. // Pages invokes f for each page of results.
  81457. // A non-nil error returned from f will halt the iteration.
  81458. // The provided context supersedes any context provided to the Context method.
  81459. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  81460. c.ctx_ = ctx
  81461. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81462. for {
  81463. x, err := c.Do()
  81464. if err != nil {
  81465. return err
  81466. }
  81467. if err := f(x); err != nil {
  81468. return err
  81469. }
  81470. if x.NextPageToken == "" {
  81471. return nil
  81472. }
  81473. c.PageToken(x.NextPageToken)
  81474. }
  81475. }
  81476. // method id "compute.sslPolicies.delete":
  81477. type SslPoliciesDeleteCall struct {
  81478. s *Service
  81479. project string
  81480. sslPolicy string
  81481. urlParams_ gensupport.URLParams
  81482. ctx_ context.Context
  81483. header_ http.Header
  81484. }
  81485. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  81486. // be deleted only if it is not in use by any TargetHttpsProxy or
  81487. // TargetSslProxy resources.
  81488. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  81489. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81490. c.project = project
  81491. c.sslPolicy = sslPolicy
  81492. return c
  81493. }
  81494. // RequestId sets the optional parameter "requestId": An optional
  81495. // request ID to identify requests. Specify a unique request ID so that
  81496. // if you must retry your request, the server will know to ignore the
  81497. // request if it has already been completed.
  81498. //
  81499. // For example, consider a situation where you make an initial request
  81500. // and the request times out. If you make the request again with the
  81501. // same request ID, the server can check if original operation with the
  81502. // same request ID was received, and if so, will ignore the second
  81503. // request. This prevents clients from accidentally creating duplicate
  81504. // commitments.
  81505. //
  81506. // The request ID must be a valid UUID with the exception that zero UUID
  81507. // is not supported (00000000-0000-0000-0000-000000000000).
  81508. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  81509. c.urlParams_.Set("requestId", requestId)
  81510. return c
  81511. }
  81512. // Fields allows partial responses to be retrieved. See
  81513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81514. // for more information.
  81515. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  81516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81517. return c
  81518. }
  81519. // Context sets the context to be used in this call's Do method. Any
  81520. // pending HTTP request will be aborted if the provided context is
  81521. // canceled.
  81522. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  81523. c.ctx_ = ctx
  81524. return c
  81525. }
  81526. // Header returns an http.Header that can be modified by the caller to
  81527. // add HTTP headers to the request.
  81528. func (c *SslPoliciesDeleteCall) Header() http.Header {
  81529. if c.header_ == nil {
  81530. c.header_ = make(http.Header)
  81531. }
  81532. return c.header_
  81533. }
  81534. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  81535. reqHeaders := make(http.Header)
  81536. for k, v := range c.header_ {
  81537. reqHeaders[k] = v
  81538. }
  81539. reqHeaders.Set("User-Agent", c.s.userAgent())
  81540. var body io.Reader = nil
  81541. c.urlParams_.Set("alt", alt)
  81542. c.urlParams_.Set("prettyPrint", "false")
  81543. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  81544. urls += "?" + c.urlParams_.Encode()
  81545. req, err := http.NewRequest("DELETE", urls, body)
  81546. if err != nil {
  81547. return nil, err
  81548. }
  81549. req.Header = reqHeaders
  81550. googleapi.Expand(req.URL, map[string]string{
  81551. "project": c.project,
  81552. "sslPolicy": c.sslPolicy,
  81553. })
  81554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81555. }
  81556. // Do executes the "compute.sslPolicies.delete" call.
  81557. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81558. // status code is an error. Response headers are in either
  81559. // *Operation.ServerResponse.Header or (if a response was returned at
  81560. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81561. // to check whether the returned error was because
  81562. // http.StatusNotModified was returned.
  81563. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81564. gensupport.SetOptions(c.urlParams_, opts...)
  81565. res, err := c.doRequest("json")
  81566. if res != nil && res.StatusCode == http.StatusNotModified {
  81567. if res.Body != nil {
  81568. res.Body.Close()
  81569. }
  81570. return nil, &googleapi.Error{
  81571. Code: res.StatusCode,
  81572. Header: res.Header,
  81573. }
  81574. }
  81575. if err != nil {
  81576. return nil, err
  81577. }
  81578. defer googleapi.CloseBody(res)
  81579. if err := googleapi.CheckResponse(res); err != nil {
  81580. return nil, err
  81581. }
  81582. ret := &Operation{
  81583. ServerResponse: googleapi.ServerResponse{
  81584. Header: res.Header,
  81585. HTTPStatusCode: res.StatusCode,
  81586. },
  81587. }
  81588. target := &ret
  81589. if err := gensupport.DecodeResponse(target, res); err != nil {
  81590. return nil, err
  81591. }
  81592. return ret, nil
  81593. // {
  81594. // "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.",
  81595. // "httpMethod": "DELETE",
  81596. // "id": "compute.sslPolicies.delete",
  81597. // "parameterOrder": [
  81598. // "project",
  81599. // "sslPolicy"
  81600. // ],
  81601. // "parameters": {
  81602. // "project": {
  81603. // "description": "Project ID for this request.",
  81604. // "location": "path",
  81605. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81606. // "required": true,
  81607. // "type": "string"
  81608. // },
  81609. // "requestId": {
  81610. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81611. // "location": "query",
  81612. // "type": "string"
  81613. // },
  81614. // "sslPolicy": {
  81615. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  81616. // "location": "path",
  81617. // "required": true,
  81618. // "type": "string"
  81619. // }
  81620. // },
  81621. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  81622. // "response": {
  81623. // "$ref": "Operation"
  81624. // },
  81625. // "scopes": [
  81626. // "https://www.googleapis.com/auth/cloud-platform",
  81627. // "https://www.googleapis.com/auth/compute"
  81628. // ]
  81629. // }
  81630. }
  81631. // method id "compute.sslPolicies.get":
  81632. type SslPoliciesGetCall struct {
  81633. s *Service
  81634. project string
  81635. sslPolicy string
  81636. urlParams_ gensupport.URLParams
  81637. ifNoneMatch_ string
  81638. ctx_ context.Context
  81639. header_ http.Header
  81640. }
  81641. // Get: Lists all of the ordered rules present in a single specified
  81642. // policy.
  81643. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  81644. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81645. c.project = project
  81646. c.sslPolicy = sslPolicy
  81647. return c
  81648. }
  81649. // Fields allows partial responses to be retrieved. See
  81650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81651. // for more information.
  81652. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  81653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81654. return c
  81655. }
  81656. // IfNoneMatch sets the optional parameter which makes the operation
  81657. // fail if the object's ETag matches the given value. This is useful for
  81658. // getting updates only after the object has changed since the last
  81659. // request. Use googleapi.IsNotModified to check whether the response
  81660. // error from Do is the result of In-None-Match.
  81661. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  81662. c.ifNoneMatch_ = entityTag
  81663. return c
  81664. }
  81665. // Context sets the context to be used in this call's Do method. Any
  81666. // pending HTTP request will be aborted if the provided context is
  81667. // canceled.
  81668. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  81669. c.ctx_ = ctx
  81670. return c
  81671. }
  81672. // Header returns an http.Header that can be modified by the caller to
  81673. // add HTTP headers to the request.
  81674. func (c *SslPoliciesGetCall) Header() http.Header {
  81675. if c.header_ == nil {
  81676. c.header_ = make(http.Header)
  81677. }
  81678. return c.header_
  81679. }
  81680. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  81681. reqHeaders := make(http.Header)
  81682. for k, v := range c.header_ {
  81683. reqHeaders[k] = v
  81684. }
  81685. reqHeaders.Set("User-Agent", c.s.userAgent())
  81686. if c.ifNoneMatch_ != "" {
  81687. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81688. }
  81689. var body io.Reader = nil
  81690. c.urlParams_.Set("alt", alt)
  81691. c.urlParams_.Set("prettyPrint", "false")
  81692. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  81693. urls += "?" + c.urlParams_.Encode()
  81694. req, err := http.NewRequest("GET", urls, body)
  81695. if err != nil {
  81696. return nil, err
  81697. }
  81698. req.Header = reqHeaders
  81699. googleapi.Expand(req.URL, map[string]string{
  81700. "project": c.project,
  81701. "sslPolicy": c.sslPolicy,
  81702. })
  81703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81704. }
  81705. // Do executes the "compute.sslPolicies.get" call.
  81706. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  81707. // status code is an error. Response headers are in either
  81708. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  81709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81710. // to check whether the returned error was because
  81711. // http.StatusNotModified was returned.
  81712. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  81713. gensupport.SetOptions(c.urlParams_, opts...)
  81714. res, err := c.doRequest("json")
  81715. if res != nil && res.StatusCode == http.StatusNotModified {
  81716. if res.Body != nil {
  81717. res.Body.Close()
  81718. }
  81719. return nil, &googleapi.Error{
  81720. Code: res.StatusCode,
  81721. Header: res.Header,
  81722. }
  81723. }
  81724. if err != nil {
  81725. return nil, err
  81726. }
  81727. defer googleapi.CloseBody(res)
  81728. if err := googleapi.CheckResponse(res); err != nil {
  81729. return nil, err
  81730. }
  81731. ret := &SslPolicy{
  81732. ServerResponse: googleapi.ServerResponse{
  81733. Header: res.Header,
  81734. HTTPStatusCode: res.StatusCode,
  81735. },
  81736. }
  81737. target := &ret
  81738. if err := gensupport.DecodeResponse(target, res); err != nil {
  81739. return nil, err
  81740. }
  81741. return ret, nil
  81742. // {
  81743. // "description": "Lists all of the ordered rules present in a single specified policy.",
  81744. // "httpMethod": "GET",
  81745. // "id": "compute.sslPolicies.get",
  81746. // "parameterOrder": [
  81747. // "project",
  81748. // "sslPolicy"
  81749. // ],
  81750. // "parameters": {
  81751. // "project": {
  81752. // "description": "Project ID for this request.",
  81753. // "location": "path",
  81754. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81755. // "required": true,
  81756. // "type": "string"
  81757. // },
  81758. // "sslPolicy": {
  81759. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  81760. // "location": "path",
  81761. // "required": true,
  81762. // "type": "string"
  81763. // }
  81764. // },
  81765. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  81766. // "response": {
  81767. // "$ref": "SslPolicy"
  81768. // },
  81769. // "scopes": [
  81770. // "https://www.googleapis.com/auth/cloud-platform",
  81771. // "https://www.googleapis.com/auth/compute",
  81772. // "https://www.googleapis.com/auth/compute.readonly"
  81773. // ]
  81774. // }
  81775. }
  81776. // method id "compute.sslPolicies.insert":
  81777. type SslPoliciesInsertCall struct {
  81778. s *Service
  81779. project string
  81780. sslpolicy *SslPolicy
  81781. urlParams_ gensupport.URLParams
  81782. ctx_ context.Context
  81783. header_ http.Header
  81784. }
  81785. // Insert: Returns the specified SSL policy resource. Gets a list of
  81786. // available SSL policies by making a list() request.
  81787. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  81788. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81789. c.project = project
  81790. c.sslpolicy = sslpolicy
  81791. return c
  81792. }
  81793. // RequestId sets the optional parameter "requestId": An optional
  81794. // request ID to identify requests. Specify a unique request ID so that
  81795. // if you must retry your request, the server will know to ignore the
  81796. // request if it has already been completed.
  81797. //
  81798. // For example, consider a situation where you make an initial request
  81799. // and the request times out. If you make the request again with the
  81800. // same request ID, the server can check if original operation with the
  81801. // same request ID was received, and if so, will ignore the second
  81802. // request. This prevents clients from accidentally creating duplicate
  81803. // commitments.
  81804. //
  81805. // The request ID must be a valid UUID with the exception that zero UUID
  81806. // is not supported (00000000-0000-0000-0000-000000000000).
  81807. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  81808. c.urlParams_.Set("requestId", requestId)
  81809. return c
  81810. }
  81811. // Fields allows partial responses to be retrieved. See
  81812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81813. // for more information.
  81814. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  81815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81816. return c
  81817. }
  81818. // Context sets the context to be used in this call's Do method. Any
  81819. // pending HTTP request will be aborted if the provided context is
  81820. // canceled.
  81821. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  81822. c.ctx_ = ctx
  81823. return c
  81824. }
  81825. // Header returns an http.Header that can be modified by the caller to
  81826. // add HTTP headers to the request.
  81827. func (c *SslPoliciesInsertCall) Header() http.Header {
  81828. if c.header_ == nil {
  81829. c.header_ = make(http.Header)
  81830. }
  81831. return c.header_
  81832. }
  81833. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  81834. reqHeaders := make(http.Header)
  81835. for k, v := range c.header_ {
  81836. reqHeaders[k] = v
  81837. }
  81838. reqHeaders.Set("User-Agent", c.s.userAgent())
  81839. var body io.Reader = nil
  81840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  81841. if err != nil {
  81842. return nil, err
  81843. }
  81844. reqHeaders.Set("Content-Type", "application/json")
  81845. c.urlParams_.Set("alt", alt)
  81846. c.urlParams_.Set("prettyPrint", "false")
  81847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  81848. urls += "?" + c.urlParams_.Encode()
  81849. req, err := http.NewRequest("POST", urls, body)
  81850. if err != nil {
  81851. return nil, err
  81852. }
  81853. req.Header = reqHeaders
  81854. googleapi.Expand(req.URL, map[string]string{
  81855. "project": c.project,
  81856. })
  81857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81858. }
  81859. // Do executes the "compute.sslPolicies.insert" call.
  81860. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81861. // status code is an error. Response headers are in either
  81862. // *Operation.ServerResponse.Header or (if a response was returned at
  81863. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81864. // to check whether the returned error was because
  81865. // http.StatusNotModified was returned.
  81866. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81867. gensupport.SetOptions(c.urlParams_, opts...)
  81868. res, err := c.doRequest("json")
  81869. if res != nil && res.StatusCode == http.StatusNotModified {
  81870. if res.Body != nil {
  81871. res.Body.Close()
  81872. }
  81873. return nil, &googleapi.Error{
  81874. Code: res.StatusCode,
  81875. Header: res.Header,
  81876. }
  81877. }
  81878. if err != nil {
  81879. return nil, err
  81880. }
  81881. defer googleapi.CloseBody(res)
  81882. if err := googleapi.CheckResponse(res); err != nil {
  81883. return nil, err
  81884. }
  81885. ret := &Operation{
  81886. ServerResponse: googleapi.ServerResponse{
  81887. Header: res.Header,
  81888. HTTPStatusCode: res.StatusCode,
  81889. },
  81890. }
  81891. target := &ret
  81892. if err := gensupport.DecodeResponse(target, res); err != nil {
  81893. return nil, err
  81894. }
  81895. return ret, nil
  81896. // {
  81897. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  81898. // "httpMethod": "POST",
  81899. // "id": "compute.sslPolicies.insert",
  81900. // "parameterOrder": [
  81901. // "project"
  81902. // ],
  81903. // "parameters": {
  81904. // "project": {
  81905. // "description": "Project ID for this request.",
  81906. // "location": "path",
  81907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81908. // "required": true,
  81909. // "type": "string"
  81910. // },
  81911. // "requestId": {
  81912. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81913. // "location": "query",
  81914. // "type": "string"
  81915. // }
  81916. // },
  81917. // "path": "{project}/global/sslPolicies",
  81918. // "request": {
  81919. // "$ref": "SslPolicy"
  81920. // },
  81921. // "response": {
  81922. // "$ref": "Operation"
  81923. // },
  81924. // "scopes": [
  81925. // "https://www.googleapis.com/auth/cloud-platform",
  81926. // "https://www.googleapis.com/auth/compute"
  81927. // ]
  81928. // }
  81929. }
  81930. // method id "compute.sslPolicies.list":
  81931. type SslPoliciesListCall struct {
  81932. s *Service
  81933. project string
  81934. urlParams_ gensupport.URLParams
  81935. ifNoneMatch_ string
  81936. ctx_ context.Context
  81937. header_ http.Header
  81938. }
  81939. // List: Lists all the SSL policies that have been configured for the
  81940. // specified project.
  81941. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  81942. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81943. c.project = project
  81944. return c
  81945. }
  81946. // Filter sets the optional parameter "filter": A filter expression that
  81947. // filters resources listed in the response. The expression must specify
  81948. // the field name, a comparison operator, and the value that you want to
  81949. // use for filtering. The value must be a string, a number, or a
  81950. // boolean. The comparison operator must be either =, !=, >, or <.
  81951. //
  81952. // For example, if you are filtering Compute Engine instances, you can
  81953. // exclude instances named example-instance by specifying name !=
  81954. // example-instance.
  81955. //
  81956. // You can also filter nested fields. For example, you could specify
  81957. // scheduling.automaticRestart = false to include instances only if they
  81958. // are not scheduled for automatic restarts. You can use filtering on
  81959. // nested fields to filter based on resource labels.
  81960. //
  81961. // To filter on multiple expressions, provide each separate expression
  81962. // within parentheses. For example, (scheduling.automaticRestart = true)
  81963. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  81964. // AND expression. However, you can include AND and OR expressions
  81965. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  81966. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  81967. // true).
  81968. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  81969. c.urlParams_.Set("filter", filter)
  81970. return c
  81971. }
  81972. // MaxResults sets the optional parameter "maxResults": The maximum
  81973. // number of results per page that should be returned. If the number of
  81974. // available results is larger than maxResults, Compute Engine returns a
  81975. // nextPageToken that can be used to get the next page of results in
  81976. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  81977. // (Default: 500)
  81978. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  81979. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81980. return c
  81981. }
  81982. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  81983. // a certain order. By default, results are returned in alphanumerical
  81984. // order based on the resource name.
  81985. //
  81986. // You can also sort results in descending order based on the creation
  81987. // timestamp using orderBy="creationTimestamp desc". This sorts results
  81988. // based on the creationTimestamp field in reverse chronological order
  81989. // (newest result first). Use this to sort resources like operations so
  81990. // that the newest operation is returned first.
  81991. //
  81992. // Currently, only sorting by name or creationTimestamp desc is
  81993. // supported.
  81994. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  81995. c.urlParams_.Set("orderBy", orderBy)
  81996. return c
  81997. }
  81998. // PageToken sets the optional parameter "pageToken": Specifies a page
  81999. // token to use. Set pageToken to the nextPageToken returned by a
  82000. // previous list request to get the next page of results.
  82001. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  82002. c.urlParams_.Set("pageToken", pageToken)
  82003. return c
  82004. }
  82005. // Fields allows partial responses to be retrieved. See
  82006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82007. // for more information.
  82008. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  82009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82010. return c
  82011. }
  82012. // IfNoneMatch sets the optional parameter which makes the operation
  82013. // fail if the object's ETag matches the given value. This is useful for
  82014. // getting updates only after the object has changed since the last
  82015. // request. Use googleapi.IsNotModified to check whether the response
  82016. // error from Do is the result of In-None-Match.
  82017. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  82018. c.ifNoneMatch_ = entityTag
  82019. return c
  82020. }
  82021. // Context sets the context to be used in this call's Do method. Any
  82022. // pending HTTP request will be aborted if the provided context is
  82023. // canceled.
  82024. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  82025. c.ctx_ = ctx
  82026. return c
  82027. }
  82028. // Header returns an http.Header that can be modified by the caller to
  82029. // add HTTP headers to the request.
  82030. func (c *SslPoliciesListCall) Header() http.Header {
  82031. if c.header_ == nil {
  82032. c.header_ = make(http.Header)
  82033. }
  82034. return c.header_
  82035. }
  82036. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  82037. reqHeaders := make(http.Header)
  82038. for k, v := range c.header_ {
  82039. reqHeaders[k] = v
  82040. }
  82041. reqHeaders.Set("User-Agent", c.s.userAgent())
  82042. if c.ifNoneMatch_ != "" {
  82043. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82044. }
  82045. var body io.Reader = nil
  82046. c.urlParams_.Set("alt", alt)
  82047. c.urlParams_.Set("prettyPrint", "false")
  82048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  82049. urls += "?" + c.urlParams_.Encode()
  82050. req, err := http.NewRequest("GET", urls, body)
  82051. if err != nil {
  82052. return nil, err
  82053. }
  82054. req.Header = reqHeaders
  82055. googleapi.Expand(req.URL, map[string]string{
  82056. "project": c.project,
  82057. })
  82058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82059. }
  82060. // Do executes the "compute.sslPolicies.list" call.
  82061. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  82062. // status code is an error. Response headers are in either
  82063. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  82064. // at all) in error.(*googleapi.Error).Header. Use
  82065. // googleapi.IsNotModified to check whether the returned error was
  82066. // because http.StatusNotModified was returned.
  82067. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  82068. gensupport.SetOptions(c.urlParams_, opts...)
  82069. res, err := c.doRequest("json")
  82070. if res != nil && res.StatusCode == http.StatusNotModified {
  82071. if res.Body != nil {
  82072. res.Body.Close()
  82073. }
  82074. return nil, &googleapi.Error{
  82075. Code: res.StatusCode,
  82076. Header: res.Header,
  82077. }
  82078. }
  82079. if err != nil {
  82080. return nil, err
  82081. }
  82082. defer googleapi.CloseBody(res)
  82083. if err := googleapi.CheckResponse(res); err != nil {
  82084. return nil, err
  82085. }
  82086. ret := &SslPoliciesList{
  82087. ServerResponse: googleapi.ServerResponse{
  82088. Header: res.Header,
  82089. HTTPStatusCode: res.StatusCode,
  82090. },
  82091. }
  82092. target := &ret
  82093. if err := gensupport.DecodeResponse(target, res); err != nil {
  82094. return nil, err
  82095. }
  82096. return ret, nil
  82097. // {
  82098. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  82099. // "httpMethod": "GET",
  82100. // "id": "compute.sslPolicies.list",
  82101. // "parameterOrder": [
  82102. // "project"
  82103. // ],
  82104. // "parameters": {
  82105. // "filter": {
  82106. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82107. // "location": "query",
  82108. // "type": "string"
  82109. // },
  82110. // "maxResults": {
  82111. // "default": "500",
  82112. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82113. // "format": "uint32",
  82114. // "location": "query",
  82115. // "minimum": "0",
  82116. // "type": "integer"
  82117. // },
  82118. // "orderBy": {
  82119. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82120. // "location": "query",
  82121. // "type": "string"
  82122. // },
  82123. // "pageToken": {
  82124. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82125. // "location": "query",
  82126. // "type": "string"
  82127. // },
  82128. // "project": {
  82129. // "description": "Project ID for this request.",
  82130. // "location": "path",
  82131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82132. // "required": true,
  82133. // "type": "string"
  82134. // }
  82135. // },
  82136. // "path": "{project}/global/sslPolicies",
  82137. // "response": {
  82138. // "$ref": "SslPoliciesList"
  82139. // },
  82140. // "scopes": [
  82141. // "https://www.googleapis.com/auth/cloud-platform",
  82142. // "https://www.googleapis.com/auth/compute",
  82143. // "https://www.googleapis.com/auth/compute.readonly"
  82144. // ]
  82145. // }
  82146. }
  82147. // Pages invokes f for each page of results.
  82148. // A non-nil error returned from f will halt the iteration.
  82149. // The provided context supersedes any context provided to the Context method.
  82150. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  82151. c.ctx_ = ctx
  82152. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82153. for {
  82154. x, err := c.Do()
  82155. if err != nil {
  82156. return err
  82157. }
  82158. if err := f(x); err != nil {
  82159. return err
  82160. }
  82161. if x.NextPageToken == "" {
  82162. return nil
  82163. }
  82164. c.PageToken(x.NextPageToken)
  82165. }
  82166. }
  82167. // method id "compute.sslPolicies.listAvailableFeatures":
  82168. type SslPoliciesListAvailableFeaturesCall struct {
  82169. s *Service
  82170. project string
  82171. urlParams_ gensupport.URLParams
  82172. ifNoneMatch_ string
  82173. ctx_ context.Context
  82174. header_ http.Header
  82175. }
  82176. // ListAvailableFeatures: Lists all features that can be specified in
  82177. // the SSL policy when using custom profile.
  82178. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  82179. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82180. c.project = project
  82181. return c
  82182. }
  82183. // Filter sets the optional parameter "filter": A filter expression that
  82184. // filters resources listed in the response. The expression must specify
  82185. // the field name, a comparison operator, and the value that you want to
  82186. // use for filtering. The value must be a string, a number, or a
  82187. // boolean. The comparison operator must be either =, !=, >, or <.
  82188. //
  82189. // For example, if you are filtering Compute Engine instances, you can
  82190. // exclude instances named example-instance by specifying name !=
  82191. // example-instance.
  82192. //
  82193. // You can also filter nested fields. For example, you could specify
  82194. // scheduling.automaticRestart = false to include instances only if they
  82195. // are not scheduled for automatic restarts. You can use filtering on
  82196. // nested fields to filter based on resource labels.
  82197. //
  82198. // To filter on multiple expressions, provide each separate expression
  82199. // within parentheses. For example, (scheduling.automaticRestart = true)
  82200. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82201. // AND expression. However, you can include AND and OR expressions
  82202. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82203. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82204. // true).
  82205. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  82206. c.urlParams_.Set("filter", filter)
  82207. return c
  82208. }
  82209. // MaxResults sets the optional parameter "maxResults": The maximum
  82210. // number of results per page that should be returned. If the number of
  82211. // available results is larger than maxResults, Compute Engine returns a
  82212. // nextPageToken that can be used to get the next page of results in
  82213. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82214. // (Default: 500)
  82215. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  82216. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82217. return c
  82218. }
  82219. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82220. // a certain order. By default, results are returned in alphanumerical
  82221. // order based on the resource name.
  82222. //
  82223. // You can also sort results in descending order based on the creation
  82224. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82225. // based on the creationTimestamp field in reverse chronological order
  82226. // (newest result first). Use this to sort resources like operations so
  82227. // that the newest operation is returned first.
  82228. //
  82229. // Currently, only sorting by name or creationTimestamp desc is
  82230. // supported.
  82231. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  82232. c.urlParams_.Set("orderBy", orderBy)
  82233. return c
  82234. }
  82235. // PageToken sets the optional parameter "pageToken": Specifies a page
  82236. // token to use. Set pageToken to the nextPageToken returned by a
  82237. // previous list request to get the next page of results.
  82238. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  82239. c.urlParams_.Set("pageToken", pageToken)
  82240. return c
  82241. }
  82242. // Fields allows partial responses to be retrieved. See
  82243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82244. // for more information.
  82245. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  82246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82247. return c
  82248. }
  82249. // IfNoneMatch sets the optional parameter which makes the operation
  82250. // fail if the object's ETag matches the given value. This is useful for
  82251. // getting updates only after the object has changed since the last
  82252. // request. Use googleapi.IsNotModified to check whether the response
  82253. // error from Do is the result of In-None-Match.
  82254. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  82255. c.ifNoneMatch_ = entityTag
  82256. return c
  82257. }
  82258. // Context sets the context to be used in this call's Do method. Any
  82259. // pending HTTP request will be aborted if the provided context is
  82260. // canceled.
  82261. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  82262. c.ctx_ = ctx
  82263. return c
  82264. }
  82265. // Header returns an http.Header that can be modified by the caller to
  82266. // add HTTP headers to the request.
  82267. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  82268. if c.header_ == nil {
  82269. c.header_ = make(http.Header)
  82270. }
  82271. return c.header_
  82272. }
  82273. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  82274. reqHeaders := make(http.Header)
  82275. for k, v := range c.header_ {
  82276. reqHeaders[k] = v
  82277. }
  82278. reqHeaders.Set("User-Agent", c.s.userAgent())
  82279. if c.ifNoneMatch_ != "" {
  82280. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82281. }
  82282. var body io.Reader = nil
  82283. c.urlParams_.Set("alt", alt)
  82284. c.urlParams_.Set("prettyPrint", "false")
  82285. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  82286. urls += "?" + c.urlParams_.Encode()
  82287. req, err := http.NewRequest("GET", urls, body)
  82288. if err != nil {
  82289. return nil, err
  82290. }
  82291. req.Header = reqHeaders
  82292. googleapi.Expand(req.URL, map[string]string{
  82293. "project": c.project,
  82294. })
  82295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82296. }
  82297. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  82298. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  82299. // will be non-nil. Any non-2xx status code is an error. Response
  82300. // headers are in either
  82301. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  82302. // (if a response was returned at all) in
  82303. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  82304. // whether the returned error was because http.StatusNotModified was
  82305. // returned.
  82306. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  82307. gensupport.SetOptions(c.urlParams_, opts...)
  82308. res, err := c.doRequest("json")
  82309. if res != nil && res.StatusCode == http.StatusNotModified {
  82310. if res.Body != nil {
  82311. res.Body.Close()
  82312. }
  82313. return nil, &googleapi.Error{
  82314. Code: res.StatusCode,
  82315. Header: res.Header,
  82316. }
  82317. }
  82318. if err != nil {
  82319. return nil, err
  82320. }
  82321. defer googleapi.CloseBody(res)
  82322. if err := googleapi.CheckResponse(res); err != nil {
  82323. return nil, err
  82324. }
  82325. ret := &SslPoliciesListAvailableFeaturesResponse{
  82326. ServerResponse: googleapi.ServerResponse{
  82327. Header: res.Header,
  82328. HTTPStatusCode: res.StatusCode,
  82329. },
  82330. }
  82331. target := &ret
  82332. if err := gensupport.DecodeResponse(target, res); err != nil {
  82333. return nil, err
  82334. }
  82335. return ret, nil
  82336. // {
  82337. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  82338. // "httpMethod": "GET",
  82339. // "id": "compute.sslPolicies.listAvailableFeatures",
  82340. // "parameterOrder": [
  82341. // "project"
  82342. // ],
  82343. // "parameters": {
  82344. // "filter": {
  82345. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82346. // "location": "query",
  82347. // "type": "string"
  82348. // },
  82349. // "maxResults": {
  82350. // "default": "500",
  82351. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82352. // "format": "uint32",
  82353. // "location": "query",
  82354. // "minimum": "0",
  82355. // "type": "integer"
  82356. // },
  82357. // "orderBy": {
  82358. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82359. // "location": "query",
  82360. // "type": "string"
  82361. // },
  82362. // "pageToken": {
  82363. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82364. // "location": "query",
  82365. // "type": "string"
  82366. // },
  82367. // "project": {
  82368. // "description": "Project ID for this request.",
  82369. // "location": "path",
  82370. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82371. // "required": true,
  82372. // "type": "string"
  82373. // }
  82374. // },
  82375. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  82376. // "response": {
  82377. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  82378. // },
  82379. // "scopes": [
  82380. // "https://www.googleapis.com/auth/cloud-platform",
  82381. // "https://www.googleapis.com/auth/compute",
  82382. // "https://www.googleapis.com/auth/compute.readonly"
  82383. // ]
  82384. // }
  82385. }
  82386. // method id "compute.sslPolicies.patch":
  82387. type SslPoliciesPatchCall struct {
  82388. s *Service
  82389. project string
  82390. sslPolicy string
  82391. sslpolicy *SslPolicy
  82392. urlParams_ gensupport.URLParams
  82393. ctx_ context.Context
  82394. header_ http.Header
  82395. }
  82396. // Patch: Patches the specified SSL policy with the data included in the
  82397. // request.
  82398. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  82399. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82400. c.project = project
  82401. c.sslPolicy = sslPolicy
  82402. c.sslpolicy = sslpolicy
  82403. return c
  82404. }
  82405. // RequestId sets the optional parameter "requestId": An optional
  82406. // request ID to identify requests. Specify a unique request ID so that
  82407. // if you must retry your request, the server will know to ignore the
  82408. // request if it has already been completed.
  82409. //
  82410. // For example, consider a situation where you make an initial request
  82411. // and the request times out. If you make the request again with the
  82412. // same request ID, the server can check if original operation with the
  82413. // same request ID was received, and if so, will ignore the second
  82414. // request. This prevents clients from accidentally creating duplicate
  82415. // commitments.
  82416. //
  82417. // The request ID must be a valid UUID with the exception that zero UUID
  82418. // is not supported (00000000-0000-0000-0000-000000000000).
  82419. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  82420. c.urlParams_.Set("requestId", requestId)
  82421. return c
  82422. }
  82423. // Fields allows partial responses to be retrieved. See
  82424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82425. // for more information.
  82426. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  82427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82428. return c
  82429. }
  82430. // Context sets the context to be used in this call's Do method. Any
  82431. // pending HTTP request will be aborted if the provided context is
  82432. // canceled.
  82433. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  82434. c.ctx_ = ctx
  82435. return c
  82436. }
  82437. // Header returns an http.Header that can be modified by the caller to
  82438. // add HTTP headers to the request.
  82439. func (c *SslPoliciesPatchCall) Header() http.Header {
  82440. if c.header_ == nil {
  82441. c.header_ = make(http.Header)
  82442. }
  82443. return c.header_
  82444. }
  82445. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  82446. reqHeaders := make(http.Header)
  82447. for k, v := range c.header_ {
  82448. reqHeaders[k] = v
  82449. }
  82450. reqHeaders.Set("User-Agent", c.s.userAgent())
  82451. var body io.Reader = nil
  82452. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  82453. if err != nil {
  82454. return nil, err
  82455. }
  82456. reqHeaders.Set("Content-Type", "application/json")
  82457. c.urlParams_.Set("alt", alt)
  82458. c.urlParams_.Set("prettyPrint", "false")
  82459. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  82460. urls += "?" + c.urlParams_.Encode()
  82461. req, err := http.NewRequest("PATCH", urls, body)
  82462. if err != nil {
  82463. return nil, err
  82464. }
  82465. req.Header = reqHeaders
  82466. googleapi.Expand(req.URL, map[string]string{
  82467. "project": c.project,
  82468. "sslPolicy": c.sslPolicy,
  82469. })
  82470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82471. }
  82472. // Do executes the "compute.sslPolicies.patch" call.
  82473. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82474. // status code is an error. Response headers are in either
  82475. // *Operation.ServerResponse.Header or (if a response was returned at
  82476. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82477. // to check whether the returned error was because
  82478. // http.StatusNotModified was returned.
  82479. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82480. gensupport.SetOptions(c.urlParams_, opts...)
  82481. res, err := c.doRequest("json")
  82482. if res != nil && res.StatusCode == http.StatusNotModified {
  82483. if res.Body != nil {
  82484. res.Body.Close()
  82485. }
  82486. return nil, &googleapi.Error{
  82487. Code: res.StatusCode,
  82488. Header: res.Header,
  82489. }
  82490. }
  82491. if err != nil {
  82492. return nil, err
  82493. }
  82494. defer googleapi.CloseBody(res)
  82495. if err := googleapi.CheckResponse(res); err != nil {
  82496. return nil, err
  82497. }
  82498. ret := &Operation{
  82499. ServerResponse: googleapi.ServerResponse{
  82500. Header: res.Header,
  82501. HTTPStatusCode: res.StatusCode,
  82502. },
  82503. }
  82504. target := &ret
  82505. if err := gensupport.DecodeResponse(target, res); err != nil {
  82506. return nil, err
  82507. }
  82508. return ret, nil
  82509. // {
  82510. // "description": "Patches the specified SSL policy with the data included in the request.",
  82511. // "httpMethod": "PATCH",
  82512. // "id": "compute.sslPolicies.patch",
  82513. // "parameterOrder": [
  82514. // "project",
  82515. // "sslPolicy"
  82516. // ],
  82517. // "parameters": {
  82518. // "project": {
  82519. // "description": "Project ID for this request.",
  82520. // "location": "path",
  82521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82522. // "required": true,
  82523. // "type": "string"
  82524. // },
  82525. // "requestId": {
  82526. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82527. // "location": "query",
  82528. // "type": "string"
  82529. // },
  82530. // "sslPolicy": {
  82531. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  82532. // "location": "path",
  82533. // "required": true,
  82534. // "type": "string"
  82535. // }
  82536. // },
  82537. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  82538. // "request": {
  82539. // "$ref": "SslPolicy"
  82540. // },
  82541. // "response": {
  82542. // "$ref": "Operation"
  82543. // },
  82544. // "scopes": [
  82545. // "https://www.googleapis.com/auth/cloud-platform",
  82546. // "https://www.googleapis.com/auth/compute"
  82547. // ]
  82548. // }
  82549. }
  82550. // method id "compute.subnetworks.aggregatedList":
  82551. type SubnetworksAggregatedListCall struct {
  82552. s *Service
  82553. project string
  82554. urlParams_ gensupport.URLParams
  82555. ifNoneMatch_ string
  82556. ctx_ context.Context
  82557. header_ http.Header
  82558. }
  82559. // AggregatedList: Retrieves an aggregated list of subnetworks.
  82560. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  82561. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82562. c.project = project
  82563. return c
  82564. }
  82565. // Filter sets the optional parameter "filter": A filter expression that
  82566. // filters resources listed in the response. The expression must specify
  82567. // the field name, a comparison operator, and the value that you want to
  82568. // use for filtering. The value must be a string, a number, or a
  82569. // boolean. The comparison operator must be either =, !=, >, or <.
  82570. //
  82571. // For example, if you are filtering Compute Engine instances, you can
  82572. // exclude instances named example-instance by specifying name !=
  82573. // example-instance.
  82574. //
  82575. // You can also filter nested fields. For example, you could specify
  82576. // scheduling.automaticRestart = false to include instances only if they
  82577. // are not scheduled for automatic restarts. You can use filtering on
  82578. // nested fields to filter based on resource labels.
  82579. //
  82580. // To filter on multiple expressions, provide each separate expression
  82581. // within parentheses. For example, (scheduling.automaticRestart = true)
  82582. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82583. // AND expression. However, you can include AND and OR expressions
  82584. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82585. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82586. // true).
  82587. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  82588. c.urlParams_.Set("filter", filter)
  82589. return c
  82590. }
  82591. // MaxResults sets the optional parameter "maxResults": The maximum
  82592. // number of results per page that should be returned. If the number of
  82593. // available results is larger than maxResults, Compute Engine returns a
  82594. // nextPageToken that can be used to get the next page of results in
  82595. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82596. // (Default: 500)
  82597. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  82598. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82599. return c
  82600. }
  82601. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82602. // a certain order. By default, results are returned in alphanumerical
  82603. // order based on the resource name.
  82604. //
  82605. // You can also sort results in descending order based on the creation
  82606. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82607. // based on the creationTimestamp field in reverse chronological order
  82608. // (newest result first). Use this to sort resources like operations so
  82609. // that the newest operation is returned first.
  82610. //
  82611. // Currently, only sorting by name or creationTimestamp desc is
  82612. // supported.
  82613. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  82614. c.urlParams_.Set("orderBy", orderBy)
  82615. return c
  82616. }
  82617. // PageToken sets the optional parameter "pageToken": Specifies a page
  82618. // token to use. Set pageToken to the nextPageToken returned by a
  82619. // previous list request to get the next page of results.
  82620. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  82621. c.urlParams_.Set("pageToken", pageToken)
  82622. return c
  82623. }
  82624. // Fields allows partial responses to be retrieved. See
  82625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82626. // for more information.
  82627. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  82628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82629. return c
  82630. }
  82631. // IfNoneMatch sets the optional parameter which makes the operation
  82632. // fail if the object's ETag matches the given value. This is useful for
  82633. // getting updates only after the object has changed since the last
  82634. // request. Use googleapi.IsNotModified to check whether the response
  82635. // error from Do is the result of In-None-Match.
  82636. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  82637. c.ifNoneMatch_ = entityTag
  82638. return c
  82639. }
  82640. // Context sets the context to be used in this call's Do method. Any
  82641. // pending HTTP request will be aborted if the provided context is
  82642. // canceled.
  82643. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  82644. c.ctx_ = ctx
  82645. return c
  82646. }
  82647. // Header returns an http.Header that can be modified by the caller to
  82648. // add HTTP headers to the request.
  82649. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  82650. if c.header_ == nil {
  82651. c.header_ = make(http.Header)
  82652. }
  82653. return c.header_
  82654. }
  82655. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  82656. reqHeaders := make(http.Header)
  82657. for k, v := range c.header_ {
  82658. reqHeaders[k] = v
  82659. }
  82660. reqHeaders.Set("User-Agent", c.s.userAgent())
  82661. if c.ifNoneMatch_ != "" {
  82662. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82663. }
  82664. var body io.Reader = nil
  82665. c.urlParams_.Set("alt", alt)
  82666. c.urlParams_.Set("prettyPrint", "false")
  82667. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  82668. urls += "?" + c.urlParams_.Encode()
  82669. req, err := http.NewRequest("GET", urls, body)
  82670. if err != nil {
  82671. return nil, err
  82672. }
  82673. req.Header = reqHeaders
  82674. googleapi.Expand(req.URL, map[string]string{
  82675. "project": c.project,
  82676. })
  82677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82678. }
  82679. // Do executes the "compute.subnetworks.aggregatedList" call.
  82680. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  82681. // Any non-2xx status code is an error. Response headers are in either
  82682. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  82683. // returned at all) in error.(*googleapi.Error).Header. Use
  82684. // googleapi.IsNotModified to check whether the returned error was
  82685. // because http.StatusNotModified was returned.
  82686. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  82687. gensupport.SetOptions(c.urlParams_, opts...)
  82688. res, err := c.doRequest("json")
  82689. if res != nil && res.StatusCode == http.StatusNotModified {
  82690. if res.Body != nil {
  82691. res.Body.Close()
  82692. }
  82693. return nil, &googleapi.Error{
  82694. Code: res.StatusCode,
  82695. Header: res.Header,
  82696. }
  82697. }
  82698. if err != nil {
  82699. return nil, err
  82700. }
  82701. defer googleapi.CloseBody(res)
  82702. if err := googleapi.CheckResponse(res); err != nil {
  82703. return nil, err
  82704. }
  82705. ret := &SubnetworkAggregatedList{
  82706. ServerResponse: googleapi.ServerResponse{
  82707. Header: res.Header,
  82708. HTTPStatusCode: res.StatusCode,
  82709. },
  82710. }
  82711. target := &ret
  82712. if err := gensupport.DecodeResponse(target, res); err != nil {
  82713. return nil, err
  82714. }
  82715. return ret, nil
  82716. // {
  82717. // "description": "Retrieves an aggregated list of subnetworks.",
  82718. // "httpMethod": "GET",
  82719. // "id": "compute.subnetworks.aggregatedList",
  82720. // "parameterOrder": [
  82721. // "project"
  82722. // ],
  82723. // "parameters": {
  82724. // "filter": {
  82725. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82726. // "location": "query",
  82727. // "type": "string"
  82728. // },
  82729. // "maxResults": {
  82730. // "default": "500",
  82731. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82732. // "format": "uint32",
  82733. // "location": "query",
  82734. // "minimum": "0",
  82735. // "type": "integer"
  82736. // },
  82737. // "orderBy": {
  82738. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82739. // "location": "query",
  82740. // "type": "string"
  82741. // },
  82742. // "pageToken": {
  82743. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82744. // "location": "query",
  82745. // "type": "string"
  82746. // },
  82747. // "project": {
  82748. // "description": "Project ID for this request.",
  82749. // "location": "path",
  82750. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82751. // "required": true,
  82752. // "type": "string"
  82753. // }
  82754. // },
  82755. // "path": "{project}/aggregated/subnetworks",
  82756. // "response": {
  82757. // "$ref": "SubnetworkAggregatedList"
  82758. // },
  82759. // "scopes": [
  82760. // "https://www.googleapis.com/auth/cloud-platform",
  82761. // "https://www.googleapis.com/auth/compute",
  82762. // "https://www.googleapis.com/auth/compute.readonly"
  82763. // ]
  82764. // }
  82765. }
  82766. // Pages invokes f for each page of results.
  82767. // A non-nil error returned from f will halt the iteration.
  82768. // The provided context supersedes any context provided to the Context method.
  82769. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  82770. c.ctx_ = ctx
  82771. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82772. for {
  82773. x, err := c.Do()
  82774. if err != nil {
  82775. return err
  82776. }
  82777. if err := f(x); err != nil {
  82778. return err
  82779. }
  82780. if x.NextPageToken == "" {
  82781. return nil
  82782. }
  82783. c.PageToken(x.NextPageToken)
  82784. }
  82785. }
  82786. // method id "compute.subnetworks.delete":
  82787. type SubnetworksDeleteCall struct {
  82788. s *Service
  82789. project string
  82790. region string
  82791. subnetwork string
  82792. urlParams_ gensupport.URLParams
  82793. ctx_ context.Context
  82794. header_ http.Header
  82795. }
  82796. // Delete: Deletes the specified subnetwork.
  82797. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  82798. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82799. c.project = project
  82800. c.region = region
  82801. c.subnetwork = subnetwork
  82802. return c
  82803. }
  82804. // RequestId sets the optional parameter "requestId": An optional
  82805. // request ID to identify requests. Specify a unique request ID so that
  82806. // if you must retry your request, the server will know to ignore the
  82807. // request if it has already been completed.
  82808. //
  82809. // For example, consider a situation where you make an initial request
  82810. // and the request times out. If you make the request again with the
  82811. // same request ID, the server can check if original operation with the
  82812. // same request ID was received, and if so, will ignore the second
  82813. // request. This prevents clients from accidentally creating duplicate
  82814. // commitments.
  82815. //
  82816. // The request ID must be a valid UUID with the exception that zero UUID
  82817. // is not supported (00000000-0000-0000-0000-000000000000).
  82818. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  82819. c.urlParams_.Set("requestId", requestId)
  82820. return c
  82821. }
  82822. // Fields allows partial responses to be retrieved. See
  82823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82824. // for more information.
  82825. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  82826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82827. return c
  82828. }
  82829. // Context sets the context to be used in this call's Do method. Any
  82830. // pending HTTP request will be aborted if the provided context is
  82831. // canceled.
  82832. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  82833. c.ctx_ = ctx
  82834. return c
  82835. }
  82836. // Header returns an http.Header that can be modified by the caller to
  82837. // add HTTP headers to the request.
  82838. func (c *SubnetworksDeleteCall) Header() http.Header {
  82839. if c.header_ == nil {
  82840. c.header_ = make(http.Header)
  82841. }
  82842. return c.header_
  82843. }
  82844. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  82845. reqHeaders := make(http.Header)
  82846. for k, v := range c.header_ {
  82847. reqHeaders[k] = v
  82848. }
  82849. reqHeaders.Set("User-Agent", c.s.userAgent())
  82850. var body io.Reader = nil
  82851. c.urlParams_.Set("alt", alt)
  82852. c.urlParams_.Set("prettyPrint", "false")
  82853. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  82854. urls += "?" + c.urlParams_.Encode()
  82855. req, err := http.NewRequest("DELETE", urls, body)
  82856. if err != nil {
  82857. return nil, err
  82858. }
  82859. req.Header = reqHeaders
  82860. googleapi.Expand(req.URL, map[string]string{
  82861. "project": c.project,
  82862. "region": c.region,
  82863. "subnetwork": c.subnetwork,
  82864. })
  82865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82866. }
  82867. // Do executes the "compute.subnetworks.delete" call.
  82868. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82869. // status code is an error. Response headers are in either
  82870. // *Operation.ServerResponse.Header or (if a response was returned at
  82871. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82872. // to check whether the returned error was because
  82873. // http.StatusNotModified was returned.
  82874. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82875. gensupport.SetOptions(c.urlParams_, opts...)
  82876. res, err := c.doRequest("json")
  82877. if res != nil && res.StatusCode == http.StatusNotModified {
  82878. if res.Body != nil {
  82879. res.Body.Close()
  82880. }
  82881. return nil, &googleapi.Error{
  82882. Code: res.StatusCode,
  82883. Header: res.Header,
  82884. }
  82885. }
  82886. if err != nil {
  82887. return nil, err
  82888. }
  82889. defer googleapi.CloseBody(res)
  82890. if err := googleapi.CheckResponse(res); err != nil {
  82891. return nil, err
  82892. }
  82893. ret := &Operation{
  82894. ServerResponse: googleapi.ServerResponse{
  82895. Header: res.Header,
  82896. HTTPStatusCode: res.StatusCode,
  82897. },
  82898. }
  82899. target := &ret
  82900. if err := gensupport.DecodeResponse(target, res); err != nil {
  82901. return nil, err
  82902. }
  82903. return ret, nil
  82904. // {
  82905. // "description": "Deletes the specified subnetwork.",
  82906. // "httpMethod": "DELETE",
  82907. // "id": "compute.subnetworks.delete",
  82908. // "parameterOrder": [
  82909. // "project",
  82910. // "region",
  82911. // "subnetwork"
  82912. // ],
  82913. // "parameters": {
  82914. // "project": {
  82915. // "description": "Project ID for this request.",
  82916. // "location": "path",
  82917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82918. // "required": true,
  82919. // "type": "string"
  82920. // },
  82921. // "region": {
  82922. // "description": "Name of the region scoping this request.",
  82923. // "location": "path",
  82924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82925. // "required": true,
  82926. // "type": "string"
  82927. // },
  82928. // "requestId": {
  82929. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82930. // "location": "query",
  82931. // "type": "string"
  82932. // },
  82933. // "subnetwork": {
  82934. // "description": "Name of the Subnetwork resource to delete.",
  82935. // "location": "path",
  82936. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82937. // "required": true,
  82938. // "type": "string"
  82939. // }
  82940. // },
  82941. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  82942. // "response": {
  82943. // "$ref": "Operation"
  82944. // },
  82945. // "scopes": [
  82946. // "https://www.googleapis.com/auth/cloud-platform",
  82947. // "https://www.googleapis.com/auth/compute"
  82948. // ]
  82949. // }
  82950. }
  82951. // method id "compute.subnetworks.expandIpCidrRange":
  82952. type SubnetworksExpandIpCidrRangeCall struct {
  82953. s *Service
  82954. project string
  82955. region string
  82956. subnetwork string
  82957. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  82958. urlParams_ gensupport.URLParams
  82959. ctx_ context.Context
  82960. header_ http.Header
  82961. }
  82962. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  82963. // specified value.
  82964. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  82965. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82966. c.project = project
  82967. c.region = region
  82968. c.subnetwork = subnetwork
  82969. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  82970. return c
  82971. }
  82972. // RequestId sets the optional parameter "requestId": An optional
  82973. // request ID to identify requests. Specify a unique request ID so that
  82974. // if you must retry your request, the server will know to ignore the
  82975. // request if it has already been completed.
  82976. //
  82977. // For example, consider a situation where you make an initial request
  82978. // and the request times out. If you make the request again with the
  82979. // same request ID, the server can check if original operation with the
  82980. // same request ID was received, and if so, will ignore the second
  82981. // request. This prevents clients from accidentally creating duplicate
  82982. // commitments.
  82983. //
  82984. // The request ID must be a valid UUID with the exception that zero UUID
  82985. // is not supported (00000000-0000-0000-0000-000000000000).
  82986. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  82987. c.urlParams_.Set("requestId", requestId)
  82988. return c
  82989. }
  82990. // Fields allows partial responses to be retrieved. See
  82991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82992. // for more information.
  82993. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  82994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82995. return c
  82996. }
  82997. // Context sets the context to be used in this call's Do method. Any
  82998. // pending HTTP request will be aborted if the provided context is
  82999. // canceled.
  83000. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  83001. c.ctx_ = ctx
  83002. return c
  83003. }
  83004. // Header returns an http.Header that can be modified by the caller to
  83005. // add HTTP headers to the request.
  83006. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  83007. if c.header_ == nil {
  83008. c.header_ = make(http.Header)
  83009. }
  83010. return c.header_
  83011. }
  83012. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  83013. reqHeaders := make(http.Header)
  83014. for k, v := range c.header_ {
  83015. reqHeaders[k] = v
  83016. }
  83017. reqHeaders.Set("User-Agent", c.s.userAgent())
  83018. var body io.Reader = nil
  83019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  83020. if err != nil {
  83021. return nil, err
  83022. }
  83023. reqHeaders.Set("Content-Type", "application/json")
  83024. c.urlParams_.Set("alt", alt)
  83025. c.urlParams_.Set("prettyPrint", "false")
  83026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  83027. urls += "?" + c.urlParams_.Encode()
  83028. req, err := http.NewRequest("POST", urls, body)
  83029. if err != nil {
  83030. return nil, err
  83031. }
  83032. req.Header = reqHeaders
  83033. googleapi.Expand(req.URL, map[string]string{
  83034. "project": c.project,
  83035. "region": c.region,
  83036. "subnetwork": c.subnetwork,
  83037. })
  83038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83039. }
  83040. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  83041. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83042. // status code is an error. Response headers are in either
  83043. // *Operation.ServerResponse.Header or (if a response was returned at
  83044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83045. // to check whether the returned error was because
  83046. // http.StatusNotModified was returned.
  83047. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83048. gensupport.SetOptions(c.urlParams_, opts...)
  83049. res, err := c.doRequest("json")
  83050. if res != nil && res.StatusCode == http.StatusNotModified {
  83051. if res.Body != nil {
  83052. res.Body.Close()
  83053. }
  83054. return nil, &googleapi.Error{
  83055. Code: res.StatusCode,
  83056. Header: res.Header,
  83057. }
  83058. }
  83059. if err != nil {
  83060. return nil, err
  83061. }
  83062. defer googleapi.CloseBody(res)
  83063. if err := googleapi.CheckResponse(res); err != nil {
  83064. return nil, err
  83065. }
  83066. ret := &Operation{
  83067. ServerResponse: googleapi.ServerResponse{
  83068. Header: res.Header,
  83069. HTTPStatusCode: res.StatusCode,
  83070. },
  83071. }
  83072. target := &ret
  83073. if err := gensupport.DecodeResponse(target, res); err != nil {
  83074. return nil, err
  83075. }
  83076. return ret, nil
  83077. // {
  83078. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  83079. // "httpMethod": "POST",
  83080. // "id": "compute.subnetworks.expandIpCidrRange",
  83081. // "parameterOrder": [
  83082. // "project",
  83083. // "region",
  83084. // "subnetwork"
  83085. // ],
  83086. // "parameters": {
  83087. // "project": {
  83088. // "description": "Project ID for this request.",
  83089. // "location": "path",
  83090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83091. // "required": true,
  83092. // "type": "string"
  83093. // },
  83094. // "region": {
  83095. // "description": "Name of the region scoping this request.",
  83096. // "location": "path",
  83097. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83098. // "required": true,
  83099. // "type": "string"
  83100. // },
  83101. // "requestId": {
  83102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83103. // "location": "query",
  83104. // "type": "string"
  83105. // },
  83106. // "subnetwork": {
  83107. // "description": "Name of the Subnetwork resource to update.",
  83108. // "location": "path",
  83109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83110. // "required": true,
  83111. // "type": "string"
  83112. // }
  83113. // },
  83114. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  83115. // "request": {
  83116. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  83117. // },
  83118. // "response": {
  83119. // "$ref": "Operation"
  83120. // },
  83121. // "scopes": [
  83122. // "https://www.googleapis.com/auth/cloud-platform",
  83123. // "https://www.googleapis.com/auth/compute"
  83124. // ]
  83125. // }
  83126. }
  83127. // method id "compute.subnetworks.get":
  83128. type SubnetworksGetCall struct {
  83129. s *Service
  83130. project string
  83131. region string
  83132. subnetwork string
  83133. urlParams_ gensupport.URLParams
  83134. ifNoneMatch_ string
  83135. ctx_ context.Context
  83136. header_ http.Header
  83137. }
  83138. // Get: Returns the specified subnetwork. Gets a list of available
  83139. // subnetworks list() request.
  83140. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  83141. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83142. c.project = project
  83143. c.region = region
  83144. c.subnetwork = subnetwork
  83145. return c
  83146. }
  83147. // Fields allows partial responses to be retrieved. See
  83148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83149. // for more information.
  83150. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  83151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83152. return c
  83153. }
  83154. // IfNoneMatch sets the optional parameter which makes the operation
  83155. // fail if the object's ETag matches the given value. This is useful for
  83156. // getting updates only after the object has changed since the last
  83157. // request. Use googleapi.IsNotModified to check whether the response
  83158. // error from Do is the result of In-None-Match.
  83159. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  83160. c.ifNoneMatch_ = entityTag
  83161. return c
  83162. }
  83163. // Context sets the context to be used in this call's Do method. Any
  83164. // pending HTTP request will be aborted if the provided context is
  83165. // canceled.
  83166. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  83167. c.ctx_ = ctx
  83168. return c
  83169. }
  83170. // Header returns an http.Header that can be modified by the caller to
  83171. // add HTTP headers to the request.
  83172. func (c *SubnetworksGetCall) Header() http.Header {
  83173. if c.header_ == nil {
  83174. c.header_ = make(http.Header)
  83175. }
  83176. return c.header_
  83177. }
  83178. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  83179. reqHeaders := make(http.Header)
  83180. for k, v := range c.header_ {
  83181. reqHeaders[k] = v
  83182. }
  83183. reqHeaders.Set("User-Agent", c.s.userAgent())
  83184. if c.ifNoneMatch_ != "" {
  83185. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83186. }
  83187. var body io.Reader = nil
  83188. c.urlParams_.Set("alt", alt)
  83189. c.urlParams_.Set("prettyPrint", "false")
  83190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  83191. urls += "?" + c.urlParams_.Encode()
  83192. req, err := http.NewRequest("GET", urls, body)
  83193. if err != nil {
  83194. return nil, err
  83195. }
  83196. req.Header = reqHeaders
  83197. googleapi.Expand(req.URL, map[string]string{
  83198. "project": c.project,
  83199. "region": c.region,
  83200. "subnetwork": c.subnetwork,
  83201. })
  83202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83203. }
  83204. // Do executes the "compute.subnetworks.get" call.
  83205. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  83206. // status code is an error. Response headers are in either
  83207. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  83208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83209. // to check whether the returned error was because
  83210. // http.StatusNotModified was returned.
  83211. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  83212. gensupport.SetOptions(c.urlParams_, opts...)
  83213. res, err := c.doRequest("json")
  83214. if res != nil && res.StatusCode == http.StatusNotModified {
  83215. if res.Body != nil {
  83216. res.Body.Close()
  83217. }
  83218. return nil, &googleapi.Error{
  83219. Code: res.StatusCode,
  83220. Header: res.Header,
  83221. }
  83222. }
  83223. if err != nil {
  83224. return nil, err
  83225. }
  83226. defer googleapi.CloseBody(res)
  83227. if err := googleapi.CheckResponse(res); err != nil {
  83228. return nil, err
  83229. }
  83230. ret := &Subnetwork{
  83231. ServerResponse: googleapi.ServerResponse{
  83232. Header: res.Header,
  83233. HTTPStatusCode: res.StatusCode,
  83234. },
  83235. }
  83236. target := &ret
  83237. if err := gensupport.DecodeResponse(target, res); err != nil {
  83238. return nil, err
  83239. }
  83240. return ret, nil
  83241. // {
  83242. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  83243. // "httpMethod": "GET",
  83244. // "id": "compute.subnetworks.get",
  83245. // "parameterOrder": [
  83246. // "project",
  83247. // "region",
  83248. // "subnetwork"
  83249. // ],
  83250. // "parameters": {
  83251. // "project": {
  83252. // "description": "Project ID for this request.",
  83253. // "location": "path",
  83254. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83255. // "required": true,
  83256. // "type": "string"
  83257. // },
  83258. // "region": {
  83259. // "description": "Name of the region scoping this request.",
  83260. // "location": "path",
  83261. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83262. // "required": true,
  83263. // "type": "string"
  83264. // },
  83265. // "subnetwork": {
  83266. // "description": "Name of the Subnetwork resource to return.",
  83267. // "location": "path",
  83268. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83269. // "required": true,
  83270. // "type": "string"
  83271. // }
  83272. // },
  83273. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  83274. // "response": {
  83275. // "$ref": "Subnetwork"
  83276. // },
  83277. // "scopes": [
  83278. // "https://www.googleapis.com/auth/cloud-platform",
  83279. // "https://www.googleapis.com/auth/compute",
  83280. // "https://www.googleapis.com/auth/compute.readonly"
  83281. // ]
  83282. // }
  83283. }
  83284. // method id "compute.subnetworks.getIamPolicy":
  83285. type SubnetworksGetIamPolicyCall struct {
  83286. s *Service
  83287. project string
  83288. region string
  83289. resource string
  83290. urlParams_ gensupport.URLParams
  83291. ifNoneMatch_ string
  83292. ctx_ context.Context
  83293. header_ http.Header
  83294. }
  83295. // GetIamPolicy: Gets the access control policy for a resource. May be
  83296. // empty if no such policy or resource exists.
  83297. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  83298. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83299. c.project = project
  83300. c.region = region
  83301. c.resource = resource
  83302. return c
  83303. }
  83304. // Fields allows partial responses to be retrieved. See
  83305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83306. // for more information.
  83307. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  83308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83309. return c
  83310. }
  83311. // IfNoneMatch sets the optional parameter which makes the operation
  83312. // fail if the object's ETag matches the given value. This is useful for
  83313. // getting updates only after the object has changed since the last
  83314. // request. Use googleapi.IsNotModified to check whether the response
  83315. // error from Do is the result of In-None-Match.
  83316. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  83317. c.ifNoneMatch_ = entityTag
  83318. return c
  83319. }
  83320. // Context sets the context to be used in this call's Do method. Any
  83321. // pending HTTP request will be aborted if the provided context is
  83322. // canceled.
  83323. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  83324. c.ctx_ = ctx
  83325. return c
  83326. }
  83327. // Header returns an http.Header that can be modified by the caller to
  83328. // add HTTP headers to the request.
  83329. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  83330. if c.header_ == nil {
  83331. c.header_ = make(http.Header)
  83332. }
  83333. return c.header_
  83334. }
  83335. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  83336. reqHeaders := make(http.Header)
  83337. for k, v := range c.header_ {
  83338. reqHeaders[k] = v
  83339. }
  83340. reqHeaders.Set("User-Agent", c.s.userAgent())
  83341. if c.ifNoneMatch_ != "" {
  83342. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83343. }
  83344. var body io.Reader = nil
  83345. c.urlParams_.Set("alt", alt)
  83346. c.urlParams_.Set("prettyPrint", "false")
  83347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  83348. urls += "?" + c.urlParams_.Encode()
  83349. req, err := http.NewRequest("GET", urls, body)
  83350. if err != nil {
  83351. return nil, err
  83352. }
  83353. req.Header = reqHeaders
  83354. googleapi.Expand(req.URL, map[string]string{
  83355. "project": c.project,
  83356. "region": c.region,
  83357. "resource": c.resource,
  83358. })
  83359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83360. }
  83361. // Do executes the "compute.subnetworks.getIamPolicy" call.
  83362. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  83363. // code is an error. Response headers are in either
  83364. // *Policy.ServerResponse.Header or (if a response was returned at all)
  83365. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  83366. // check whether the returned error was because http.StatusNotModified
  83367. // was returned.
  83368. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  83369. gensupport.SetOptions(c.urlParams_, opts...)
  83370. res, err := c.doRequest("json")
  83371. if res != nil && res.StatusCode == http.StatusNotModified {
  83372. if res.Body != nil {
  83373. res.Body.Close()
  83374. }
  83375. return nil, &googleapi.Error{
  83376. Code: res.StatusCode,
  83377. Header: res.Header,
  83378. }
  83379. }
  83380. if err != nil {
  83381. return nil, err
  83382. }
  83383. defer googleapi.CloseBody(res)
  83384. if err := googleapi.CheckResponse(res); err != nil {
  83385. return nil, err
  83386. }
  83387. ret := &Policy{
  83388. ServerResponse: googleapi.ServerResponse{
  83389. Header: res.Header,
  83390. HTTPStatusCode: res.StatusCode,
  83391. },
  83392. }
  83393. target := &ret
  83394. if err := gensupport.DecodeResponse(target, res); err != nil {
  83395. return nil, err
  83396. }
  83397. return ret, nil
  83398. // {
  83399. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  83400. // "httpMethod": "GET",
  83401. // "id": "compute.subnetworks.getIamPolicy",
  83402. // "parameterOrder": [
  83403. // "project",
  83404. // "region",
  83405. // "resource"
  83406. // ],
  83407. // "parameters": {
  83408. // "project": {
  83409. // "description": "Project ID for this request.",
  83410. // "location": "path",
  83411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83412. // "required": true,
  83413. // "type": "string"
  83414. // },
  83415. // "region": {
  83416. // "description": "The name of the region for this request.",
  83417. // "location": "path",
  83418. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83419. // "required": true,
  83420. // "type": "string"
  83421. // },
  83422. // "resource": {
  83423. // "description": "Name or id of the resource for this request.",
  83424. // "location": "path",
  83425. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83426. // "required": true,
  83427. // "type": "string"
  83428. // }
  83429. // },
  83430. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  83431. // "response": {
  83432. // "$ref": "Policy"
  83433. // },
  83434. // "scopes": [
  83435. // "https://www.googleapis.com/auth/cloud-platform",
  83436. // "https://www.googleapis.com/auth/compute",
  83437. // "https://www.googleapis.com/auth/compute.readonly"
  83438. // ]
  83439. // }
  83440. }
  83441. // method id "compute.subnetworks.insert":
  83442. type SubnetworksInsertCall struct {
  83443. s *Service
  83444. project string
  83445. region string
  83446. subnetwork *Subnetwork
  83447. urlParams_ gensupport.URLParams
  83448. ctx_ context.Context
  83449. header_ http.Header
  83450. }
  83451. // Insert: Creates a subnetwork in the specified project using the data
  83452. // included in the request.
  83453. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  83454. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83455. c.project = project
  83456. c.region = region
  83457. c.subnetwork = subnetwork
  83458. return c
  83459. }
  83460. // RequestId sets the optional parameter "requestId": An optional
  83461. // request ID to identify requests. Specify a unique request ID so that
  83462. // if you must retry your request, the server will know to ignore the
  83463. // request if it has already been completed.
  83464. //
  83465. // For example, consider a situation where you make an initial request
  83466. // and the request times out. If you make the request again with the
  83467. // same request ID, the server can check if original operation with the
  83468. // same request ID was received, and if so, will ignore the second
  83469. // request. This prevents clients from accidentally creating duplicate
  83470. // commitments.
  83471. //
  83472. // The request ID must be a valid UUID with the exception that zero UUID
  83473. // is not supported (00000000-0000-0000-0000-000000000000).
  83474. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  83475. c.urlParams_.Set("requestId", requestId)
  83476. return c
  83477. }
  83478. // Fields allows partial responses to be retrieved. See
  83479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83480. // for more information.
  83481. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  83482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83483. return c
  83484. }
  83485. // Context sets the context to be used in this call's Do method. Any
  83486. // pending HTTP request will be aborted if the provided context is
  83487. // canceled.
  83488. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  83489. c.ctx_ = ctx
  83490. return c
  83491. }
  83492. // Header returns an http.Header that can be modified by the caller to
  83493. // add HTTP headers to the request.
  83494. func (c *SubnetworksInsertCall) Header() http.Header {
  83495. if c.header_ == nil {
  83496. c.header_ = make(http.Header)
  83497. }
  83498. return c.header_
  83499. }
  83500. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  83501. reqHeaders := make(http.Header)
  83502. for k, v := range c.header_ {
  83503. reqHeaders[k] = v
  83504. }
  83505. reqHeaders.Set("User-Agent", c.s.userAgent())
  83506. var body io.Reader = nil
  83507. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  83508. if err != nil {
  83509. return nil, err
  83510. }
  83511. reqHeaders.Set("Content-Type", "application/json")
  83512. c.urlParams_.Set("alt", alt)
  83513. c.urlParams_.Set("prettyPrint", "false")
  83514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  83515. urls += "?" + c.urlParams_.Encode()
  83516. req, err := http.NewRequest("POST", urls, body)
  83517. if err != nil {
  83518. return nil, err
  83519. }
  83520. req.Header = reqHeaders
  83521. googleapi.Expand(req.URL, map[string]string{
  83522. "project": c.project,
  83523. "region": c.region,
  83524. })
  83525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83526. }
  83527. // Do executes the "compute.subnetworks.insert" call.
  83528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83529. // status code is an error. Response headers are in either
  83530. // *Operation.ServerResponse.Header or (if a response was returned at
  83531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83532. // to check whether the returned error was because
  83533. // http.StatusNotModified was returned.
  83534. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83535. gensupport.SetOptions(c.urlParams_, opts...)
  83536. res, err := c.doRequest("json")
  83537. if res != nil && res.StatusCode == http.StatusNotModified {
  83538. if res.Body != nil {
  83539. res.Body.Close()
  83540. }
  83541. return nil, &googleapi.Error{
  83542. Code: res.StatusCode,
  83543. Header: res.Header,
  83544. }
  83545. }
  83546. if err != nil {
  83547. return nil, err
  83548. }
  83549. defer googleapi.CloseBody(res)
  83550. if err := googleapi.CheckResponse(res); err != nil {
  83551. return nil, err
  83552. }
  83553. ret := &Operation{
  83554. ServerResponse: googleapi.ServerResponse{
  83555. Header: res.Header,
  83556. HTTPStatusCode: res.StatusCode,
  83557. },
  83558. }
  83559. target := &ret
  83560. if err := gensupport.DecodeResponse(target, res); err != nil {
  83561. return nil, err
  83562. }
  83563. return ret, nil
  83564. // {
  83565. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  83566. // "httpMethod": "POST",
  83567. // "id": "compute.subnetworks.insert",
  83568. // "parameterOrder": [
  83569. // "project",
  83570. // "region"
  83571. // ],
  83572. // "parameters": {
  83573. // "project": {
  83574. // "description": "Project ID for this request.",
  83575. // "location": "path",
  83576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83577. // "required": true,
  83578. // "type": "string"
  83579. // },
  83580. // "region": {
  83581. // "description": "Name of the region scoping this request.",
  83582. // "location": "path",
  83583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83584. // "required": true,
  83585. // "type": "string"
  83586. // },
  83587. // "requestId": {
  83588. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83589. // "location": "query",
  83590. // "type": "string"
  83591. // }
  83592. // },
  83593. // "path": "{project}/regions/{region}/subnetworks",
  83594. // "request": {
  83595. // "$ref": "Subnetwork"
  83596. // },
  83597. // "response": {
  83598. // "$ref": "Operation"
  83599. // },
  83600. // "scopes": [
  83601. // "https://www.googleapis.com/auth/cloud-platform",
  83602. // "https://www.googleapis.com/auth/compute"
  83603. // ]
  83604. // }
  83605. }
  83606. // method id "compute.subnetworks.list":
  83607. type SubnetworksListCall struct {
  83608. s *Service
  83609. project string
  83610. region string
  83611. urlParams_ gensupport.URLParams
  83612. ifNoneMatch_ string
  83613. ctx_ context.Context
  83614. header_ http.Header
  83615. }
  83616. // List: Retrieves a list of subnetworks available to the specified
  83617. // project.
  83618. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  83619. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83620. c.project = project
  83621. c.region = region
  83622. return c
  83623. }
  83624. // Filter sets the optional parameter "filter": A filter expression that
  83625. // filters resources listed in the response. The expression must specify
  83626. // the field name, a comparison operator, and the value that you want to
  83627. // use for filtering. The value must be a string, a number, or a
  83628. // boolean. The comparison operator must be either =, !=, >, or <.
  83629. //
  83630. // For example, if you are filtering Compute Engine instances, you can
  83631. // exclude instances named example-instance by specifying name !=
  83632. // example-instance.
  83633. //
  83634. // You can also filter nested fields. For example, you could specify
  83635. // scheduling.automaticRestart = false to include instances only if they
  83636. // are not scheduled for automatic restarts. You can use filtering on
  83637. // nested fields to filter based on resource labels.
  83638. //
  83639. // To filter on multiple expressions, provide each separate expression
  83640. // within parentheses. For example, (scheduling.automaticRestart = true)
  83641. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83642. // AND expression. However, you can include AND and OR expressions
  83643. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83644. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83645. // true).
  83646. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  83647. c.urlParams_.Set("filter", filter)
  83648. return c
  83649. }
  83650. // MaxResults sets the optional parameter "maxResults": The maximum
  83651. // number of results per page that should be returned. If the number of
  83652. // available results is larger than maxResults, Compute Engine returns a
  83653. // nextPageToken that can be used to get the next page of results in
  83654. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83655. // (Default: 500)
  83656. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  83657. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83658. return c
  83659. }
  83660. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83661. // a certain order. By default, results are returned in alphanumerical
  83662. // order based on the resource name.
  83663. //
  83664. // You can also sort results in descending order based on the creation
  83665. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83666. // based on the creationTimestamp field in reverse chronological order
  83667. // (newest result first). Use this to sort resources like operations so
  83668. // that the newest operation is returned first.
  83669. //
  83670. // Currently, only sorting by name or creationTimestamp desc is
  83671. // supported.
  83672. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  83673. c.urlParams_.Set("orderBy", orderBy)
  83674. return c
  83675. }
  83676. // PageToken sets the optional parameter "pageToken": Specifies a page
  83677. // token to use. Set pageToken to the nextPageToken returned by a
  83678. // previous list request to get the next page of results.
  83679. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  83680. c.urlParams_.Set("pageToken", pageToken)
  83681. return c
  83682. }
  83683. // Fields allows partial responses to be retrieved. See
  83684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83685. // for more information.
  83686. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  83687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83688. return c
  83689. }
  83690. // IfNoneMatch sets the optional parameter which makes the operation
  83691. // fail if the object's ETag matches the given value. This is useful for
  83692. // getting updates only after the object has changed since the last
  83693. // request. Use googleapi.IsNotModified to check whether the response
  83694. // error from Do is the result of In-None-Match.
  83695. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  83696. c.ifNoneMatch_ = entityTag
  83697. return c
  83698. }
  83699. // Context sets the context to be used in this call's Do method. Any
  83700. // pending HTTP request will be aborted if the provided context is
  83701. // canceled.
  83702. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  83703. c.ctx_ = ctx
  83704. return c
  83705. }
  83706. // Header returns an http.Header that can be modified by the caller to
  83707. // add HTTP headers to the request.
  83708. func (c *SubnetworksListCall) Header() http.Header {
  83709. if c.header_ == nil {
  83710. c.header_ = make(http.Header)
  83711. }
  83712. return c.header_
  83713. }
  83714. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  83715. reqHeaders := make(http.Header)
  83716. for k, v := range c.header_ {
  83717. reqHeaders[k] = v
  83718. }
  83719. reqHeaders.Set("User-Agent", c.s.userAgent())
  83720. if c.ifNoneMatch_ != "" {
  83721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83722. }
  83723. var body io.Reader = nil
  83724. c.urlParams_.Set("alt", alt)
  83725. c.urlParams_.Set("prettyPrint", "false")
  83726. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  83727. urls += "?" + c.urlParams_.Encode()
  83728. req, err := http.NewRequest("GET", urls, body)
  83729. if err != nil {
  83730. return nil, err
  83731. }
  83732. req.Header = reqHeaders
  83733. googleapi.Expand(req.URL, map[string]string{
  83734. "project": c.project,
  83735. "region": c.region,
  83736. })
  83737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83738. }
  83739. // Do executes the "compute.subnetworks.list" call.
  83740. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  83741. // status code is an error. Response headers are in either
  83742. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  83743. // at all) in error.(*googleapi.Error).Header. Use
  83744. // googleapi.IsNotModified to check whether the returned error was
  83745. // because http.StatusNotModified was returned.
  83746. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  83747. gensupport.SetOptions(c.urlParams_, opts...)
  83748. res, err := c.doRequest("json")
  83749. if res != nil && res.StatusCode == http.StatusNotModified {
  83750. if res.Body != nil {
  83751. res.Body.Close()
  83752. }
  83753. return nil, &googleapi.Error{
  83754. Code: res.StatusCode,
  83755. Header: res.Header,
  83756. }
  83757. }
  83758. if err != nil {
  83759. return nil, err
  83760. }
  83761. defer googleapi.CloseBody(res)
  83762. if err := googleapi.CheckResponse(res); err != nil {
  83763. return nil, err
  83764. }
  83765. ret := &SubnetworkList{
  83766. ServerResponse: googleapi.ServerResponse{
  83767. Header: res.Header,
  83768. HTTPStatusCode: res.StatusCode,
  83769. },
  83770. }
  83771. target := &ret
  83772. if err := gensupport.DecodeResponse(target, res); err != nil {
  83773. return nil, err
  83774. }
  83775. return ret, nil
  83776. // {
  83777. // "description": "Retrieves a list of subnetworks available to the specified project.",
  83778. // "httpMethod": "GET",
  83779. // "id": "compute.subnetworks.list",
  83780. // "parameterOrder": [
  83781. // "project",
  83782. // "region"
  83783. // ],
  83784. // "parameters": {
  83785. // "filter": {
  83786. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83787. // "location": "query",
  83788. // "type": "string"
  83789. // },
  83790. // "maxResults": {
  83791. // "default": "500",
  83792. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83793. // "format": "uint32",
  83794. // "location": "query",
  83795. // "minimum": "0",
  83796. // "type": "integer"
  83797. // },
  83798. // "orderBy": {
  83799. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83800. // "location": "query",
  83801. // "type": "string"
  83802. // },
  83803. // "pageToken": {
  83804. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83805. // "location": "query",
  83806. // "type": "string"
  83807. // },
  83808. // "project": {
  83809. // "description": "Project ID for this request.",
  83810. // "location": "path",
  83811. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83812. // "required": true,
  83813. // "type": "string"
  83814. // },
  83815. // "region": {
  83816. // "description": "Name of the region scoping this request.",
  83817. // "location": "path",
  83818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83819. // "required": true,
  83820. // "type": "string"
  83821. // }
  83822. // },
  83823. // "path": "{project}/regions/{region}/subnetworks",
  83824. // "response": {
  83825. // "$ref": "SubnetworkList"
  83826. // },
  83827. // "scopes": [
  83828. // "https://www.googleapis.com/auth/cloud-platform",
  83829. // "https://www.googleapis.com/auth/compute",
  83830. // "https://www.googleapis.com/auth/compute.readonly"
  83831. // ]
  83832. // }
  83833. }
  83834. // Pages invokes f for each page of results.
  83835. // A non-nil error returned from f will halt the iteration.
  83836. // The provided context supersedes any context provided to the Context method.
  83837. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  83838. c.ctx_ = ctx
  83839. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83840. for {
  83841. x, err := c.Do()
  83842. if err != nil {
  83843. return err
  83844. }
  83845. if err := f(x); err != nil {
  83846. return err
  83847. }
  83848. if x.NextPageToken == "" {
  83849. return nil
  83850. }
  83851. c.PageToken(x.NextPageToken)
  83852. }
  83853. }
  83854. // method id "compute.subnetworks.listUsable":
  83855. type SubnetworksListUsableCall struct {
  83856. s *Service
  83857. project string
  83858. urlParams_ gensupport.URLParams
  83859. ifNoneMatch_ string
  83860. ctx_ context.Context
  83861. header_ http.Header
  83862. }
  83863. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  83864. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  83865. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83866. c.project = project
  83867. return c
  83868. }
  83869. // Filter sets the optional parameter "filter": A filter expression that
  83870. // filters resources listed in the response. The expression must specify
  83871. // the field name, a comparison operator, and the value that you want to
  83872. // use for filtering. The value must be a string, a number, or a
  83873. // boolean. The comparison operator must be either =, !=, >, or <.
  83874. //
  83875. // For example, if you are filtering Compute Engine instances, you can
  83876. // exclude instances named example-instance by specifying name !=
  83877. // example-instance.
  83878. //
  83879. // You can also filter nested fields. For example, you could specify
  83880. // scheduling.automaticRestart = false to include instances only if they
  83881. // are not scheduled for automatic restarts. You can use filtering on
  83882. // nested fields to filter based on resource labels.
  83883. //
  83884. // To filter on multiple expressions, provide each separate expression
  83885. // within parentheses. For example, (scheduling.automaticRestart = true)
  83886. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83887. // AND expression. However, you can include AND and OR expressions
  83888. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83889. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83890. // true).
  83891. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  83892. c.urlParams_.Set("filter", filter)
  83893. return c
  83894. }
  83895. // MaxResults sets the optional parameter "maxResults": The maximum
  83896. // number of results per page that should be returned. If the number of
  83897. // available results is larger than maxResults, Compute Engine returns a
  83898. // nextPageToken that can be used to get the next page of results in
  83899. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83900. // (Default: 500)
  83901. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  83902. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83903. return c
  83904. }
  83905. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83906. // a certain order. By default, results are returned in alphanumerical
  83907. // order based on the resource name.
  83908. //
  83909. // You can also sort results in descending order based on the creation
  83910. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83911. // based on the creationTimestamp field in reverse chronological order
  83912. // (newest result first). Use this to sort resources like operations so
  83913. // that the newest operation is returned first.
  83914. //
  83915. // Currently, only sorting by name or creationTimestamp desc is
  83916. // supported.
  83917. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  83918. c.urlParams_.Set("orderBy", orderBy)
  83919. return c
  83920. }
  83921. // PageToken sets the optional parameter "pageToken": Specifies a page
  83922. // token to use. Set pageToken to the nextPageToken returned by a
  83923. // previous list request to get the next page of results.
  83924. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  83925. c.urlParams_.Set("pageToken", pageToken)
  83926. return c
  83927. }
  83928. // Fields allows partial responses to be retrieved. See
  83929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83930. // for more information.
  83931. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  83932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83933. return c
  83934. }
  83935. // IfNoneMatch sets the optional parameter which makes the operation
  83936. // fail if the object's ETag matches the given value. This is useful for
  83937. // getting updates only after the object has changed since the last
  83938. // request. Use googleapi.IsNotModified to check whether the response
  83939. // error from Do is the result of In-None-Match.
  83940. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  83941. c.ifNoneMatch_ = entityTag
  83942. return c
  83943. }
  83944. // Context sets the context to be used in this call's Do method. Any
  83945. // pending HTTP request will be aborted if the provided context is
  83946. // canceled.
  83947. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  83948. c.ctx_ = ctx
  83949. return c
  83950. }
  83951. // Header returns an http.Header that can be modified by the caller to
  83952. // add HTTP headers to the request.
  83953. func (c *SubnetworksListUsableCall) Header() http.Header {
  83954. if c.header_ == nil {
  83955. c.header_ = make(http.Header)
  83956. }
  83957. return c.header_
  83958. }
  83959. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  83960. reqHeaders := make(http.Header)
  83961. for k, v := range c.header_ {
  83962. reqHeaders[k] = v
  83963. }
  83964. reqHeaders.Set("User-Agent", c.s.userAgent())
  83965. if c.ifNoneMatch_ != "" {
  83966. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83967. }
  83968. var body io.Reader = nil
  83969. c.urlParams_.Set("alt", alt)
  83970. c.urlParams_.Set("prettyPrint", "false")
  83971. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  83972. urls += "?" + c.urlParams_.Encode()
  83973. req, err := http.NewRequest("GET", urls, body)
  83974. if err != nil {
  83975. return nil, err
  83976. }
  83977. req.Header = reqHeaders
  83978. googleapi.Expand(req.URL, map[string]string{
  83979. "project": c.project,
  83980. })
  83981. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83982. }
  83983. // Do executes the "compute.subnetworks.listUsable" call.
  83984. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  83985. // non-nil. Any non-2xx status code is an error. Response headers are in
  83986. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  83987. // a response was returned at all) in error.(*googleapi.Error).Header.
  83988. // Use googleapi.IsNotModified to check whether the returned error was
  83989. // because http.StatusNotModified was returned.
  83990. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  83991. gensupport.SetOptions(c.urlParams_, opts...)
  83992. res, err := c.doRequest("json")
  83993. if res != nil && res.StatusCode == http.StatusNotModified {
  83994. if res.Body != nil {
  83995. res.Body.Close()
  83996. }
  83997. return nil, &googleapi.Error{
  83998. Code: res.StatusCode,
  83999. Header: res.Header,
  84000. }
  84001. }
  84002. if err != nil {
  84003. return nil, err
  84004. }
  84005. defer googleapi.CloseBody(res)
  84006. if err := googleapi.CheckResponse(res); err != nil {
  84007. return nil, err
  84008. }
  84009. ret := &UsableSubnetworksAggregatedList{
  84010. ServerResponse: googleapi.ServerResponse{
  84011. Header: res.Header,
  84012. HTTPStatusCode: res.StatusCode,
  84013. },
  84014. }
  84015. target := &ret
  84016. if err := gensupport.DecodeResponse(target, res); err != nil {
  84017. return nil, err
  84018. }
  84019. return ret, nil
  84020. // {
  84021. // "description": "Retrieves an aggregated list of usable subnetworks.",
  84022. // "httpMethod": "GET",
  84023. // "id": "compute.subnetworks.listUsable",
  84024. // "parameterOrder": [
  84025. // "project"
  84026. // ],
  84027. // "parameters": {
  84028. // "filter": {
  84029. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84030. // "location": "query",
  84031. // "type": "string"
  84032. // },
  84033. // "maxResults": {
  84034. // "default": "500",
  84035. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84036. // "format": "uint32",
  84037. // "location": "query",
  84038. // "minimum": "0",
  84039. // "type": "integer"
  84040. // },
  84041. // "orderBy": {
  84042. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84043. // "location": "query",
  84044. // "type": "string"
  84045. // },
  84046. // "pageToken": {
  84047. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84048. // "location": "query",
  84049. // "type": "string"
  84050. // },
  84051. // "project": {
  84052. // "description": "Project ID for this request.",
  84053. // "location": "path",
  84054. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84055. // "required": true,
  84056. // "type": "string"
  84057. // }
  84058. // },
  84059. // "path": "{project}/aggregated/subnetworks/listUsable",
  84060. // "response": {
  84061. // "$ref": "UsableSubnetworksAggregatedList"
  84062. // },
  84063. // "scopes": [
  84064. // "https://www.googleapis.com/auth/cloud-platform",
  84065. // "https://www.googleapis.com/auth/compute",
  84066. // "https://www.googleapis.com/auth/compute.readonly"
  84067. // ]
  84068. // }
  84069. }
  84070. // Pages invokes f for each page of results.
  84071. // A non-nil error returned from f will halt the iteration.
  84072. // The provided context supersedes any context provided to the Context method.
  84073. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  84074. c.ctx_ = ctx
  84075. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84076. for {
  84077. x, err := c.Do()
  84078. if err != nil {
  84079. return err
  84080. }
  84081. if err := f(x); err != nil {
  84082. return err
  84083. }
  84084. if x.NextPageToken == "" {
  84085. return nil
  84086. }
  84087. c.PageToken(x.NextPageToken)
  84088. }
  84089. }
  84090. // method id "compute.subnetworks.patch":
  84091. type SubnetworksPatchCall struct {
  84092. s *Service
  84093. project string
  84094. region string
  84095. subnetwork string
  84096. subnetwork2 *Subnetwork
  84097. urlParams_ gensupport.URLParams
  84098. ctx_ context.Context
  84099. header_ http.Header
  84100. }
  84101. // Patch: Patches the specified subnetwork with the data included in the
  84102. // request. Only certain fields can up updated with a patch request as
  84103. // indicated in the field descriptions. You must specify the current
  84104. // fingeprint of the subnetwork resource being patched.
  84105. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  84106. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84107. c.project = project
  84108. c.region = region
  84109. c.subnetwork = subnetwork
  84110. c.subnetwork2 = subnetwork2
  84111. return c
  84112. }
  84113. // RequestId sets the optional parameter "requestId": An optional
  84114. // request ID to identify requests. Specify a unique request ID so that
  84115. // if you must retry your request, the server will know to ignore the
  84116. // request if it has already been completed.
  84117. //
  84118. // For example, consider a situation where you make an initial request
  84119. // and the request times out. If you make the request again with the
  84120. // same request ID, the server can check if original operation with the
  84121. // same request ID was received, and if so, will ignore the second
  84122. // request. This prevents clients from accidentally creating duplicate
  84123. // commitments.
  84124. //
  84125. // The request ID must be a valid UUID with the exception that zero UUID
  84126. // is not supported (00000000-0000-0000-0000-000000000000).
  84127. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  84128. c.urlParams_.Set("requestId", requestId)
  84129. return c
  84130. }
  84131. // Fields allows partial responses to be retrieved. See
  84132. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84133. // for more information.
  84134. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  84135. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84136. return c
  84137. }
  84138. // Context sets the context to be used in this call's Do method. Any
  84139. // pending HTTP request will be aborted if the provided context is
  84140. // canceled.
  84141. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  84142. c.ctx_ = ctx
  84143. return c
  84144. }
  84145. // Header returns an http.Header that can be modified by the caller to
  84146. // add HTTP headers to the request.
  84147. func (c *SubnetworksPatchCall) Header() http.Header {
  84148. if c.header_ == nil {
  84149. c.header_ = make(http.Header)
  84150. }
  84151. return c.header_
  84152. }
  84153. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  84154. reqHeaders := make(http.Header)
  84155. for k, v := range c.header_ {
  84156. reqHeaders[k] = v
  84157. }
  84158. reqHeaders.Set("User-Agent", c.s.userAgent())
  84159. var body io.Reader = nil
  84160. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  84161. if err != nil {
  84162. return nil, err
  84163. }
  84164. reqHeaders.Set("Content-Type", "application/json")
  84165. c.urlParams_.Set("alt", alt)
  84166. c.urlParams_.Set("prettyPrint", "false")
  84167. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  84168. urls += "?" + c.urlParams_.Encode()
  84169. req, err := http.NewRequest("PATCH", urls, body)
  84170. if err != nil {
  84171. return nil, err
  84172. }
  84173. req.Header = reqHeaders
  84174. googleapi.Expand(req.URL, map[string]string{
  84175. "project": c.project,
  84176. "region": c.region,
  84177. "subnetwork": c.subnetwork,
  84178. })
  84179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84180. }
  84181. // Do executes the "compute.subnetworks.patch" call.
  84182. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84183. // status code is an error. Response headers are in either
  84184. // *Operation.ServerResponse.Header or (if a response was returned at
  84185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84186. // to check whether the returned error was because
  84187. // http.StatusNotModified was returned.
  84188. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84189. gensupport.SetOptions(c.urlParams_, opts...)
  84190. res, err := c.doRequest("json")
  84191. if res != nil && res.StatusCode == http.StatusNotModified {
  84192. if res.Body != nil {
  84193. res.Body.Close()
  84194. }
  84195. return nil, &googleapi.Error{
  84196. Code: res.StatusCode,
  84197. Header: res.Header,
  84198. }
  84199. }
  84200. if err != nil {
  84201. return nil, err
  84202. }
  84203. defer googleapi.CloseBody(res)
  84204. if err := googleapi.CheckResponse(res); err != nil {
  84205. return nil, err
  84206. }
  84207. ret := &Operation{
  84208. ServerResponse: googleapi.ServerResponse{
  84209. Header: res.Header,
  84210. HTTPStatusCode: res.StatusCode,
  84211. },
  84212. }
  84213. target := &ret
  84214. if err := gensupport.DecodeResponse(target, res); err != nil {
  84215. return nil, err
  84216. }
  84217. return ret, nil
  84218. // {
  84219. // "description": "Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingeprint of the subnetwork resource being patched.",
  84220. // "httpMethod": "PATCH",
  84221. // "id": "compute.subnetworks.patch",
  84222. // "parameterOrder": [
  84223. // "project",
  84224. // "region",
  84225. // "subnetwork"
  84226. // ],
  84227. // "parameters": {
  84228. // "project": {
  84229. // "description": "Project ID for this request.",
  84230. // "location": "path",
  84231. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84232. // "required": true,
  84233. // "type": "string"
  84234. // },
  84235. // "region": {
  84236. // "description": "Name of the region scoping this request.",
  84237. // "location": "path",
  84238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84239. // "required": true,
  84240. // "type": "string"
  84241. // },
  84242. // "requestId": {
  84243. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84244. // "location": "query",
  84245. // "type": "string"
  84246. // },
  84247. // "subnetwork": {
  84248. // "description": "Name of the Subnetwork resource to patch.",
  84249. // "location": "path",
  84250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84251. // "required": true,
  84252. // "type": "string"
  84253. // }
  84254. // },
  84255. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  84256. // "request": {
  84257. // "$ref": "Subnetwork"
  84258. // },
  84259. // "response": {
  84260. // "$ref": "Operation"
  84261. // },
  84262. // "scopes": [
  84263. // "https://www.googleapis.com/auth/cloud-platform",
  84264. // "https://www.googleapis.com/auth/compute"
  84265. // ]
  84266. // }
  84267. }
  84268. // method id "compute.subnetworks.setIamPolicy":
  84269. type SubnetworksSetIamPolicyCall struct {
  84270. s *Service
  84271. project string
  84272. region string
  84273. resource string
  84274. regionsetpolicyrequest *RegionSetPolicyRequest
  84275. urlParams_ gensupport.URLParams
  84276. ctx_ context.Context
  84277. header_ http.Header
  84278. }
  84279. // SetIamPolicy: Sets the access control policy on the specified
  84280. // resource. Replaces any existing policy.
  84281. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  84282. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84283. c.project = project
  84284. c.region = region
  84285. c.resource = resource
  84286. c.regionsetpolicyrequest = regionsetpolicyrequest
  84287. return c
  84288. }
  84289. // Fields allows partial responses to be retrieved. See
  84290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84291. // for more information.
  84292. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  84293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84294. return c
  84295. }
  84296. // Context sets the context to be used in this call's Do method. Any
  84297. // pending HTTP request will be aborted if the provided context is
  84298. // canceled.
  84299. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  84300. c.ctx_ = ctx
  84301. return c
  84302. }
  84303. // Header returns an http.Header that can be modified by the caller to
  84304. // add HTTP headers to the request.
  84305. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  84306. if c.header_ == nil {
  84307. c.header_ = make(http.Header)
  84308. }
  84309. return c.header_
  84310. }
  84311. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  84312. reqHeaders := make(http.Header)
  84313. for k, v := range c.header_ {
  84314. reqHeaders[k] = v
  84315. }
  84316. reqHeaders.Set("User-Agent", c.s.userAgent())
  84317. var body io.Reader = nil
  84318. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  84319. if err != nil {
  84320. return nil, err
  84321. }
  84322. reqHeaders.Set("Content-Type", "application/json")
  84323. c.urlParams_.Set("alt", alt)
  84324. c.urlParams_.Set("prettyPrint", "false")
  84325. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  84326. urls += "?" + c.urlParams_.Encode()
  84327. req, err := http.NewRequest("POST", urls, body)
  84328. if err != nil {
  84329. return nil, err
  84330. }
  84331. req.Header = reqHeaders
  84332. googleapi.Expand(req.URL, map[string]string{
  84333. "project": c.project,
  84334. "region": c.region,
  84335. "resource": c.resource,
  84336. })
  84337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84338. }
  84339. // Do executes the "compute.subnetworks.setIamPolicy" call.
  84340. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  84341. // code is an error. Response headers are in either
  84342. // *Policy.ServerResponse.Header or (if a response was returned at all)
  84343. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  84344. // check whether the returned error was because http.StatusNotModified
  84345. // was returned.
  84346. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  84347. gensupport.SetOptions(c.urlParams_, opts...)
  84348. res, err := c.doRequest("json")
  84349. if res != nil && res.StatusCode == http.StatusNotModified {
  84350. if res.Body != nil {
  84351. res.Body.Close()
  84352. }
  84353. return nil, &googleapi.Error{
  84354. Code: res.StatusCode,
  84355. Header: res.Header,
  84356. }
  84357. }
  84358. if err != nil {
  84359. return nil, err
  84360. }
  84361. defer googleapi.CloseBody(res)
  84362. if err := googleapi.CheckResponse(res); err != nil {
  84363. return nil, err
  84364. }
  84365. ret := &Policy{
  84366. ServerResponse: googleapi.ServerResponse{
  84367. Header: res.Header,
  84368. HTTPStatusCode: res.StatusCode,
  84369. },
  84370. }
  84371. target := &ret
  84372. if err := gensupport.DecodeResponse(target, res); err != nil {
  84373. return nil, err
  84374. }
  84375. return ret, nil
  84376. // {
  84377. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  84378. // "httpMethod": "POST",
  84379. // "id": "compute.subnetworks.setIamPolicy",
  84380. // "parameterOrder": [
  84381. // "project",
  84382. // "region",
  84383. // "resource"
  84384. // ],
  84385. // "parameters": {
  84386. // "project": {
  84387. // "description": "Project ID for this request.",
  84388. // "location": "path",
  84389. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84390. // "required": true,
  84391. // "type": "string"
  84392. // },
  84393. // "region": {
  84394. // "description": "The name of the region for this request.",
  84395. // "location": "path",
  84396. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84397. // "required": true,
  84398. // "type": "string"
  84399. // },
  84400. // "resource": {
  84401. // "description": "Name or id of the resource for this request.",
  84402. // "location": "path",
  84403. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84404. // "required": true,
  84405. // "type": "string"
  84406. // }
  84407. // },
  84408. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  84409. // "request": {
  84410. // "$ref": "RegionSetPolicyRequest"
  84411. // },
  84412. // "response": {
  84413. // "$ref": "Policy"
  84414. // },
  84415. // "scopes": [
  84416. // "https://www.googleapis.com/auth/cloud-platform",
  84417. // "https://www.googleapis.com/auth/compute"
  84418. // ]
  84419. // }
  84420. }
  84421. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  84422. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  84423. s *Service
  84424. project string
  84425. region string
  84426. subnetwork string
  84427. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  84428. urlParams_ gensupport.URLParams
  84429. ctx_ context.Context
  84430. header_ http.Header
  84431. }
  84432. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  84433. // Google services without assigning external IP addresses through
  84434. // Private Google Access.
  84435. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  84436. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84437. c.project = project
  84438. c.region = region
  84439. c.subnetwork = subnetwork
  84440. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  84441. return c
  84442. }
  84443. // RequestId sets the optional parameter "requestId": An optional
  84444. // request ID to identify requests. Specify a unique request ID so that
  84445. // if you must retry your request, the server will know to ignore the
  84446. // request if it has already been completed.
  84447. //
  84448. // For example, consider a situation where you make an initial request
  84449. // and the request times out. If you make the request again with the
  84450. // same request ID, the server can check if original operation with the
  84451. // same request ID was received, and if so, will ignore the second
  84452. // request. This prevents clients from accidentally creating duplicate
  84453. // commitments.
  84454. //
  84455. // The request ID must be a valid UUID with the exception that zero UUID
  84456. // is not supported (00000000-0000-0000-0000-000000000000).
  84457. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  84458. c.urlParams_.Set("requestId", requestId)
  84459. return c
  84460. }
  84461. // Fields allows partial responses to be retrieved. See
  84462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84463. // for more information.
  84464. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  84465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84466. return c
  84467. }
  84468. // Context sets the context to be used in this call's Do method. Any
  84469. // pending HTTP request will be aborted if the provided context is
  84470. // canceled.
  84471. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  84472. c.ctx_ = ctx
  84473. return c
  84474. }
  84475. // Header returns an http.Header that can be modified by the caller to
  84476. // add HTTP headers to the request.
  84477. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  84478. if c.header_ == nil {
  84479. c.header_ = make(http.Header)
  84480. }
  84481. return c.header_
  84482. }
  84483. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  84484. reqHeaders := make(http.Header)
  84485. for k, v := range c.header_ {
  84486. reqHeaders[k] = v
  84487. }
  84488. reqHeaders.Set("User-Agent", c.s.userAgent())
  84489. var body io.Reader = nil
  84490. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  84491. if err != nil {
  84492. return nil, err
  84493. }
  84494. reqHeaders.Set("Content-Type", "application/json")
  84495. c.urlParams_.Set("alt", alt)
  84496. c.urlParams_.Set("prettyPrint", "false")
  84497. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  84498. urls += "?" + c.urlParams_.Encode()
  84499. req, err := http.NewRequest("POST", urls, body)
  84500. if err != nil {
  84501. return nil, err
  84502. }
  84503. req.Header = reqHeaders
  84504. googleapi.Expand(req.URL, map[string]string{
  84505. "project": c.project,
  84506. "region": c.region,
  84507. "subnetwork": c.subnetwork,
  84508. })
  84509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84510. }
  84511. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  84512. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84513. // status code is an error. Response headers are in either
  84514. // *Operation.ServerResponse.Header or (if a response was returned at
  84515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84516. // to check whether the returned error was because
  84517. // http.StatusNotModified was returned.
  84518. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84519. gensupport.SetOptions(c.urlParams_, opts...)
  84520. res, err := c.doRequest("json")
  84521. if res != nil && res.StatusCode == http.StatusNotModified {
  84522. if res.Body != nil {
  84523. res.Body.Close()
  84524. }
  84525. return nil, &googleapi.Error{
  84526. Code: res.StatusCode,
  84527. Header: res.Header,
  84528. }
  84529. }
  84530. if err != nil {
  84531. return nil, err
  84532. }
  84533. defer googleapi.CloseBody(res)
  84534. if err := googleapi.CheckResponse(res); err != nil {
  84535. return nil, err
  84536. }
  84537. ret := &Operation{
  84538. ServerResponse: googleapi.ServerResponse{
  84539. Header: res.Header,
  84540. HTTPStatusCode: res.StatusCode,
  84541. },
  84542. }
  84543. target := &ret
  84544. if err := gensupport.DecodeResponse(target, res); err != nil {
  84545. return nil, err
  84546. }
  84547. return ret, nil
  84548. // {
  84549. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  84550. // "httpMethod": "POST",
  84551. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  84552. // "parameterOrder": [
  84553. // "project",
  84554. // "region",
  84555. // "subnetwork"
  84556. // ],
  84557. // "parameters": {
  84558. // "project": {
  84559. // "description": "Project ID for this request.",
  84560. // "location": "path",
  84561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84562. // "required": true,
  84563. // "type": "string"
  84564. // },
  84565. // "region": {
  84566. // "description": "Name of the region scoping this request.",
  84567. // "location": "path",
  84568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84569. // "required": true,
  84570. // "type": "string"
  84571. // },
  84572. // "requestId": {
  84573. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84574. // "location": "query",
  84575. // "type": "string"
  84576. // },
  84577. // "subnetwork": {
  84578. // "description": "Name of the Subnetwork resource.",
  84579. // "location": "path",
  84580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84581. // "required": true,
  84582. // "type": "string"
  84583. // }
  84584. // },
  84585. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  84586. // "request": {
  84587. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  84588. // },
  84589. // "response": {
  84590. // "$ref": "Operation"
  84591. // },
  84592. // "scopes": [
  84593. // "https://www.googleapis.com/auth/cloud-platform",
  84594. // "https://www.googleapis.com/auth/compute"
  84595. // ]
  84596. // }
  84597. }
  84598. // method id "compute.subnetworks.testIamPermissions":
  84599. type SubnetworksTestIamPermissionsCall struct {
  84600. s *Service
  84601. project string
  84602. region string
  84603. resource string
  84604. testpermissionsrequest *TestPermissionsRequest
  84605. urlParams_ gensupport.URLParams
  84606. ctx_ context.Context
  84607. header_ http.Header
  84608. }
  84609. // TestIamPermissions: Returns permissions that a caller has on the
  84610. // specified resource.
  84611. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  84612. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84613. c.project = project
  84614. c.region = region
  84615. c.resource = resource
  84616. c.testpermissionsrequest = testpermissionsrequest
  84617. return c
  84618. }
  84619. // Fields allows partial responses to be retrieved. See
  84620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84621. // for more information.
  84622. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  84623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84624. return c
  84625. }
  84626. // Context sets the context to be used in this call's Do method. Any
  84627. // pending HTTP request will be aborted if the provided context is
  84628. // canceled.
  84629. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  84630. c.ctx_ = ctx
  84631. return c
  84632. }
  84633. // Header returns an http.Header that can be modified by the caller to
  84634. // add HTTP headers to the request.
  84635. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  84636. if c.header_ == nil {
  84637. c.header_ = make(http.Header)
  84638. }
  84639. return c.header_
  84640. }
  84641. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84642. reqHeaders := make(http.Header)
  84643. for k, v := range c.header_ {
  84644. reqHeaders[k] = v
  84645. }
  84646. reqHeaders.Set("User-Agent", c.s.userAgent())
  84647. var body io.Reader = nil
  84648. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84649. if err != nil {
  84650. return nil, err
  84651. }
  84652. reqHeaders.Set("Content-Type", "application/json")
  84653. c.urlParams_.Set("alt", alt)
  84654. c.urlParams_.Set("prettyPrint", "false")
  84655. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  84656. urls += "?" + c.urlParams_.Encode()
  84657. req, err := http.NewRequest("POST", urls, body)
  84658. if err != nil {
  84659. return nil, err
  84660. }
  84661. req.Header = reqHeaders
  84662. googleapi.Expand(req.URL, map[string]string{
  84663. "project": c.project,
  84664. "region": c.region,
  84665. "resource": c.resource,
  84666. })
  84667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84668. }
  84669. // Do executes the "compute.subnetworks.testIamPermissions" call.
  84670. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84671. // non-2xx status code is an error. Response headers are in either
  84672. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84673. // returned at all) in error.(*googleapi.Error).Header. Use
  84674. // googleapi.IsNotModified to check whether the returned error was
  84675. // because http.StatusNotModified was returned.
  84676. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84677. gensupport.SetOptions(c.urlParams_, opts...)
  84678. res, err := c.doRequest("json")
  84679. if res != nil && res.StatusCode == http.StatusNotModified {
  84680. if res.Body != nil {
  84681. res.Body.Close()
  84682. }
  84683. return nil, &googleapi.Error{
  84684. Code: res.StatusCode,
  84685. Header: res.Header,
  84686. }
  84687. }
  84688. if err != nil {
  84689. return nil, err
  84690. }
  84691. defer googleapi.CloseBody(res)
  84692. if err := googleapi.CheckResponse(res); err != nil {
  84693. return nil, err
  84694. }
  84695. ret := &TestPermissionsResponse{
  84696. ServerResponse: googleapi.ServerResponse{
  84697. Header: res.Header,
  84698. HTTPStatusCode: res.StatusCode,
  84699. },
  84700. }
  84701. target := &ret
  84702. if err := gensupport.DecodeResponse(target, res); err != nil {
  84703. return nil, err
  84704. }
  84705. return ret, nil
  84706. // {
  84707. // "description": "Returns permissions that a caller has on the specified resource.",
  84708. // "httpMethod": "POST",
  84709. // "id": "compute.subnetworks.testIamPermissions",
  84710. // "parameterOrder": [
  84711. // "project",
  84712. // "region",
  84713. // "resource"
  84714. // ],
  84715. // "parameters": {
  84716. // "project": {
  84717. // "description": "Project ID for this request.",
  84718. // "location": "path",
  84719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84720. // "required": true,
  84721. // "type": "string"
  84722. // },
  84723. // "region": {
  84724. // "description": "The name of the region for this request.",
  84725. // "location": "path",
  84726. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84727. // "required": true,
  84728. // "type": "string"
  84729. // },
  84730. // "resource": {
  84731. // "description": "Name or id of the resource for this request.",
  84732. // "location": "path",
  84733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84734. // "required": true,
  84735. // "type": "string"
  84736. // }
  84737. // },
  84738. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  84739. // "request": {
  84740. // "$ref": "TestPermissionsRequest"
  84741. // },
  84742. // "response": {
  84743. // "$ref": "TestPermissionsResponse"
  84744. // },
  84745. // "scopes": [
  84746. // "https://www.googleapis.com/auth/cloud-platform",
  84747. // "https://www.googleapis.com/auth/compute",
  84748. // "https://www.googleapis.com/auth/compute.readonly"
  84749. // ]
  84750. // }
  84751. }
  84752. // method id "compute.targetHttpProxies.delete":
  84753. type TargetHttpProxiesDeleteCall struct {
  84754. s *Service
  84755. project string
  84756. targetHttpProxy string
  84757. urlParams_ gensupport.URLParams
  84758. ctx_ context.Context
  84759. header_ http.Header
  84760. }
  84761. // Delete: Deletes the specified TargetHttpProxy resource.
  84762. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  84763. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  84764. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84765. c.project = project
  84766. c.targetHttpProxy = targetHttpProxy
  84767. return c
  84768. }
  84769. // RequestId sets the optional parameter "requestId": An optional
  84770. // request ID to identify requests. Specify a unique request ID so that
  84771. // if you must retry your request, the server will know to ignore the
  84772. // request if it has already been completed.
  84773. //
  84774. // For example, consider a situation where you make an initial request
  84775. // and the request times out. If you make the request again with the
  84776. // same request ID, the server can check if original operation with the
  84777. // same request ID was received, and if so, will ignore the second
  84778. // request. This prevents clients from accidentally creating duplicate
  84779. // commitments.
  84780. //
  84781. // The request ID must be a valid UUID with the exception that zero UUID
  84782. // is not supported (00000000-0000-0000-0000-000000000000).
  84783. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  84784. c.urlParams_.Set("requestId", requestId)
  84785. return c
  84786. }
  84787. // Fields allows partial responses to be retrieved. See
  84788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84789. // for more information.
  84790. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  84791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84792. return c
  84793. }
  84794. // Context sets the context to be used in this call's Do method. Any
  84795. // pending HTTP request will be aborted if the provided context is
  84796. // canceled.
  84797. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  84798. c.ctx_ = ctx
  84799. return c
  84800. }
  84801. // Header returns an http.Header that can be modified by the caller to
  84802. // add HTTP headers to the request.
  84803. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  84804. if c.header_ == nil {
  84805. c.header_ = make(http.Header)
  84806. }
  84807. return c.header_
  84808. }
  84809. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  84810. reqHeaders := make(http.Header)
  84811. for k, v := range c.header_ {
  84812. reqHeaders[k] = v
  84813. }
  84814. reqHeaders.Set("User-Agent", c.s.userAgent())
  84815. var body io.Reader = nil
  84816. c.urlParams_.Set("alt", alt)
  84817. c.urlParams_.Set("prettyPrint", "false")
  84818. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  84819. urls += "?" + c.urlParams_.Encode()
  84820. req, err := http.NewRequest("DELETE", urls, body)
  84821. if err != nil {
  84822. return nil, err
  84823. }
  84824. req.Header = reqHeaders
  84825. googleapi.Expand(req.URL, map[string]string{
  84826. "project": c.project,
  84827. "targetHttpProxy": c.targetHttpProxy,
  84828. })
  84829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84830. }
  84831. // Do executes the "compute.targetHttpProxies.delete" call.
  84832. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84833. // status code is an error. Response headers are in either
  84834. // *Operation.ServerResponse.Header or (if a response was returned at
  84835. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84836. // to check whether the returned error was because
  84837. // http.StatusNotModified was returned.
  84838. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84839. gensupport.SetOptions(c.urlParams_, opts...)
  84840. res, err := c.doRequest("json")
  84841. if res != nil && res.StatusCode == http.StatusNotModified {
  84842. if res.Body != nil {
  84843. res.Body.Close()
  84844. }
  84845. return nil, &googleapi.Error{
  84846. Code: res.StatusCode,
  84847. Header: res.Header,
  84848. }
  84849. }
  84850. if err != nil {
  84851. return nil, err
  84852. }
  84853. defer googleapi.CloseBody(res)
  84854. if err := googleapi.CheckResponse(res); err != nil {
  84855. return nil, err
  84856. }
  84857. ret := &Operation{
  84858. ServerResponse: googleapi.ServerResponse{
  84859. Header: res.Header,
  84860. HTTPStatusCode: res.StatusCode,
  84861. },
  84862. }
  84863. target := &ret
  84864. if err := gensupport.DecodeResponse(target, res); err != nil {
  84865. return nil, err
  84866. }
  84867. return ret, nil
  84868. // {
  84869. // "description": "Deletes the specified TargetHttpProxy resource.",
  84870. // "httpMethod": "DELETE",
  84871. // "id": "compute.targetHttpProxies.delete",
  84872. // "parameterOrder": [
  84873. // "project",
  84874. // "targetHttpProxy"
  84875. // ],
  84876. // "parameters": {
  84877. // "project": {
  84878. // "description": "Project ID for this request.",
  84879. // "location": "path",
  84880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84881. // "required": true,
  84882. // "type": "string"
  84883. // },
  84884. // "requestId": {
  84885. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84886. // "location": "query",
  84887. // "type": "string"
  84888. // },
  84889. // "targetHttpProxy": {
  84890. // "description": "Name of the TargetHttpProxy resource to delete.",
  84891. // "location": "path",
  84892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84893. // "required": true,
  84894. // "type": "string"
  84895. // }
  84896. // },
  84897. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  84898. // "response": {
  84899. // "$ref": "Operation"
  84900. // },
  84901. // "scopes": [
  84902. // "https://www.googleapis.com/auth/cloud-platform",
  84903. // "https://www.googleapis.com/auth/compute"
  84904. // ]
  84905. // }
  84906. }
  84907. // method id "compute.targetHttpProxies.get":
  84908. type TargetHttpProxiesGetCall struct {
  84909. s *Service
  84910. project string
  84911. targetHttpProxy string
  84912. urlParams_ gensupport.URLParams
  84913. ifNoneMatch_ string
  84914. ctx_ context.Context
  84915. header_ http.Header
  84916. }
  84917. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  84918. // available target HTTP proxies by making a list() request.
  84919. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  84920. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  84921. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84922. c.project = project
  84923. c.targetHttpProxy = targetHttpProxy
  84924. return c
  84925. }
  84926. // Fields allows partial responses to be retrieved. See
  84927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84928. // for more information.
  84929. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  84930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84931. return c
  84932. }
  84933. // IfNoneMatch sets the optional parameter which makes the operation
  84934. // fail if the object's ETag matches the given value. This is useful for
  84935. // getting updates only after the object has changed since the last
  84936. // request. Use googleapi.IsNotModified to check whether the response
  84937. // error from Do is the result of In-None-Match.
  84938. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  84939. c.ifNoneMatch_ = entityTag
  84940. return c
  84941. }
  84942. // Context sets the context to be used in this call's Do method. Any
  84943. // pending HTTP request will be aborted if the provided context is
  84944. // canceled.
  84945. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  84946. c.ctx_ = ctx
  84947. return c
  84948. }
  84949. // Header returns an http.Header that can be modified by the caller to
  84950. // add HTTP headers to the request.
  84951. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  84952. if c.header_ == nil {
  84953. c.header_ = make(http.Header)
  84954. }
  84955. return c.header_
  84956. }
  84957. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  84958. reqHeaders := make(http.Header)
  84959. for k, v := range c.header_ {
  84960. reqHeaders[k] = v
  84961. }
  84962. reqHeaders.Set("User-Agent", c.s.userAgent())
  84963. if c.ifNoneMatch_ != "" {
  84964. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84965. }
  84966. var body io.Reader = nil
  84967. c.urlParams_.Set("alt", alt)
  84968. c.urlParams_.Set("prettyPrint", "false")
  84969. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  84970. urls += "?" + c.urlParams_.Encode()
  84971. req, err := http.NewRequest("GET", urls, body)
  84972. if err != nil {
  84973. return nil, err
  84974. }
  84975. req.Header = reqHeaders
  84976. googleapi.Expand(req.URL, map[string]string{
  84977. "project": c.project,
  84978. "targetHttpProxy": c.targetHttpProxy,
  84979. })
  84980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84981. }
  84982. // Do executes the "compute.targetHttpProxies.get" call.
  84983. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  84984. // status code is an error. Response headers are in either
  84985. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  84986. // at all) in error.(*googleapi.Error).Header. Use
  84987. // googleapi.IsNotModified to check whether the returned error was
  84988. // because http.StatusNotModified was returned.
  84989. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  84990. gensupport.SetOptions(c.urlParams_, opts...)
  84991. res, err := c.doRequest("json")
  84992. if res != nil && res.StatusCode == http.StatusNotModified {
  84993. if res.Body != nil {
  84994. res.Body.Close()
  84995. }
  84996. return nil, &googleapi.Error{
  84997. Code: res.StatusCode,
  84998. Header: res.Header,
  84999. }
  85000. }
  85001. if err != nil {
  85002. return nil, err
  85003. }
  85004. defer googleapi.CloseBody(res)
  85005. if err := googleapi.CheckResponse(res); err != nil {
  85006. return nil, err
  85007. }
  85008. ret := &TargetHttpProxy{
  85009. ServerResponse: googleapi.ServerResponse{
  85010. Header: res.Header,
  85011. HTTPStatusCode: res.StatusCode,
  85012. },
  85013. }
  85014. target := &ret
  85015. if err := gensupport.DecodeResponse(target, res); err != nil {
  85016. return nil, err
  85017. }
  85018. return ret, nil
  85019. // {
  85020. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  85021. // "httpMethod": "GET",
  85022. // "id": "compute.targetHttpProxies.get",
  85023. // "parameterOrder": [
  85024. // "project",
  85025. // "targetHttpProxy"
  85026. // ],
  85027. // "parameters": {
  85028. // "project": {
  85029. // "description": "Project ID for this request.",
  85030. // "location": "path",
  85031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85032. // "required": true,
  85033. // "type": "string"
  85034. // },
  85035. // "targetHttpProxy": {
  85036. // "description": "Name of the TargetHttpProxy resource to return.",
  85037. // "location": "path",
  85038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85039. // "required": true,
  85040. // "type": "string"
  85041. // }
  85042. // },
  85043. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  85044. // "response": {
  85045. // "$ref": "TargetHttpProxy"
  85046. // },
  85047. // "scopes": [
  85048. // "https://www.googleapis.com/auth/cloud-platform",
  85049. // "https://www.googleapis.com/auth/compute",
  85050. // "https://www.googleapis.com/auth/compute.readonly"
  85051. // ]
  85052. // }
  85053. }
  85054. // method id "compute.targetHttpProxies.insert":
  85055. type TargetHttpProxiesInsertCall struct {
  85056. s *Service
  85057. project string
  85058. targethttpproxy *TargetHttpProxy
  85059. urlParams_ gensupport.URLParams
  85060. ctx_ context.Context
  85061. header_ http.Header
  85062. }
  85063. // Insert: Creates a TargetHttpProxy resource in the specified project
  85064. // using the data included in the request.
  85065. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  85066. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  85067. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85068. c.project = project
  85069. c.targethttpproxy = targethttpproxy
  85070. return c
  85071. }
  85072. // RequestId sets the optional parameter "requestId": An optional
  85073. // request ID to identify requests. Specify a unique request ID so that
  85074. // if you must retry your request, the server will know to ignore the
  85075. // request if it has already been completed.
  85076. //
  85077. // For example, consider a situation where you make an initial request
  85078. // and the request times out. If you make the request again with the
  85079. // same request ID, the server can check if original operation with the
  85080. // same request ID was received, and if so, will ignore the second
  85081. // request. This prevents clients from accidentally creating duplicate
  85082. // commitments.
  85083. //
  85084. // The request ID must be a valid UUID with the exception that zero UUID
  85085. // is not supported (00000000-0000-0000-0000-000000000000).
  85086. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  85087. c.urlParams_.Set("requestId", requestId)
  85088. return c
  85089. }
  85090. // Fields allows partial responses to be retrieved. See
  85091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85092. // for more information.
  85093. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  85094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85095. return c
  85096. }
  85097. // Context sets the context to be used in this call's Do method. Any
  85098. // pending HTTP request will be aborted if the provided context is
  85099. // canceled.
  85100. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  85101. c.ctx_ = ctx
  85102. return c
  85103. }
  85104. // Header returns an http.Header that can be modified by the caller to
  85105. // add HTTP headers to the request.
  85106. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  85107. if c.header_ == nil {
  85108. c.header_ = make(http.Header)
  85109. }
  85110. return c.header_
  85111. }
  85112. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  85113. reqHeaders := make(http.Header)
  85114. for k, v := range c.header_ {
  85115. reqHeaders[k] = v
  85116. }
  85117. reqHeaders.Set("User-Agent", c.s.userAgent())
  85118. var body io.Reader = nil
  85119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  85120. if err != nil {
  85121. return nil, err
  85122. }
  85123. reqHeaders.Set("Content-Type", "application/json")
  85124. c.urlParams_.Set("alt", alt)
  85125. c.urlParams_.Set("prettyPrint", "false")
  85126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  85127. urls += "?" + c.urlParams_.Encode()
  85128. req, err := http.NewRequest("POST", urls, body)
  85129. if err != nil {
  85130. return nil, err
  85131. }
  85132. req.Header = reqHeaders
  85133. googleapi.Expand(req.URL, map[string]string{
  85134. "project": c.project,
  85135. })
  85136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85137. }
  85138. // Do executes the "compute.targetHttpProxies.insert" call.
  85139. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85140. // status code is an error. Response headers are in either
  85141. // *Operation.ServerResponse.Header or (if a response was returned at
  85142. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85143. // to check whether the returned error was because
  85144. // http.StatusNotModified was returned.
  85145. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85146. gensupport.SetOptions(c.urlParams_, opts...)
  85147. res, err := c.doRequest("json")
  85148. if res != nil && res.StatusCode == http.StatusNotModified {
  85149. if res.Body != nil {
  85150. res.Body.Close()
  85151. }
  85152. return nil, &googleapi.Error{
  85153. Code: res.StatusCode,
  85154. Header: res.Header,
  85155. }
  85156. }
  85157. if err != nil {
  85158. return nil, err
  85159. }
  85160. defer googleapi.CloseBody(res)
  85161. if err := googleapi.CheckResponse(res); err != nil {
  85162. return nil, err
  85163. }
  85164. ret := &Operation{
  85165. ServerResponse: googleapi.ServerResponse{
  85166. Header: res.Header,
  85167. HTTPStatusCode: res.StatusCode,
  85168. },
  85169. }
  85170. target := &ret
  85171. if err := gensupport.DecodeResponse(target, res); err != nil {
  85172. return nil, err
  85173. }
  85174. return ret, nil
  85175. // {
  85176. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  85177. // "httpMethod": "POST",
  85178. // "id": "compute.targetHttpProxies.insert",
  85179. // "parameterOrder": [
  85180. // "project"
  85181. // ],
  85182. // "parameters": {
  85183. // "project": {
  85184. // "description": "Project ID for this request.",
  85185. // "location": "path",
  85186. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85187. // "required": true,
  85188. // "type": "string"
  85189. // },
  85190. // "requestId": {
  85191. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85192. // "location": "query",
  85193. // "type": "string"
  85194. // }
  85195. // },
  85196. // "path": "{project}/global/targetHttpProxies",
  85197. // "request": {
  85198. // "$ref": "TargetHttpProxy"
  85199. // },
  85200. // "response": {
  85201. // "$ref": "Operation"
  85202. // },
  85203. // "scopes": [
  85204. // "https://www.googleapis.com/auth/cloud-platform",
  85205. // "https://www.googleapis.com/auth/compute"
  85206. // ]
  85207. // }
  85208. }
  85209. // method id "compute.targetHttpProxies.list":
  85210. type TargetHttpProxiesListCall struct {
  85211. s *Service
  85212. project string
  85213. urlParams_ gensupport.URLParams
  85214. ifNoneMatch_ string
  85215. ctx_ context.Context
  85216. header_ http.Header
  85217. }
  85218. // List: Retrieves the list of TargetHttpProxy resources available to
  85219. // the specified project.
  85220. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  85221. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  85222. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85223. c.project = project
  85224. return c
  85225. }
  85226. // Filter sets the optional parameter "filter": A filter expression that
  85227. // filters resources listed in the response. The expression must specify
  85228. // the field name, a comparison operator, and the value that you want to
  85229. // use for filtering. The value must be a string, a number, or a
  85230. // boolean. The comparison operator must be either =, !=, >, or <.
  85231. //
  85232. // For example, if you are filtering Compute Engine instances, you can
  85233. // exclude instances named example-instance by specifying name !=
  85234. // example-instance.
  85235. //
  85236. // You can also filter nested fields. For example, you could specify
  85237. // scheduling.automaticRestart = false to include instances only if they
  85238. // are not scheduled for automatic restarts. You can use filtering on
  85239. // nested fields to filter based on resource labels.
  85240. //
  85241. // To filter on multiple expressions, provide each separate expression
  85242. // within parentheses. For example, (scheduling.automaticRestart = true)
  85243. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85244. // AND expression. However, you can include AND and OR expressions
  85245. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85246. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85247. // true).
  85248. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  85249. c.urlParams_.Set("filter", filter)
  85250. return c
  85251. }
  85252. // MaxResults sets the optional parameter "maxResults": The maximum
  85253. // number of results per page that should be returned. If the number of
  85254. // available results is larger than maxResults, Compute Engine returns a
  85255. // nextPageToken that can be used to get the next page of results in
  85256. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85257. // (Default: 500)
  85258. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  85259. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85260. return c
  85261. }
  85262. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85263. // a certain order. By default, results are returned in alphanumerical
  85264. // order based on the resource name.
  85265. //
  85266. // You can also sort results in descending order based on the creation
  85267. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85268. // based on the creationTimestamp field in reverse chronological order
  85269. // (newest result first). Use this to sort resources like operations so
  85270. // that the newest operation is returned first.
  85271. //
  85272. // Currently, only sorting by name or creationTimestamp desc is
  85273. // supported.
  85274. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  85275. c.urlParams_.Set("orderBy", orderBy)
  85276. return c
  85277. }
  85278. // PageToken sets the optional parameter "pageToken": Specifies a page
  85279. // token to use. Set pageToken to the nextPageToken returned by a
  85280. // previous list request to get the next page of results.
  85281. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  85282. c.urlParams_.Set("pageToken", pageToken)
  85283. return c
  85284. }
  85285. // Fields allows partial responses to be retrieved. See
  85286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85287. // for more information.
  85288. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  85289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85290. return c
  85291. }
  85292. // IfNoneMatch sets the optional parameter which makes the operation
  85293. // fail if the object's ETag matches the given value. This is useful for
  85294. // getting updates only after the object has changed since the last
  85295. // request. Use googleapi.IsNotModified to check whether the response
  85296. // error from Do is the result of In-None-Match.
  85297. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  85298. c.ifNoneMatch_ = entityTag
  85299. return c
  85300. }
  85301. // Context sets the context to be used in this call's Do method. Any
  85302. // pending HTTP request will be aborted if the provided context is
  85303. // canceled.
  85304. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  85305. c.ctx_ = ctx
  85306. return c
  85307. }
  85308. // Header returns an http.Header that can be modified by the caller to
  85309. // add HTTP headers to the request.
  85310. func (c *TargetHttpProxiesListCall) Header() http.Header {
  85311. if c.header_ == nil {
  85312. c.header_ = make(http.Header)
  85313. }
  85314. return c.header_
  85315. }
  85316. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  85317. reqHeaders := make(http.Header)
  85318. for k, v := range c.header_ {
  85319. reqHeaders[k] = v
  85320. }
  85321. reqHeaders.Set("User-Agent", c.s.userAgent())
  85322. if c.ifNoneMatch_ != "" {
  85323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85324. }
  85325. var body io.Reader = nil
  85326. c.urlParams_.Set("alt", alt)
  85327. c.urlParams_.Set("prettyPrint", "false")
  85328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  85329. urls += "?" + c.urlParams_.Encode()
  85330. req, err := http.NewRequest("GET", urls, body)
  85331. if err != nil {
  85332. return nil, err
  85333. }
  85334. req.Header = reqHeaders
  85335. googleapi.Expand(req.URL, map[string]string{
  85336. "project": c.project,
  85337. })
  85338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85339. }
  85340. // Do executes the "compute.targetHttpProxies.list" call.
  85341. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  85342. // non-2xx status code is an error. Response headers are in either
  85343. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  85344. // returned at all) in error.(*googleapi.Error).Header. Use
  85345. // googleapi.IsNotModified to check whether the returned error was
  85346. // because http.StatusNotModified was returned.
  85347. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  85348. gensupport.SetOptions(c.urlParams_, opts...)
  85349. res, err := c.doRequest("json")
  85350. if res != nil && res.StatusCode == http.StatusNotModified {
  85351. if res.Body != nil {
  85352. res.Body.Close()
  85353. }
  85354. return nil, &googleapi.Error{
  85355. Code: res.StatusCode,
  85356. Header: res.Header,
  85357. }
  85358. }
  85359. if err != nil {
  85360. return nil, err
  85361. }
  85362. defer googleapi.CloseBody(res)
  85363. if err := googleapi.CheckResponse(res); err != nil {
  85364. return nil, err
  85365. }
  85366. ret := &TargetHttpProxyList{
  85367. ServerResponse: googleapi.ServerResponse{
  85368. Header: res.Header,
  85369. HTTPStatusCode: res.StatusCode,
  85370. },
  85371. }
  85372. target := &ret
  85373. if err := gensupport.DecodeResponse(target, res); err != nil {
  85374. return nil, err
  85375. }
  85376. return ret, nil
  85377. // {
  85378. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  85379. // "httpMethod": "GET",
  85380. // "id": "compute.targetHttpProxies.list",
  85381. // "parameterOrder": [
  85382. // "project"
  85383. // ],
  85384. // "parameters": {
  85385. // "filter": {
  85386. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85387. // "location": "query",
  85388. // "type": "string"
  85389. // },
  85390. // "maxResults": {
  85391. // "default": "500",
  85392. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85393. // "format": "uint32",
  85394. // "location": "query",
  85395. // "minimum": "0",
  85396. // "type": "integer"
  85397. // },
  85398. // "orderBy": {
  85399. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85400. // "location": "query",
  85401. // "type": "string"
  85402. // },
  85403. // "pageToken": {
  85404. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85405. // "location": "query",
  85406. // "type": "string"
  85407. // },
  85408. // "project": {
  85409. // "description": "Project ID for this request.",
  85410. // "location": "path",
  85411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85412. // "required": true,
  85413. // "type": "string"
  85414. // }
  85415. // },
  85416. // "path": "{project}/global/targetHttpProxies",
  85417. // "response": {
  85418. // "$ref": "TargetHttpProxyList"
  85419. // },
  85420. // "scopes": [
  85421. // "https://www.googleapis.com/auth/cloud-platform",
  85422. // "https://www.googleapis.com/auth/compute",
  85423. // "https://www.googleapis.com/auth/compute.readonly"
  85424. // ]
  85425. // }
  85426. }
  85427. // Pages invokes f for each page of results.
  85428. // A non-nil error returned from f will halt the iteration.
  85429. // The provided context supersedes any context provided to the Context method.
  85430. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  85431. c.ctx_ = ctx
  85432. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85433. for {
  85434. x, err := c.Do()
  85435. if err != nil {
  85436. return err
  85437. }
  85438. if err := f(x); err != nil {
  85439. return err
  85440. }
  85441. if x.NextPageToken == "" {
  85442. return nil
  85443. }
  85444. c.PageToken(x.NextPageToken)
  85445. }
  85446. }
  85447. // method id "compute.targetHttpProxies.setUrlMap":
  85448. type TargetHttpProxiesSetUrlMapCall struct {
  85449. s *Service
  85450. project string
  85451. targetHttpProxy string
  85452. urlmapreference *UrlMapReference
  85453. urlParams_ gensupport.URLParams
  85454. ctx_ context.Context
  85455. header_ http.Header
  85456. }
  85457. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  85458. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  85459. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  85460. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85461. c.project = project
  85462. c.targetHttpProxy = targetHttpProxy
  85463. c.urlmapreference = urlmapreference
  85464. return c
  85465. }
  85466. // RequestId sets the optional parameter "requestId": An optional
  85467. // request ID to identify requests. Specify a unique request ID so that
  85468. // if you must retry your request, the server will know to ignore the
  85469. // request if it has already been completed.
  85470. //
  85471. // For example, consider a situation where you make an initial request
  85472. // and the request times out. If you make the request again with the
  85473. // same request ID, the server can check if original operation with the
  85474. // same request ID was received, and if so, will ignore the second
  85475. // request. This prevents clients from accidentally creating duplicate
  85476. // commitments.
  85477. //
  85478. // The request ID must be a valid UUID with the exception that zero UUID
  85479. // is not supported (00000000-0000-0000-0000-000000000000).
  85480. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  85481. c.urlParams_.Set("requestId", requestId)
  85482. return c
  85483. }
  85484. // Fields allows partial responses to be retrieved. See
  85485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85486. // for more information.
  85487. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  85488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85489. return c
  85490. }
  85491. // Context sets the context to be used in this call's Do method. Any
  85492. // pending HTTP request will be aborted if the provided context is
  85493. // canceled.
  85494. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  85495. c.ctx_ = ctx
  85496. return c
  85497. }
  85498. // Header returns an http.Header that can be modified by the caller to
  85499. // add HTTP headers to the request.
  85500. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  85501. if c.header_ == nil {
  85502. c.header_ = make(http.Header)
  85503. }
  85504. return c.header_
  85505. }
  85506. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  85507. reqHeaders := make(http.Header)
  85508. for k, v := range c.header_ {
  85509. reqHeaders[k] = v
  85510. }
  85511. reqHeaders.Set("User-Agent", c.s.userAgent())
  85512. var body io.Reader = nil
  85513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  85514. if err != nil {
  85515. return nil, err
  85516. }
  85517. reqHeaders.Set("Content-Type", "application/json")
  85518. c.urlParams_.Set("alt", alt)
  85519. c.urlParams_.Set("prettyPrint", "false")
  85520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  85521. urls += "?" + c.urlParams_.Encode()
  85522. req, err := http.NewRequest("POST", urls, body)
  85523. if err != nil {
  85524. return nil, err
  85525. }
  85526. req.Header = reqHeaders
  85527. googleapi.Expand(req.URL, map[string]string{
  85528. "project": c.project,
  85529. "targetHttpProxy": c.targetHttpProxy,
  85530. })
  85531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85532. }
  85533. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  85534. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85535. // status code is an error. Response headers are in either
  85536. // *Operation.ServerResponse.Header or (if a response was returned at
  85537. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85538. // to check whether the returned error was because
  85539. // http.StatusNotModified was returned.
  85540. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85541. gensupport.SetOptions(c.urlParams_, opts...)
  85542. res, err := c.doRequest("json")
  85543. if res != nil && res.StatusCode == http.StatusNotModified {
  85544. if res.Body != nil {
  85545. res.Body.Close()
  85546. }
  85547. return nil, &googleapi.Error{
  85548. Code: res.StatusCode,
  85549. Header: res.Header,
  85550. }
  85551. }
  85552. if err != nil {
  85553. return nil, err
  85554. }
  85555. defer googleapi.CloseBody(res)
  85556. if err := googleapi.CheckResponse(res); err != nil {
  85557. return nil, err
  85558. }
  85559. ret := &Operation{
  85560. ServerResponse: googleapi.ServerResponse{
  85561. Header: res.Header,
  85562. HTTPStatusCode: res.StatusCode,
  85563. },
  85564. }
  85565. target := &ret
  85566. if err := gensupport.DecodeResponse(target, res); err != nil {
  85567. return nil, err
  85568. }
  85569. return ret, nil
  85570. // {
  85571. // "description": "Changes the URL map for TargetHttpProxy.",
  85572. // "httpMethod": "POST",
  85573. // "id": "compute.targetHttpProxies.setUrlMap",
  85574. // "parameterOrder": [
  85575. // "project",
  85576. // "targetHttpProxy"
  85577. // ],
  85578. // "parameters": {
  85579. // "project": {
  85580. // "description": "Project ID for this request.",
  85581. // "location": "path",
  85582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85583. // "required": true,
  85584. // "type": "string"
  85585. // },
  85586. // "requestId": {
  85587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85588. // "location": "query",
  85589. // "type": "string"
  85590. // },
  85591. // "targetHttpProxy": {
  85592. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  85593. // "location": "path",
  85594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85595. // "required": true,
  85596. // "type": "string"
  85597. // }
  85598. // },
  85599. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  85600. // "request": {
  85601. // "$ref": "UrlMapReference"
  85602. // },
  85603. // "response": {
  85604. // "$ref": "Operation"
  85605. // },
  85606. // "scopes": [
  85607. // "https://www.googleapis.com/auth/cloud-platform",
  85608. // "https://www.googleapis.com/auth/compute"
  85609. // ]
  85610. // }
  85611. }
  85612. // method id "compute.targetHttpsProxies.delete":
  85613. type TargetHttpsProxiesDeleteCall struct {
  85614. s *Service
  85615. project string
  85616. targetHttpsProxy string
  85617. urlParams_ gensupport.URLParams
  85618. ctx_ context.Context
  85619. header_ http.Header
  85620. }
  85621. // Delete: Deletes the specified TargetHttpsProxy resource.
  85622. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  85623. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85624. c.project = project
  85625. c.targetHttpsProxy = targetHttpsProxy
  85626. return c
  85627. }
  85628. // RequestId sets the optional parameter "requestId": An optional
  85629. // request ID to identify requests. Specify a unique request ID so that
  85630. // if you must retry your request, the server will know to ignore the
  85631. // request if it has already been completed.
  85632. //
  85633. // For example, consider a situation where you make an initial request
  85634. // and the request times out. If you make the request again with the
  85635. // same request ID, the server can check if original operation with the
  85636. // same request ID was received, and if so, will ignore the second
  85637. // request. This prevents clients from accidentally creating duplicate
  85638. // commitments.
  85639. //
  85640. // The request ID must be a valid UUID with the exception that zero UUID
  85641. // is not supported (00000000-0000-0000-0000-000000000000).
  85642. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  85643. c.urlParams_.Set("requestId", requestId)
  85644. return c
  85645. }
  85646. // Fields allows partial responses to be retrieved. See
  85647. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85648. // for more information.
  85649. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  85650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85651. return c
  85652. }
  85653. // Context sets the context to be used in this call's Do method. Any
  85654. // pending HTTP request will be aborted if the provided context is
  85655. // canceled.
  85656. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  85657. c.ctx_ = ctx
  85658. return c
  85659. }
  85660. // Header returns an http.Header that can be modified by the caller to
  85661. // add HTTP headers to the request.
  85662. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  85663. if c.header_ == nil {
  85664. c.header_ = make(http.Header)
  85665. }
  85666. return c.header_
  85667. }
  85668. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  85669. reqHeaders := make(http.Header)
  85670. for k, v := range c.header_ {
  85671. reqHeaders[k] = v
  85672. }
  85673. reqHeaders.Set("User-Agent", c.s.userAgent())
  85674. var body io.Reader = nil
  85675. c.urlParams_.Set("alt", alt)
  85676. c.urlParams_.Set("prettyPrint", "false")
  85677. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  85678. urls += "?" + c.urlParams_.Encode()
  85679. req, err := http.NewRequest("DELETE", urls, body)
  85680. if err != nil {
  85681. return nil, err
  85682. }
  85683. req.Header = reqHeaders
  85684. googleapi.Expand(req.URL, map[string]string{
  85685. "project": c.project,
  85686. "targetHttpsProxy": c.targetHttpsProxy,
  85687. })
  85688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85689. }
  85690. // Do executes the "compute.targetHttpsProxies.delete" call.
  85691. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85692. // status code is an error. Response headers are in either
  85693. // *Operation.ServerResponse.Header or (if a response was returned at
  85694. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85695. // to check whether the returned error was because
  85696. // http.StatusNotModified was returned.
  85697. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85698. gensupport.SetOptions(c.urlParams_, opts...)
  85699. res, err := c.doRequest("json")
  85700. if res != nil && res.StatusCode == http.StatusNotModified {
  85701. if res.Body != nil {
  85702. res.Body.Close()
  85703. }
  85704. return nil, &googleapi.Error{
  85705. Code: res.StatusCode,
  85706. Header: res.Header,
  85707. }
  85708. }
  85709. if err != nil {
  85710. return nil, err
  85711. }
  85712. defer googleapi.CloseBody(res)
  85713. if err := googleapi.CheckResponse(res); err != nil {
  85714. return nil, err
  85715. }
  85716. ret := &Operation{
  85717. ServerResponse: googleapi.ServerResponse{
  85718. Header: res.Header,
  85719. HTTPStatusCode: res.StatusCode,
  85720. },
  85721. }
  85722. target := &ret
  85723. if err := gensupport.DecodeResponse(target, res); err != nil {
  85724. return nil, err
  85725. }
  85726. return ret, nil
  85727. // {
  85728. // "description": "Deletes the specified TargetHttpsProxy resource.",
  85729. // "httpMethod": "DELETE",
  85730. // "id": "compute.targetHttpsProxies.delete",
  85731. // "parameterOrder": [
  85732. // "project",
  85733. // "targetHttpsProxy"
  85734. // ],
  85735. // "parameters": {
  85736. // "project": {
  85737. // "description": "Project ID for this request.",
  85738. // "location": "path",
  85739. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85740. // "required": true,
  85741. // "type": "string"
  85742. // },
  85743. // "requestId": {
  85744. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85745. // "location": "query",
  85746. // "type": "string"
  85747. // },
  85748. // "targetHttpsProxy": {
  85749. // "description": "Name of the TargetHttpsProxy resource to delete.",
  85750. // "location": "path",
  85751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85752. // "required": true,
  85753. // "type": "string"
  85754. // }
  85755. // },
  85756. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  85757. // "response": {
  85758. // "$ref": "Operation"
  85759. // },
  85760. // "scopes": [
  85761. // "https://www.googleapis.com/auth/cloud-platform",
  85762. // "https://www.googleapis.com/auth/compute"
  85763. // ]
  85764. // }
  85765. }
  85766. // method id "compute.targetHttpsProxies.get":
  85767. type TargetHttpsProxiesGetCall struct {
  85768. s *Service
  85769. project string
  85770. targetHttpsProxy string
  85771. urlParams_ gensupport.URLParams
  85772. ifNoneMatch_ string
  85773. ctx_ context.Context
  85774. header_ http.Header
  85775. }
  85776. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  85777. // available target HTTPS proxies by making a list() request.
  85778. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  85779. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85780. c.project = project
  85781. c.targetHttpsProxy = targetHttpsProxy
  85782. return c
  85783. }
  85784. // Fields allows partial responses to be retrieved. See
  85785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85786. // for more information.
  85787. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  85788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85789. return c
  85790. }
  85791. // IfNoneMatch sets the optional parameter which makes the operation
  85792. // fail if the object's ETag matches the given value. This is useful for
  85793. // getting updates only after the object has changed since the last
  85794. // request. Use googleapi.IsNotModified to check whether the response
  85795. // error from Do is the result of In-None-Match.
  85796. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  85797. c.ifNoneMatch_ = entityTag
  85798. return c
  85799. }
  85800. // Context sets the context to be used in this call's Do method. Any
  85801. // pending HTTP request will be aborted if the provided context is
  85802. // canceled.
  85803. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  85804. c.ctx_ = ctx
  85805. return c
  85806. }
  85807. // Header returns an http.Header that can be modified by the caller to
  85808. // add HTTP headers to the request.
  85809. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  85810. if c.header_ == nil {
  85811. c.header_ = make(http.Header)
  85812. }
  85813. return c.header_
  85814. }
  85815. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  85816. reqHeaders := make(http.Header)
  85817. for k, v := range c.header_ {
  85818. reqHeaders[k] = v
  85819. }
  85820. reqHeaders.Set("User-Agent", c.s.userAgent())
  85821. if c.ifNoneMatch_ != "" {
  85822. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85823. }
  85824. var body io.Reader = nil
  85825. c.urlParams_.Set("alt", alt)
  85826. c.urlParams_.Set("prettyPrint", "false")
  85827. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  85828. urls += "?" + c.urlParams_.Encode()
  85829. req, err := http.NewRequest("GET", urls, body)
  85830. if err != nil {
  85831. return nil, err
  85832. }
  85833. req.Header = reqHeaders
  85834. googleapi.Expand(req.URL, map[string]string{
  85835. "project": c.project,
  85836. "targetHttpsProxy": c.targetHttpsProxy,
  85837. })
  85838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85839. }
  85840. // Do executes the "compute.targetHttpsProxies.get" call.
  85841. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  85842. // non-2xx status code is an error. Response headers are in either
  85843. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  85844. // returned at all) in error.(*googleapi.Error).Header. Use
  85845. // googleapi.IsNotModified to check whether the returned error was
  85846. // because http.StatusNotModified was returned.
  85847. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  85848. gensupport.SetOptions(c.urlParams_, opts...)
  85849. res, err := c.doRequest("json")
  85850. if res != nil && res.StatusCode == http.StatusNotModified {
  85851. if res.Body != nil {
  85852. res.Body.Close()
  85853. }
  85854. return nil, &googleapi.Error{
  85855. Code: res.StatusCode,
  85856. Header: res.Header,
  85857. }
  85858. }
  85859. if err != nil {
  85860. return nil, err
  85861. }
  85862. defer googleapi.CloseBody(res)
  85863. if err := googleapi.CheckResponse(res); err != nil {
  85864. return nil, err
  85865. }
  85866. ret := &TargetHttpsProxy{
  85867. ServerResponse: googleapi.ServerResponse{
  85868. Header: res.Header,
  85869. HTTPStatusCode: res.StatusCode,
  85870. },
  85871. }
  85872. target := &ret
  85873. if err := gensupport.DecodeResponse(target, res); err != nil {
  85874. return nil, err
  85875. }
  85876. return ret, nil
  85877. // {
  85878. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  85879. // "httpMethod": "GET",
  85880. // "id": "compute.targetHttpsProxies.get",
  85881. // "parameterOrder": [
  85882. // "project",
  85883. // "targetHttpsProxy"
  85884. // ],
  85885. // "parameters": {
  85886. // "project": {
  85887. // "description": "Project ID for this request.",
  85888. // "location": "path",
  85889. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85890. // "required": true,
  85891. // "type": "string"
  85892. // },
  85893. // "targetHttpsProxy": {
  85894. // "description": "Name of the TargetHttpsProxy resource to return.",
  85895. // "location": "path",
  85896. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85897. // "required": true,
  85898. // "type": "string"
  85899. // }
  85900. // },
  85901. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  85902. // "response": {
  85903. // "$ref": "TargetHttpsProxy"
  85904. // },
  85905. // "scopes": [
  85906. // "https://www.googleapis.com/auth/cloud-platform",
  85907. // "https://www.googleapis.com/auth/compute",
  85908. // "https://www.googleapis.com/auth/compute.readonly"
  85909. // ]
  85910. // }
  85911. }
  85912. // method id "compute.targetHttpsProxies.insert":
  85913. type TargetHttpsProxiesInsertCall struct {
  85914. s *Service
  85915. project string
  85916. targethttpsproxy *TargetHttpsProxy
  85917. urlParams_ gensupport.URLParams
  85918. ctx_ context.Context
  85919. header_ http.Header
  85920. }
  85921. // Insert: Creates a TargetHttpsProxy resource in the specified project
  85922. // using the data included in the request.
  85923. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  85924. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85925. c.project = project
  85926. c.targethttpsproxy = targethttpsproxy
  85927. return c
  85928. }
  85929. // RequestId sets the optional parameter "requestId": An optional
  85930. // request ID to identify requests. Specify a unique request ID so that
  85931. // if you must retry your request, the server will know to ignore the
  85932. // request if it has already been completed.
  85933. //
  85934. // For example, consider a situation where you make an initial request
  85935. // and the request times out. If you make the request again with the
  85936. // same request ID, the server can check if original operation with the
  85937. // same request ID was received, and if so, will ignore the second
  85938. // request. This prevents clients from accidentally creating duplicate
  85939. // commitments.
  85940. //
  85941. // The request ID must be a valid UUID with the exception that zero UUID
  85942. // is not supported (00000000-0000-0000-0000-000000000000).
  85943. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  85944. c.urlParams_.Set("requestId", requestId)
  85945. return c
  85946. }
  85947. // Fields allows partial responses to be retrieved. See
  85948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85949. // for more information.
  85950. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  85951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85952. return c
  85953. }
  85954. // Context sets the context to be used in this call's Do method. Any
  85955. // pending HTTP request will be aborted if the provided context is
  85956. // canceled.
  85957. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  85958. c.ctx_ = ctx
  85959. return c
  85960. }
  85961. // Header returns an http.Header that can be modified by the caller to
  85962. // add HTTP headers to the request.
  85963. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  85964. if c.header_ == nil {
  85965. c.header_ = make(http.Header)
  85966. }
  85967. return c.header_
  85968. }
  85969. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  85970. reqHeaders := make(http.Header)
  85971. for k, v := range c.header_ {
  85972. reqHeaders[k] = v
  85973. }
  85974. reqHeaders.Set("User-Agent", c.s.userAgent())
  85975. var body io.Reader = nil
  85976. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  85977. if err != nil {
  85978. return nil, err
  85979. }
  85980. reqHeaders.Set("Content-Type", "application/json")
  85981. c.urlParams_.Set("alt", alt)
  85982. c.urlParams_.Set("prettyPrint", "false")
  85983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  85984. urls += "?" + c.urlParams_.Encode()
  85985. req, err := http.NewRequest("POST", urls, body)
  85986. if err != nil {
  85987. return nil, err
  85988. }
  85989. req.Header = reqHeaders
  85990. googleapi.Expand(req.URL, map[string]string{
  85991. "project": c.project,
  85992. })
  85993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85994. }
  85995. // Do executes the "compute.targetHttpsProxies.insert" call.
  85996. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85997. // status code is an error. Response headers are in either
  85998. // *Operation.ServerResponse.Header or (if a response was returned at
  85999. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86000. // to check whether the returned error was because
  86001. // http.StatusNotModified was returned.
  86002. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86003. gensupport.SetOptions(c.urlParams_, opts...)
  86004. res, err := c.doRequest("json")
  86005. if res != nil && res.StatusCode == http.StatusNotModified {
  86006. if res.Body != nil {
  86007. res.Body.Close()
  86008. }
  86009. return nil, &googleapi.Error{
  86010. Code: res.StatusCode,
  86011. Header: res.Header,
  86012. }
  86013. }
  86014. if err != nil {
  86015. return nil, err
  86016. }
  86017. defer googleapi.CloseBody(res)
  86018. if err := googleapi.CheckResponse(res); err != nil {
  86019. return nil, err
  86020. }
  86021. ret := &Operation{
  86022. ServerResponse: googleapi.ServerResponse{
  86023. Header: res.Header,
  86024. HTTPStatusCode: res.StatusCode,
  86025. },
  86026. }
  86027. target := &ret
  86028. if err := gensupport.DecodeResponse(target, res); err != nil {
  86029. return nil, err
  86030. }
  86031. return ret, nil
  86032. // {
  86033. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  86034. // "httpMethod": "POST",
  86035. // "id": "compute.targetHttpsProxies.insert",
  86036. // "parameterOrder": [
  86037. // "project"
  86038. // ],
  86039. // "parameters": {
  86040. // "project": {
  86041. // "description": "Project ID for this request.",
  86042. // "location": "path",
  86043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86044. // "required": true,
  86045. // "type": "string"
  86046. // },
  86047. // "requestId": {
  86048. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86049. // "location": "query",
  86050. // "type": "string"
  86051. // }
  86052. // },
  86053. // "path": "{project}/global/targetHttpsProxies",
  86054. // "request": {
  86055. // "$ref": "TargetHttpsProxy"
  86056. // },
  86057. // "response": {
  86058. // "$ref": "Operation"
  86059. // },
  86060. // "scopes": [
  86061. // "https://www.googleapis.com/auth/cloud-platform",
  86062. // "https://www.googleapis.com/auth/compute"
  86063. // ]
  86064. // }
  86065. }
  86066. // method id "compute.targetHttpsProxies.list":
  86067. type TargetHttpsProxiesListCall struct {
  86068. s *Service
  86069. project string
  86070. urlParams_ gensupport.URLParams
  86071. ifNoneMatch_ string
  86072. ctx_ context.Context
  86073. header_ http.Header
  86074. }
  86075. // List: Retrieves the list of TargetHttpsProxy resources available to
  86076. // the specified project.
  86077. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  86078. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86079. c.project = project
  86080. return c
  86081. }
  86082. // Filter sets the optional parameter "filter": A filter expression that
  86083. // filters resources listed in the response. The expression must specify
  86084. // the field name, a comparison operator, and the value that you want to
  86085. // use for filtering. The value must be a string, a number, or a
  86086. // boolean. The comparison operator must be either =, !=, >, or <.
  86087. //
  86088. // For example, if you are filtering Compute Engine instances, you can
  86089. // exclude instances named example-instance by specifying name !=
  86090. // example-instance.
  86091. //
  86092. // You can also filter nested fields. For example, you could specify
  86093. // scheduling.automaticRestart = false to include instances only if they
  86094. // are not scheduled for automatic restarts. You can use filtering on
  86095. // nested fields to filter based on resource labels.
  86096. //
  86097. // To filter on multiple expressions, provide each separate expression
  86098. // within parentheses. For example, (scheduling.automaticRestart = true)
  86099. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86100. // AND expression. However, you can include AND and OR expressions
  86101. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86102. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86103. // true).
  86104. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  86105. c.urlParams_.Set("filter", filter)
  86106. return c
  86107. }
  86108. // MaxResults sets the optional parameter "maxResults": The maximum
  86109. // number of results per page that should be returned. If the number of
  86110. // available results is larger than maxResults, Compute Engine returns a
  86111. // nextPageToken that can be used to get the next page of results in
  86112. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86113. // (Default: 500)
  86114. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  86115. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86116. return c
  86117. }
  86118. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86119. // a certain order. By default, results are returned in alphanumerical
  86120. // order based on the resource name.
  86121. //
  86122. // You can also sort results in descending order based on the creation
  86123. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86124. // based on the creationTimestamp field in reverse chronological order
  86125. // (newest result first). Use this to sort resources like operations so
  86126. // that the newest operation is returned first.
  86127. //
  86128. // Currently, only sorting by name or creationTimestamp desc is
  86129. // supported.
  86130. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  86131. c.urlParams_.Set("orderBy", orderBy)
  86132. return c
  86133. }
  86134. // PageToken sets the optional parameter "pageToken": Specifies a page
  86135. // token to use. Set pageToken to the nextPageToken returned by a
  86136. // previous list request to get the next page of results.
  86137. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  86138. c.urlParams_.Set("pageToken", pageToken)
  86139. return c
  86140. }
  86141. // Fields allows partial responses to be retrieved. See
  86142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86143. // for more information.
  86144. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  86145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86146. return c
  86147. }
  86148. // IfNoneMatch sets the optional parameter which makes the operation
  86149. // fail if the object's ETag matches the given value. This is useful for
  86150. // getting updates only after the object has changed since the last
  86151. // request. Use googleapi.IsNotModified to check whether the response
  86152. // error from Do is the result of In-None-Match.
  86153. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  86154. c.ifNoneMatch_ = entityTag
  86155. return c
  86156. }
  86157. // Context sets the context to be used in this call's Do method. Any
  86158. // pending HTTP request will be aborted if the provided context is
  86159. // canceled.
  86160. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  86161. c.ctx_ = ctx
  86162. return c
  86163. }
  86164. // Header returns an http.Header that can be modified by the caller to
  86165. // add HTTP headers to the request.
  86166. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  86167. if c.header_ == nil {
  86168. c.header_ = make(http.Header)
  86169. }
  86170. return c.header_
  86171. }
  86172. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  86173. reqHeaders := make(http.Header)
  86174. for k, v := range c.header_ {
  86175. reqHeaders[k] = v
  86176. }
  86177. reqHeaders.Set("User-Agent", c.s.userAgent())
  86178. if c.ifNoneMatch_ != "" {
  86179. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86180. }
  86181. var body io.Reader = nil
  86182. c.urlParams_.Set("alt", alt)
  86183. c.urlParams_.Set("prettyPrint", "false")
  86184. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  86185. urls += "?" + c.urlParams_.Encode()
  86186. req, err := http.NewRequest("GET", urls, body)
  86187. if err != nil {
  86188. return nil, err
  86189. }
  86190. req.Header = reqHeaders
  86191. googleapi.Expand(req.URL, map[string]string{
  86192. "project": c.project,
  86193. })
  86194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86195. }
  86196. // Do executes the "compute.targetHttpsProxies.list" call.
  86197. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  86198. // non-2xx status code is an error. Response headers are in either
  86199. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  86200. // returned at all) in error.(*googleapi.Error).Header. Use
  86201. // googleapi.IsNotModified to check whether the returned error was
  86202. // because http.StatusNotModified was returned.
  86203. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  86204. gensupport.SetOptions(c.urlParams_, opts...)
  86205. res, err := c.doRequest("json")
  86206. if res != nil && res.StatusCode == http.StatusNotModified {
  86207. if res.Body != nil {
  86208. res.Body.Close()
  86209. }
  86210. return nil, &googleapi.Error{
  86211. Code: res.StatusCode,
  86212. Header: res.Header,
  86213. }
  86214. }
  86215. if err != nil {
  86216. return nil, err
  86217. }
  86218. defer googleapi.CloseBody(res)
  86219. if err := googleapi.CheckResponse(res); err != nil {
  86220. return nil, err
  86221. }
  86222. ret := &TargetHttpsProxyList{
  86223. ServerResponse: googleapi.ServerResponse{
  86224. Header: res.Header,
  86225. HTTPStatusCode: res.StatusCode,
  86226. },
  86227. }
  86228. target := &ret
  86229. if err := gensupport.DecodeResponse(target, res); err != nil {
  86230. return nil, err
  86231. }
  86232. return ret, nil
  86233. // {
  86234. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  86235. // "httpMethod": "GET",
  86236. // "id": "compute.targetHttpsProxies.list",
  86237. // "parameterOrder": [
  86238. // "project"
  86239. // ],
  86240. // "parameters": {
  86241. // "filter": {
  86242. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86243. // "location": "query",
  86244. // "type": "string"
  86245. // },
  86246. // "maxResults": {
  86247. // "default": "500",
  86248. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86249. // "format": "uint32",
  86250. // "location": "query",
  86251. // "minimum": "0",
  86252. // "type": "integer"
  86253. // },
  86254. // "orderBy": {
  86255. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86256. // "location": "query",
  86257. // "type": "string"
  86258. // },
  86259. // "pageToken": {
  86260. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86261. // "location": "query",
  86262. // "type": "string"
  86263. // },
  86264. // "project": {
  86265. // "description": "Project ID for this request.",
  86266. // "location": "path",
  86267. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86268. // "required": true,
  86269. // "type": "string"
  86270. // }
  86271. // },
  86272. // "path": "{project}/global/targetHttpsProxies",
  86273. // "response": {
  86274. // "$ref": "TargetHttpsProxyList"
  86275. // },
  86276. // "scopes": [
  86277. // "https://www.googleapis.com/auth/cloud-platform",
  86278. // "https://www.googleapis.com/auth/compute",
  86279. // "https://www.googleapis.com/auth/compute.readonly"
  86280. // ]
  86281. // }
  86282. }
  86283. // Pages invokes f for each page of results.
  86284. // A non-nil error returned from f will halt the iteration.
  86285. // The provided context supersedes any context provided to the Context method.
  86286. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  86287. c.ctx_ = ctx
  86288. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86289. for {
  86290. x, err := c.Do()
  86291. if err != nil {
  86292. return err
  86293. }
  86294. if err := f(x); err != nil {
  86295. return err
  86296. }
  86297. if x.NextPageToken == "" {
  86298. return nil
  86299. }
  86300. c.PageToken(x.NextPageToken)
  86301. }
  86302. }
  86303. // method id "compute.targetHttpsProxies.setQuicOverride":
  86304. type TargetHttpsProxiesSetQuicOverrideCall struct {
  86305. s *Service
  86306. project string
  86307. targetHttpsProxy string
  86308. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  86309. urlParams_ gensupport.URLParams
  86310. ctx_ context.Context
  86311. header_ http.Header
  86312. }
  86313. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  86314. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  86315. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86316. c.project = project
  86317. c.targetHttpsProxy = targetHttpsProxy
  86318. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  86319. return c
  86320. }
  86321. // RequestId sets the optional parameter "requestId": An optional
  86322. // request ID to identify requests. Specify a unique request ID so that
  86323. // if you must retry your request, the server will know to ignore the
  86324. // request if it has already been completed.
  86325. //
  86326. // For example, consider a situation where you make an initial request
  86327. // and the request times out. If you make the request again with the
  86328. // same request ID, the server can check if original operation with the
  86329. // same request ID was received, and if so, will ignore the second
  86330. // request. This prevents clients from accidentally creating duplicate
  86331. // commitments.
  86332. //
  86333. // The request ID must be a valid UUID with the exception that zero UUID
  86334. // is not supported (00000000-0000-0000-0000-000000000000).
  86335. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  86336. c.urlParams_.Set("requestId", requestId)
  86337. return c
  86338. }
  86339. // Fields allows partial responses to be retrieved. See
  86340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86341. // for more information.
  86342. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  86343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86344. return c
  86345. }
  86346. // Context sets the context to be used in this call's Do method. Any
  86347. // pending HTTP request will be aborted if the provided context is
  86348. // canceled.
  86349. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  86350. c.ctx_ = ctx
  86351. return c
  86352. }
  86353. // Header returns an http.Header that can be modified by the caller to
  86354. // add HTTP headers to the request.
  86355. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  86356. if c.header_ == nil {
  86357. c.header_ = make(http.Header)
  86358. }
  86359. return c.header_
  86360. }
  86361. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  86362. reqHeaders := make(http.Header)
  86363. for k, v := range c.header_ {
  86364. reqHeaders[k] = v
  86365. }
  86366. reqHeaders.Set("User-Agent", c.s.userAgent())
  86367. var body io.Reader = nil
  86368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  86369. if err != nil {
  86370. return nil, err
  86371. }
  86372. reqHeaders.Set("Content-Type", "application/json")
  86373. c.urlParams_.Set("alt", alt)
  86374. c.urlParams_.Set("prettyPrint", "false")
  86375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  86376. urls += "?" + c.urlParams_.Encode()
  86377. req, err := http.NewRequest("POST", urls, body)
  86378. if err != nil {
  86379. return nil, err
  86380. }
  86381. req.Header = reqHeaders
  86382. googleapi.Expand(req.URL, map[string]string{
  86383. "project": c.project,
  86384. "targetHttpsProxy": c.targetHttpsProxy,
  86385. })
  86386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86387. }
  86388. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  86389. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86390. // status code is an error. Response headers are in either
  86391. // *Operation.ServerResponse.Header or (if a response was returned at
  86392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86393. // to check whether the returned error was because
  86394. // http.StatusNotModified was returned.
  86395. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86396. gensupport.SetOptions(c.urlParams_, opts...)
  86397. res, err := c.doRequest("json")
  86398. if res != nil && res.StatusCode == http.StatusNotModified {
  86399. if res.Body != nil {
  86400. res.Body.Close()
  86401. }
  86402. return nil, &googleapi.Error{
  86403. Code: res.StatusCode,
  86404. Header: res.Header,
  86405. }
  86406. }
  86407. if err != nil {
  86408. return nil, err
  86409. }
  86410. defer googleapi.CloseBody(res)
  86411. if err := googleapi.CheckResponse(res); err != nil {
  86412. return nil, err
  86413. }
  86414. ret := &Operation{
  86415. ServerResponse: googleapi.ServerResponse{
  86416. Header: res.Header,
  86417. HTTPStatusCode: res.StatusCode,
  86418. },
  86419. }
  86420. target := &ret
  86421. if err := gensupport.DecodeResponse(target, res); err != nil {
  86422. return nil, err
  86423. }
  86424. return ret, nil
  86425. // {
  86426. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  86427. // "httpMethod": "POST",
  86428. // "id": "compute.targetHttpsProxies.setQuicOverride",
  86429. // "parameterOrder": [
  86430. // "project",
  86431. // "targetHttpsProxy"
  86432. // ],
  86433. // "parameters": {
  86434. // "project": {
  86435. // "description": "Project ID for this request.",
  86436. // "location": "path",
  86437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86438. // "required": true,
  86439. // "type": "string"
  86440. // },
  86441. // "requestId": {
  86442. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86443. // "location": "query",
  86444. // "type": "string"
  86445. // },
  86446. // "targetHttpsProxy": {
  86447. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  86448. // "location": "path",
  86449. // "required": true,
  86450. // "type": "string"
  86451. // }
  86452. // },
  86453. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  86454. // "request": {
  86455. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  86456. // },
  86457. // "response": {
  86458. // "$ref": "Operation"
  86459. // },
  86460. // "scopes": [
  86461. // "https://www.googleapis.com/auth/cloud-platform",
  86462. // "https://www.googleapis.com/auth/compute"
  86463. // ]
  86464. // }
  86465. }
  86466. // method id "compute.targetHttpsProxies.setSslCertificates":
  86467. type TargetHttpsProxiesSetSslCertificatesCall struct {
  86468. s *Service
  86469. project string
  86470. targetHttpsProxy string
  86471. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  86472. urlParams_ gensupport.URLParams
  86473. ctx_ context.Context
  86474. header_ http.Header
  86475. }
  86476. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  86477. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  86478. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86479. c.project = project
  86480. c.targetHttpsProxy = targetHttpsProxy
  86481. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  86482. return c
  86483. }
  86484. // RequestId sets the optional parameter "requestId": An optional
  86485. // request ID to identify requests. Specify a unique request ID so that
  86486. // if you must retry your request, the server will know to ignore the
  86487. // request if it has already been completed.
  86488. //
  86489. // For example, consider a situation where you make an initial request
  86490. // and the request times out. If you make the request again with the
  86491. // same request ID, the server can check if original operation with the
  86492. // same request ID was received, and if so, will ignore the second
  86493. // request. This prevents clients from accidentally creating duplicate
  86494. // commitments.
  86495. //
  86496. // The request ID must be a valid UUID with the exception that zero UUID
  86497. // is not supported (00000000-0000-0000-0000-000000000000).
  86498. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  86499. c.urlParams_.Set("requestId", requestId)
  86500. return c
  86501. }
  86502. // Fields allows partial responses to be retrieved. See
  86503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86504. // for more information.
  86505. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  86506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86507. return c
  86508. }
  86509. // Context sets the context to be used in this call's Do method. Any
  86510. // pending HTTP request will be aborted if the provided context is
  86511. // canceled.
  86512. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  86513. c.ctx_ = ctx
  86514. return c
  86515. }
  86516. // Header returns an http.Header that can be modified by the caller to
  86517. // add HTTP headers to the request.
  86518. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  86519. if c.header_ == nil {
  86520. c.header_ = make(http.Header)
  86521. }
  86522. return c.header_
  86523. }
  86524. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  86525. reqHeaders := make(http.Header)
  86526. for k, v := range c.header_ {
  86527. reqHeaders[k] = v
  86528. }
  86529. reqHeaders.Set("User-Agent", c.s.userAgent())
  86530. var body io.Reader = nil
  86531. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  86532. if err != nil {
  86533. return nil, err
  86534. }
  86535. reqHeaders.Set("Content-Type", "application/json")
  86536. c.urlParams_.Set("alt", alt)
  86537. c.urlParams_.Set("prettyPrint", "false")
  86538. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  86539. urls += "?" + c.urlParams_.Encode()
  86540. req, err := http.NewRequest("POST", urls, body)
  86541. if err != nil {
  86542. return nil, err
  86543. }
  86544. req.Header = reqHeaders
  86545. googleapi.Expand(req.URL, map[string]string{
  86546. "project": c.project,
  86547. "targetHttpsProxy": c.targetHttpsProxy,
  86548. })
  86549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86550. }
  86551. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  86552. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86553. // status code is an error. Response headers are in either
  86554. // *Operation.ServerResponse.Header or (if a response was returned at
  86555. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86556. // to check whether the returned error was because
  86557. // http.StatusNotModified was returned.
  86558. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86559. gensupport.SetOptions(c.urlParams_, opts...)
  86560. res, err := c.doRequest("json")
  86561. if res != nil && res.StatusCode == http.StatusNotModified {
  86562. if res.Body != nil {
  86563. res.Body.Close()
  86564. }
  86565. return nil, &googleapi.Error{
  86566. Code: res.StatusCode,
  86567. Header: res.Header,
  86568. }
  86569. }
  86570. if err != nil {
  86571. return nil, err
  86572. }
  86573. defer googleapi.CloseBody(res)
  86574. if err := googleapi.CheckResponse(res); err != nil {
  86575. return nil, err
  86576. }
  86577. ret := &Operation{
  86578. ServerResponse: googleapi.ServerResponse{
  86579. Header: res.Header,
  86580. HTTPStatusCode: res.StatusCode,
  86581. },
  86582. }
  86583. target := &ret
  86584. if err := gensupport.DecodeResponse(target, res); err != nil {
  86585. return nil, err
  86586. }
  86587. return ret, nil
  86588. // {
  86589. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  86590. // "httpMethod": "POST",
  86591. // "id": "compute.targetHttpsProxies.setSslCertificates",
  86592. // "parameterOrder": [
  86593. // "project",
  86594. // "targetHttpsProxy"
  86595. // ],
  86596. // "parameters": {
  86597. // "project": {
  86598. // "description": "Project ID for this request.",
  86599. // "location": "path",
  86600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86601. // "required": true,
  86602. // "type": "string"
  86603. // },
  86604. // "requestId": {
  86605. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86606. // "location": "query",
  86607. // "type": "string"
  86608. // },
  86609. // "targetHttpsProxy": {
  86610. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  86611. // "location": "path",
  86612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86613. // "required": true,
  86614. // "type": "string"
  86615. // }
  86616. // },
  86617. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  86618. // "request": {
  86619. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  86620. // },
  86621. // "response": {
  86622. // "$ref": "Operation"
  86623. // },
  86624. // "scopes": [
  86625. // "https://www.googleapis.com/auth/cloud-platform",
  86626. // "https://www.googleapis.com/auth/compute"
  86627. // ]
  86628. // }
  86629. }
  86630. // method id "compute.targetHttpsProxies.setSslPolicy":
  86631. type TargetHttpsProxiesSetSslPolicyCall struct {
  86632. s *Service
  86633. project string
  86634. targetHttpsProxy string
  86635. sslpolicyreference *SslPolicyReference
  86636. urlParams_ gensupport.URLParams
  86637. ctx_ context.Context
  86638. header_ http.Header
  86639. }
  86640. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  86641. // policy specifies the server-side support for SSL features. This
  86642. // affects connections between clients and the HTTPS proxy load
  86643. // balancer. They do not affect the connection between the load balancer
  86644. // and the backends.
  86645. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  86646. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86647. c.project = project
  86648. c.targetHttpsProxy = targetHttpsProxy
  86649. c.sslpolicyreference = sslpolicyreference
  86650. return c
  86651. }
  86652. // RequestId sets the optional parameter "requestId": An optional
  86653. // request ID to identify requests. Specify a unique request ID so that
  86654. // if you must retry your request, the server will know to ignore the
  86655. // request if it has already been completed.
  86656. //
  86657. // For example, consider a situation where you make an initial request
  86658. // and the request times out. If you make the request again with the
  86659. // same request ID, the server can check if original operation with the
  86660. // same request ID was received, and if so, will ignore the second
  86661. // request. This prevents clients from accidentally creating duplicate
  86662. // commitments.
  86663. //
  86664. // The request ID must be a valid UUID with the exception that zero UUID
  86665. // is not supported (00000000-0000-0000-0000-000000000000).
  86666. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  86667. c.urlParams_.Set("requestId", requestId)
  86668. return c
  86669. }
  86670. // Fields allows partial responses to be retrieved. See
  86671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86672. // for more information.
  86673. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  86674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86675. return c
  86676. }
  86677. // Context sets the context to be used in this call's Do method. Any
  86678. // pending HTTP request will be aborted if the provided context is
  86679. // canceled.
  86680. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  86681. c.ctx_ = ctx
  86682. return c
  86683. }
  86684. // Header returns an http.Header that can be modified by the caller to
  86685. // add HTTP headers to the request.
  86686. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  86687. if c.header_ == nil {
  86688. c.header_ = make(http.Header)
  86689. }
  86690. return c.header_
  86691. }
  86692. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  86693. reqHeaders := make(http.Header)
  86694. for k, v := range c.header_ {
  86695. reqHeaders[k] = v
  86696. }
  86697. reqHeaders.Set("User-Agent", c.s.userAgent())
  86698. var body io.Reader = nil
  86699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  86700. if err != nil {
  86701. return nil, err
  86702. }
  86703. reqHeaders.Set("Content-Type", "application/json")
  86704. c.urlParams_.Set("alt", alt)
  86705. c.urlParams_.Set("prettyPrint", "false")
  86706. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  86707. urls += "?" + c.urlParams_.Encode()
  86708. req, err := http.NewRequest("POST", urls, body)
  86709. if err != nil {
  86710. return nil, err
  86711. }
  86712. req.Header = reqHeaders
  86713. googleapi.Expand(req.URL, map[string]string{
  86714. "project": c.project,
  86715. "targetHttpsProxy": c.targetHttpsProxy,
  86716. })
  86717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86718. }
  86719. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  86720. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86721. // status code is an error. Response headers are in either
  86722. // *Operation.ServerResponse.Header or (if a response was returned at
  86723. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86724. // to check whether the returned error was because
  86725. // http.StatusNotModified was returned.
  86726. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86727. gensupport.SetOptions(c.urlParams_, opts...)
  86728. res, err := c.doRequest("json")
  86729. if res != nil && res.StatusCode == http.StatusNotModified {
  86730. if res.Body != nil {
  86731. res.Body.Close()
  86732. }
  86733. return nil, &googleapi.Error{
  86734. Code: res.StatusCode,
  86735. Header: res.Header,
  86736. }
  86737. }
  86738. if err != nil {
  86739. return nil, err
  86740. }
  86741. defer googleapi.CloseBody(res)
  86742. if err := googleapi.CheckResponse(res); err != nil {
  86743. return nil, err
  86744. }
  86745. ret := &Operation{
  86746. ServerResponse: googleapi.ServerResponse{
  86747. Header: res.Header,
  86748. HTTPStatusCode: res.StatusCode,
  86749. },
  86750. }
  86751. target := &ret
  86752. if err := gensupport.DecodeResponse(target, res); err != nil {
  86753. return nil, err
  86754. }
  86755. return ret, nil
  86756. // {
  86757. // "description": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.",
  86758. // "httpMethod": "POST",
  86759. // "id": "compute.targetHttpsProxies.setSslPolicy",
  86760. // "parameterOrder": [
  86761. // "project",
  86762. // "targetHttpsProxy"
  86763. // ],
  86764. // "parameters": {
  86765. // "project": {
  86766. // "description": "Project ID for this request.",
  86767. // "location": "path",
  86768. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86769. // "required": true,
  86770. // "type": "string"
  86771. // },
  86772. // "requestId": {
  86773. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86774. // "location": "query",
  86775. // "type": "string"
  86776. // },
  86777. // "targetHttpsProxy": {
  86778. // "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
  86779. // "location": "path",
  86780. // "required": true,
  86781. // "type": "string"
  86782. // }
  86783. // },
  86784. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  86785. // "request": {
  86786. // "$ref": "SslPolicyReference"
  86787. // },
  86788. // "response": {
  86789. // "$ref": "Operation"
  86790. // },
  86791. // "scopes": [
  86792. // "https://www.googleapis.com/auth/cloud-platform",
  86793. // "https://www.googleapis.com/auth/compute"
  86794. // ]
  86795. // }
  86796. }
  86797. // method id "compute.targetHttpsProxies.setUrlMap":
  86798. type TargetHttpsProxiesSetUrlMapCall struct {
  86799. s *Service
  86800. project string
  86801. targetHttpsProxy string
  86802. urlmapreference *UrlMapReference
  86803. urlParams_ gensupport.URLParams
  86804. ctx_ context.Context
  86805. header_ http.Header
  86806. }
  86807. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  86808. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  86809. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86810. c.project = project
  86811. c.targetHttpsProxy = targetHttpsProxy
  86812. c.urlmapreference = urlmapreference
  86813. return c
  86814. }
  86815. // RequestId sets the optional parameter "requestId": An optional
  86816. // request ID to identify requests. Specify a unique request ID so that
  86817. // if you must retry your request, the server will know to ignore the
  86818. // request if it has already been completed.
  86819. //
  86820. // For example, consider a situation where you make an initial request
  86821. // and the request times out. If you make the request again with the
  86822. // same request ID, the server can check if original operation with the
  86823. // same request ID was received, and if so, will ignore the second
  86824. // request. This prevents clients from accidentally creating duplicate
  86825. // commitments.
  86826. //
  86827. // The request ID must be a valid UUID with the exception that zero UUID
  86828. // is not supported (00000000-0000-0000-0000-000000000000).
  86829. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  86830. c.urlParams_.Set("requestId", requestId)
  86831. return c
  86832. }
  86833. // Fields allows partial responses to be retrieved. See
  86834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86835. // for more information.
  86836. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  86837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86838. return c
  86839. }
  86840. // Context sets the context to be used in this call's Do method. Any
  86841. // pending HTTP request will be aborted if the provided context is
  86842. // canceled.
  86843. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  86844. c.ctx_ = ctx
  86845. return c
  86846. }
  86847. // Header returns an http.Header that can be modified by the caller to
  86848. // add HTTP headers to the request.
  86849. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  86850. if c.header_ == nil {
  86851. c.header_ = make(http.Header)
  86852. }
  86853. return c.header_
  86854. }
  86855. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  86856. reqHeaders := make(http.Header)
  86857. for k, v := range c.header_ {
  86858. reqHeaders[k] = v
  86859. }
  86860. reqHeaders.Set("User-Agent", c.s.userAgent())
  86861. var body io.Reader = nil
  86862. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  86863. if err != nil {
  86864. return nil, err
  86865. }
  86866. reqHeaders.Set("Content-Type", "application/json")
  86867. c.urlParams_.Set("alt", alt)
  86868. c.urlParams_.Set("prettyPrint", "false")
  86869. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  86870. urls += "?" + c.urlParams_.Encode()
  86871. req, err := http.NewRequest("POST", urls, body)
  86872. if err != nil {
  86873. return nil, err
  86874. }
  86875. req.Header = reqHeaders
  86876. googleapi.Expand(req.URL, map[string]string{
  86877. "project": c.project,
  86878. "targetHttpsProxy": c.targetHttpsProxy,
  86879. })
  86880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86881. }
  86882. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  86883. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86884. // status code is an error. Response headers are in either
  86885. // *Operation.ServerResponse.Header or (if a response was returned at
  86886. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86887. // to check whether the returned error was because
  86888. // http.StatusNotModified was returned.
  86889. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86890. gensupport.SetOptions(c.urlParams_, opts...)
  86891. res, err := c.doRequest("json")
  86892. if res != nil && res.StatusCode == http.StatusNotModified {
  86893. if res.Body != nil {
  86894. res.Body.Close()
  86895. }
  86896. return nil, &googleapi.Error{
  86897. Code: res.StatusCode,
  86898. Header: res.Header,
  86899. }
  86900. }
  86901. if err != nil {
  86902. return nil, err
  86903. }
  86904. defer googleapi.CloseBody(res)
  86905. if err := googleapi.CheckResponse(res); err != nil {
  86906. return nil, err
  86907. }
  86908. ret := &Operation{
  86909. ServerResponse: googleapi.ServerResponse{
  86910. Header: res.Header,
  86911. HTTPStatusCode: res.StatusCode,
  86912. },
  86913. }
  86914. target := &ret
  86915. if err := gensupport.DecodeResponse(target, res); err != nil {
  86916. return nil, err
  86917. }
  86918. return ret, nil
  86919. // {
  86920. // "description": "Changes the URL map for TargetHttpsProxy.",
  86921. // "httpMethod": "POST",
  86922. // "id": "compute.targetHttpsProxies.setUrlMap",
  86923. // "parameterOrder": [
  86924. // "project",
  86925. // "targetHttpsProxy"
  86926. // ],
  86927. // "parameters": {
  86928. // "project": {
  86929. // "description": "Project ID for this request.",
  86930. // "location": "path",
  86931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86932. // "required": true,
  86933. // "type": "string"
  86934. // },
  86935. // "requestId": {
  86936. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86937. // "location": "query",
  86938. // "type": "string"
  86939. // },
  86940. // "targetHttpsProxy": {
  86941. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  86942. // "location": "path",
  86943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86944. // "required": true,
  86945. // "type": "string"
  86946. // }
  86947. // },
  86948. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  86949. // "request": {
  86950. // "$ref": "UrlMapReference"
  86951. // },
  86952. // "response": {
  86953. // "$ref": "Operation"
  86954. // },
  86955. // "scopes": [
  86956. // "https://www.googleapis.com/auth/cloud-platform",
  86957. // "https://www.googleapis.com/auth/compute"
  86958. // ]
  86959. // }
  86960. }
  86961. // method id "compute.targetInstances.aggregatedList":
  86962. type TargetInstancesAggregatedListCall struct {
  86963. s *Service
  86964. project string
  86965. urlParams_ gensupport.URLParams
  86966. ifNoneMatch_ string
  86967. ctx_ context.Context
  86968. header_ http.Header
  86969. }
  86970. // AggregatedList: Retrieves an aggregated list of target instances.
  86971. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  86972. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  86973. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86974. c.project = project
  86975. return c
  86976. }
  86977. // Filter sets the optional parameter "filter": A filter expression that
  86978. // filters resources listed in the response. The expression must specify
  86979. // the field name, a comparison operator, and the value that you want to
  86980. // use for filtering. The value must be a string, a number, or a
  86981. // boolean. The comparison operator must be either =, !=, >, or <.
  86982. //
  86983. // For example, if you are filtering Compute Engine instances, you can
  86984. // exclude instances named example-instance by specifying name !=
  86985. // example-instance.
  86986. //
  86987. // You can also filter nested fields. For example, you could specify
  86988. // scheduling.automaticRestart = false to include instances only if they
  86989. // are not scheduled for automatic restarts. You can use filtering on
  86990. // nested fields to filter based on resource labels.
  86991. //
  86992. // To filter on multiple expressions, provide each separate expression
  86993. // within parentheses. For example, (scheduling.automaticRestart = true)
  86994. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86995. // AND expression. However, you can include AND and OR expressions
  86996. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86997. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86998. // true).
  86999. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  87000. c.urlParams_.Set("filter", filter)
  87001. return c
  87002. }
  87003. // MaxResults sets the optional parameter "maxResults": The maximum
  87004. // number of results per page that should be returned. If the number of
  87005. // available results is larger than maxResults, Compute Engine returns a
  87006. // nextPageToken that can be used to get the next page of results in
  87007. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87008. // (Default: 500)
  87009. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  87010. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87011. return c
  87012. }
  87013. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87014. // a certain order. By default, results are returned in alphanumerical
  87015. // order based on the resource name.
  87016. //
  87017. // You can also sort results in descending order based on the creation
  87018. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87019. // based on the creationTimestamp field in reverse chronological order
  87020. // (newest result first). Use this to sort resources like operations so
  87021. // that the newest operation is returned first.
  87022. //
  87023. // Currently, only sorting by name or creationTimestamp desc is
  87024. // supported.
  87025. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  87026. c.urlParams_.Set("orderBy", orderBy)
  87027. return c
  87028. }
  87029. // PageToken sets the optional parameter "pageToken": Specifies a page
  87030. // token to use. Set pageToken to the nextPageToken returned by a
  87031. // previous list request to get the next page of results.
  87032. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  87033. c.urlParams_.Set("pageToken", pageToken)
  87034. return c
  87035. }
  87036. // Fields allows partial responses to be retrieved. See
  87037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87038. // for more information.
  87039. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  87040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87041. return c
  87042. }
  87043. // IfNoneMatch sets the optional parameter which makes the operation
  87044. // fail if the object's ETag matches the given value. This is useful for
  87045. // getting updates only after the object has changed since the last
  87046. // request. Use googleapi.IsNotModified to check whether the response
  87047. // error from Do is the result of In-None-Match.
  87048. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  87049. c.ifNoneMatch_ = entityTag
  87050. return c
  87051. }
  87052. // Context sets the context to be used in this call's Do method. Any
  87053. // pending HTTP request will be aborted if the provided context is
  87054. // canceled.
  87055. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  87056. c.ctx_ = ctx
  87057. return c
  87058. }
  87059. // Header returns an http.Header that can be modified by the caller to
  87060. // add HTTP headers to the request.
  87061. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  87062. if c.header_ == nil {
  87063. c.header_ = make(http.Header)
  87064. }
  87065. return c.header_
  87066. }
  87067. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  87068. reqHeaders := make(http.Header)
  87069. for k, v := range c.header_ {
  87070. reqHeaders[k] = v
  87071. }
  87072. reqHeaders.Set("User-Agent", c.s.userAgent())
  87073. if c.ifNoneMatch_ != "" {
  87074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87075. }
  87076. var body io.Reader = nil
  87077. c.urlParams_.Set("alt", alt)
  87078. c.urlParams_.Set("prettyPrint", "false")
  87079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  87080. urls += "?" + c.urlParams_.Encode()
  87081. req, err := http.NewRequest("GET", urls, body)
  87082. if err != nil {
  87083. return nil, err
  87084. }
  87085. req.Header = reqHeaders
  87086. googleapi.Expand(req.URL, map[string]string{
  87087. "project": c.project,
  87088. })
  87089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87090. }
  87091. // Do executes the "compute.targetInstances.aggregatedList" call.
  87092. // Exactly one of *TargetInstanceAggregatedList or error will be
  87093. // non-nil. Any non-2xx status code is an error. Response headers are in
  87094. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  87095. // response was returned at all) in error.(*googleapi.Error).Header. Use
  87096. // googleapi.IsNotModified to check whether the returned error was
  87097. // because http.StatusNotModified was returned.
  87098. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  87099. gensupport.SetOptions(c.urlParams_, opts...)
  87100. res, err := c.doRequest("json")
  87101. if res != nil && res.StatusCode == http.StatusNotModified {
  87102. if res.Body != nil {
  87103. res.Body.Close()
  87104. }
  87105. return nil, &googleapi.Error{
  87106. Code: res.StatusCode,
  87107. Header: res.Header,
  87108. }
  87109. }
  87110. if err != nil {
  87111. return nil, err
  87112. }
  87113. defer googleapi.CloseBody(res)
  87114. if err := googleapi.CheckResponse(res); err != nil {
  87115. return nil, err
  87116. }
  87117. ret := &TargetInstanceAggregatedList{
  87118. ServerResponse: googleapi.ServerResponse{
  87119. Header: res.Header,
  87120. HTTPStatusCode: res.StatusCode,
  87121. },
  87122. }
  87123. target := &ret
  87124. if err := gensupport.DecodeResponse(target, res); err != nil {
  87125. return nil, err
  87126. }
  87127. return ret, nil
  87128. // {
  87129. // "description": "Retrieves an aggregated list of target instances.",
  87130. // "httpMethod": "GET",
  87131. // "id": "compute.targetInstances.aggregatedList",
  87132. // "parameterOrder": [
  87133. // "project"
  87134. // ],
  87135. // "parameters": {
  87136. // "filter": {
  87137. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87138. // "location": "query",
  87139. // "type": "string"
  87140. // },
  87141. // "maxResults": {
  87142. // "default": "500",
  87143. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87144. // "format": "uint32",
  87145. // "location": "query",
  87146. // "minimum": "0",
  87147. // "type": "integer"
  87148. // },
  87149. // "orderBy": {
  87150. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87151. // "location": "query",
  87152. // "type": "string"
  87153. // },
  87154. // "pageToken": {
  87155. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87156. // "location": "query",
  87157. // "type": "string"
  87158. // },
  87159. // "project": {
  87160. // "description": "Project ID for this request.",
  87161. // "location": "path",
  87162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87163. // "required": true,
  87164. // "type": "string"
  87165. // }
  87166. // },
  87167. // "path": "{project}/aggregated/targetInstances",
  87168. // "response": {
  87169. // "$ref": "TargetInstanceAggregatedList"
  87170. // },
  87171. // "scopes": [
  87172. // "https://www.googleapis.com/auth/cloud-platform",
  87173. // "https://www.googleapis.com/auth/compute",
  87174. // "https://www.googleapis.com/auth/compute.readonly"
  87175. // ]
  87176. // }
  87177. }
  87178. // Pages invokes f for each page of results.
  87179. // A non-nil error returned from f will halt the iteration.
  87180. // The provided context supersedes any context provided to the Context method.
  87181. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  87182. c.ctx_ = ctx
  87183. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87184. for {
  87185. x, err := c.Do()
  87186. if err != nil {
  87187. return err
  87188. }
  87189. if err := f(x); err != nil {
  87190. return err
  87191. }
  87192. if x.NextPageToken == "" {
  87193. return nil
  87194. }
  87195. c.PageToken(x.NextPageToken)
  87196. }
  87197. }
  87198. // method id "compute.targetInstances.delete":
  87199. type TargetInstancesDeleteCall struct {
  87200. s *Service
  87201. project string
  87202. zone string
  87203. targetInstance string
  87204. urlParams_ gensupport.URLParams
  87205. ctx_ context.Context
  87206. header_ http.Header
  87207. }
  87208. // Delete: Deletes the specified TargetInstance resource.
  87209. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  87210. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  87211. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87212. c.project = project
  87213. c.zone = zone
  87214. c.targetInstance = targetInstance
  87215. return c
  87216. }
  87217. // RequestId sets the optional parameter "requestId": An optional
  87218. // request ID to identify requests. Specify a unique request ID so that
  87219. // if you must retry your request, the server will know to ignore the
  87220. // request if it has already been completed.
  87221. //
  87222. // For example, consider a situation where you make an initial request
  87223. // and the request times out. If you make the request again with the
  87224. // same request ID, the server can check if original operation with the
  87225. // same request ID was received, and if so, will ignore the second
  87226. // request. This prevents clients from accidentally creating duplicate
  87227. // commitments.
  87228. //
  87229. // The request ID must be a valid UUID with the exception that zero UUID
  87230. // is not supported (00000000-0000-0000-0000-000000000000).
  87231. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  87232. c.urlParams_.Set("requestId", requestId)
  87233. return c
  87234. }
  87235. // Fields allows partial responses to be retrieved. See
  87236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87237. // for more information.
  87238. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  87239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87240. return c
  87241. }
  87242. // Context sets the context to be used in this call's Do method. Any
  87243. // pending HTTP request will be aborted if the provided context is
  87244. // canceled.
  87245. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  87246. c.ctx_ = ctx
  87247. return c
  87248. }
  87249. // Header returns an http.Header that can be modified by the caller to
  87250. // add HTTP headers to the request.
  87251. func (c *TargetInstancesDeleteCall) Header() http.Header {
  87252. if c.header_ == nil {
  87253. c.header_ = make(http.Header)
  87254. }
  87255. return c.header_
  87256. }
  87257. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  87258. reqHeaders := make(http.Header)
  87259. for k, v := range c.header_ {
  87260. reqHeaders[k] = v
  87261. }
  87262. reqHeaders.Set("User-Agent", c.s.userAgent())
  87263. var body io.Reader = nil
  87264. c.urlParams_.Set("alt", alt)
  87265. c.urlParams_.Set("prettyPrint", "false")
  87266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  87267. urls += "?" + c.urlParams_.Encode()
  87268. req, err := http.NewRequest("DELETE", urls, body)
  87269. if err != nil {
  87270. return nil, err
  87271. }
  87272. req.Header = reqHeaders
  87273. googleapi.Expand(req.URL, map[string]string{
  87274. "project": c.project,
  87275. "zone": c.zone,
  87276. "targetInstance": c.targetInstance,
  87277. })
  87278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87279. }
  87280. // Do executes the "compute.targetInstances.delete" call.
  87281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87282. // status code is an error. Response headers are in either
  87283. // *Operation.ServerResponse.Header or (if a response was returned at
  87284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87285. // to check whether the returned error was because
  87286. // http.StatusNotModified was returned.
  87287. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87288. gensupport.SetOptions(c.urlParams_, opts...)
  87289. res, err := c.doRequest("json")
  87290. if res != nil && res.StatusCode == http.StatusNotModified {
  87291. if res.Body != nil {
  87292. res.Body.Close()
  87293. }
  87294. return nil, &googleapi.Error{
  87295. Code: res.StatusCode,
  87296. Header: res.Header,
  87297. }
  87298. }
  87299. if err != nil {
  87300. return nil, err
  87301. }
  87302. defer googleapi.CloseBody(res)
  87303. if err := googleapi.CheckResponse(res); err != nil {
  87304. return nil, err
  87305. }
  87306. ret := &Operation{
  87307. ServerResponse: googleapi.ServerResponse{
  87308. Header: res.Header,
  87309. HTTPStatusCode: res.StatusCode,
  87310. },
  87311. }
  87312. target := &ret
  87313. if err := gensupport.DecodeResponse(target, res); err != nil {
  87314. return nil, err
  87315. }
  87316. return ret, nil
  87317. // {
  87318. // "description": "Deletes the specified TargetInstance resource.",
  87319. // "httpMethod": "DELETE",
  87320. // "id": "compute.targetInstances.delete",
  87321. // "parameterOrder": [
  87322. // "project",
  87323. // "zone",
  87324. // "targetInstance"
  87325. // ],
  87326. // "parameters": {
  87327. // "project": {
  87328. // "description": "Project ID for this request.",
  87329. // "location": "path",
  87330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87331. // "required": true,
  87332. // "type": "string"
  87333. // },
  87334. // "requestId": {
  87335. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87336. // "location": "query",
  87337. // "type": "string"
  87338. // },
  87339. // "targetInstance": {
  87340. // "description": "Name of the TargetInstance resource to delete.",
  87341. // "location": "path",
  87342. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87343. // "required": true,
  87344. // "type": "string"
  87345. // },
  87346. // "zone": {
  87347. // "description": "Name of the zone scoping this request.",
  87348. // "location": "path",
  87349. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87350. // "required": true,
  87351. // "type": "string"
  87352. // }
  87353. // },
  87354. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  87355. // "response": {
  87356. // "$ref": "Operation"
  87357. // },
  87358. // "scopes": [
  87359. // "https://www.googleapis.com/auth/cloud-platform",
  87360. // "https://www.googleapis.com/auth/compute"
  87361. // ]
  87362. // }
  87363. }
  87364. // method id "compute.targetInstances.get":
  87365. type TargetInstancesGetCall struct {
  87366. s *Service
  87367. project string
  87368. zone string
  87369. targetInstance string
  87370. urlParams_ gensupport.URLParams
  87371. ifNoneMatch_ string
  87372. ctx_ context.Context
  87373. header_ http.Header
  87374. }
  87375. // Get: Returns the specified TargetInstance resource. Gets a list of
  87376. // available target instances by making a list() request.
  87377. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  87378. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  87379. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87380. c.project = project
  87381. c.zone = zone
  87382. c.targetInstance = targetInstance
  87383. return c
  87384. }
  87385. // Fields allows partial responses to be retrieved. See
  87386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87387. // for more information.
  87388. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  87389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87390. return c
  87391. }
  87392. // IfNoneMatch sets the optional parameter which makes the operation
  87393. // fail if the object's ETag matches the given value. This is useful for
  87394. // getting updates only after the object has changed since the last
  87395. // request. Use googleapi.IsNotModified to check whether the response
  87396. // error from Do is the result of In-None-Match.
  87397. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  87398. c.ifNoneMatch_ = entityTag
  87399. return c
  87400. }
  87401. // Context sets the context to be used in this call's Do method. Any
  87402. // pending HTTP request will be aborted if the provided context is
  87403. // canceled.
  87404. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  87405. c.ctx_ = ctx
  87406. return c
  87407. }
  87408. // Header returns an http.Header that can be modified by the caller to
  87409. // add HTTP headers to the request.
  87410. func (c *TargetInstancesGetCall) Header() http.Header {
  87411. if c.header_ == nil {
  87412. c.header_ = make(http.Header)
  87413. }
  87414. return c.header_
  87415. }
  87416. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  87417. reqHeaders := make(http.Header)
  87418. for k, v := range c.header_ {
  87419. reqHeaders[k] = v
  87420. }
  87421. reqHeaders.Set("User-Agent", c.s.userAgent())
  87422. if c.ifNoneMatch_ != "" {
  87423. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87424. }
  87425. var body io.Reader = nil
  87426. c.urlParams_.Set("alt", alt)
  87427. c.urlParams_.Set("prettyPrint", "false")
  87428. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  87429. urls += "?" + c.urlParams_.Encode()
  87430. req, err := http.NewRequest("GET", urls, body)
  87431. if err != nil {
  87432. return nil, err
  87433. }
  87434. req.Header = reqHeaders
  87435. googleapi.Expand(req.URL, map[string]string{
  87436. "project": c.project,
  87437. "zone": c.zone,
  87438. "targetInstance": c.targetInstance,
  87439. })
  87440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87441. }
  87442. // Do executes the "compute.targetInstances.get" call.
  87443. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  87444. // status code is an error. Response headers are in either
  87445. // *TargetInstance.ServerResponse.Header or (if a response was returned
  87446. // at all) in error.(*googleapi.Error).Header. Use
  87447. // googleapi.IsNotModified to check whether the returned error was
  87448. // because http.StatusNotModified was returned.
  87449. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  87450. gensupport.SetOptions(c.urlParams_, opts...)
  87451. res, err := c.doRequest("json")
  87452. if res != nil && res.StatusCode == http.StatusNotModified {
  87453. if res.Body != nil {
  87454. res.Body.Close()
  87455. }
  87456. return nil, &googleapi.Error{
  87457. Code: res.StatusCode,
  87458. Header: res.Header,
  87459. }
  87460. }
  87461. if err != nil {
  87462. return nil, err
  87463. }
  87464. defer googleapi.CloseBody(res)
  87465. if err := googleapi.CheckResponse(res); err != nil {
  87466. return nil, err
  87467. }
  87468. ret := &TargetInstance{
  87469. ServerResponse: googleapi.ServerResponse{
  87470. Header: res.Header,
  87471. HTTPStatusCode: res.StatusCode,
  87472. },
  87473. }
  87474. target := &ret
  87475. if err := gensupport.DecodeResponse(target, res); err != nil {
  87476. return nil, err
  87477. }
  87478. return ret, nil
  87479. // {
  87480. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  87481. // "httpMethod": "GET",
  87482. // "id": "compute.targetInstances.get",
  87483. // "parameterOrder": [
  87484. // "project",
  87485. // "zone",
  87486. // "targetInstance"
  87487. // ],
  87488. // "parameters": {
  87489. // "project": {
  87490. // "description": "Project ID for this request.",
  87491. // "location": "path",
  87492. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87493. // "required": true,
  87494. // "type": "string"
  87495. // },
  87496. // "targetInstance": {
  87497. // "description": "Name of the TargetInstance resource to return.",
  87498. // "location": "path",
  87499. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87500. // "required": true,
  87501. // "type": "string"
  87502. // },
  87503. // "zone": {
  87504. // "description": "Name of the zone scoping this request.",
  87505. // "location": "path",
  87506. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87507. // "required": true,
  87508. // "type": "string"
  87509. // }
  87510. // },
  87511. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  87512. // "response": {
  87513. // "$ref": "TargetInstance"
  87514. // },
  87515. // "scopes": [
  87516. // "https://www.googleapis.com/auth/cloud-platform",
  87517. // "https://www.googleapis.com/auth/compute",
  87518. // "https://www.googleapis.com/auth/compute.readonly"
  87519. // ]
  87520. // }
  87521. }
  87522. // method id "compute.targetInstances.insert":
  87523. type TargetInstancesInsertCall struct {
  87524. s *Service
  87525. project string
  87526. zone string
  87527. targetinstance *TargetInstance
  87528. urlParams_ gensupport.URLParams
  87529. ctx_ context.Context
  87530. header_ http.Header
  87531. }
  87532. // Insert: Creates a TargetInstance resource in the specified project
  87533. // and zone using the data included in the request.
  87534. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  87535. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  87536. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87537. c.project = project
  87538. c.zone = zone
  87539. c.targetinstance = targetinstance
  87540. return c
  87541. }
  87542. // RequestId sets the optional parameter "requestId": An optional
  87543. // request ID to identify requests. Specify a unique request ID so that
  87544. // if you must retry your request, the server will know to ignore the
  87545. // request if it has already been completed.
  87546. //
  87547. // For example, consider a situation where you make an initial request
  87548. // and the request times out. If you make the request again with the
  87549. // same request ID, the server can check if original operation with the
  87550. // same request ID was received, and if so, will ignore the second
  87551. // request. This prevents clients from accidentally creating duplicate
  87552. // commitments.
  87553. //
  87554. // The request ID must be a valid UUID with the exception that zero UUID
  87555. // is not supported (00000000-0000-0000-0000-000000000000).
  87556. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  87557. c.urlParams_.Set("requestId", requestId)
  87558. return c
  87559. }
  87560. // Fields allows partial responses to be retrieved. See
  87561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87562. // for more information.
  87563. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  87564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87565. return c
  87566. }
  87567. // Context sets the context to be used in this call's Do method. Any
  87568. // pending HTTP request will be aborted if the provided context is
  87569. // canceled.
  87570. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  87571. c.ctx_ = ctx
  87572. return c
  87573. }
  87574. // Header returns an http.Header that can be modified by the caller to
  87575. // add HTTP headers to the request.
  87576. func (c *TargetInstancesInsertCall) Header() http.Header {
  87577. if c.header_ == nil {
  87578. c.header_ = make(http.Header)
  87579. }
  87580. return c.header_
  87581. }
  87582. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  87583. reqHeaders := make(http.Header)
  87584. for k, v := range c.header_ {
  87585. reqHeaders[k] = v
  87586. }
  87587. reqHeaders.Set("User-Agent", c.s.userAgent())
  87588. var body io.Reader = nil
  87589. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  87590. if err != nil {
  87591. return nil, err
  87592. }
  87593. reqHeaders.Set("Content-Type", "application/json")
  87594. c.urlParams_.Set("alt", alt)
  87595. c.urlParams_.Set("prettyPrint", "false")
  87596. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  87597. urls += "?" + c.urlParams_.Encode()
  87598. req, err := http.NewRequest("POST", urls, body)
  87599. if err != nil {
  87600. return nil, err
  87601. }
  87602. req.Header = reqHeaders
  87603. googleapi.Expand(req.URL, map[string]string{
  87604. "project": c.project,
  87605. "zone": c.zone,
  87606. })
  87607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87608. }
  87609. // Do executes the "compute.targetInstances.insert" call.
  87610. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87611. // status code is an error. Response headers are in either
  87612. // *Operation.ServerResponse.Header or (if a response was returned at
  87613. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87614. // to check whether the returned error was because
  87615. // http.StatusNotModified was returned.
  87616. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87617. gensupport.SetOptions(c.urlParams_, opts...)
  87618. res, err := c.doRequest("json")
  87619. if res != nil && res.StatusCode == http.StatusNotModified {
  87620. if res.Body != nil {
  87621. res.Body.Close()
  87622. }
  87623. return nil, &googleapi.Error{
  87624. Code: res.StatusCode,
  87625. Header: res.Header,
  87626. }
  87627. }
  87628. if err != nil {
  87629. return nil, err
  87630. }
  87631. defer googleapi.CloseBody(res)
  87632. if err := googleapi.CheckResponse(res); err != nil {
  87633. return nil, err
  87634. }
  87635. ret := &Operation{
  87636. ServerResponse: googleapi.ServerResponse{
  87637. Header: res.Header,
  87638. HTTPStatusCode: res.StatusCode,
  87639. },
  87640. }
  87641. target := &ret
  87642. if err := gensupport.DecodeResponse(target, res); err != nil {
  87643. return nil, err
  87644. }
  87645. return ret, nil
  87646. // {
  87647. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  87648. // "httpMethod": "POST",
  87649. // "id": "compute.targetInstances.insert",
  87650. // "parameterOrder": [
  87651. // "project",
  87652. // "zone"
  87653. // ],
  87654. // "parameters": {
  87655. // "project": {
  87656. // "description": "Project ID for this request.",
  87657. // "location": "path",
  87658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87659. // "required": true,
  87660. // "type": "string"
  87661. // },
  87662. // "requestId": {
  87663. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87664. // "location": "query",
  87665. // "type": "string"
  87666. // },
  87667. // "zone": {
  87668. // "description": "Name of the zone scoping this request.",
  87669. // "location": "path",
  87670. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87671. // "required": true,
  87672. // "type": "string"
  87673. // }
  87674. // },
  87675. // "path": "{project}/zones/{zone}/targetInstances",
  87676. // "request": {
  87677. // "$ref": "TargetInstance"
  87678. // },
  87679. // "response": {
  87680. // "$ref": "Operation"
  87681. // },
  87682. // "scopes": [
  87683. // "https://www.googleapis.com/auth/cloud-platform",
  87684. // "https://www.googleapis.com/auth/compute"
  87685. // ]
  87686. // }
  87687. }
  87688. // method id "compute.targetInstances.list":
  87689. type TargetInstancesListCall struct {
  87690. s *Service
  87691. project string
  87692. zone string
  87693. urlParams_ gensupport.URLParams
  87694. ifNoneMatch_ string
  87695. ctx_ context.Context
  87696. header_ http.Header
  87697. }
  87698. // List: Retrieves a list of TargetInstance resources available to the
  87699. // specified project and zone.
  87700. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  87701. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  87702. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87703. c.project = project
  87704. c.zone = zone
  87705. return c
  87706. }
  87707. // Filter sets the optional parameter "filter": A filter expression that
  87708. // filters resources listed in the response. The expression must specify
  87709. // the field name, a comparison operator, and the value that you want to
  87710. // use for filtering. The value must be a string, a number, or a
  87711. // boolean. The comparison operator must be either =, !=, >, or <.
  87712. //
  87713. // For example, if you are filtering Compute Engine instances, you can
  87714. // exclude instances named example-instance by specifying name !=
  87715. // example-instance.
  87716. //
  87717. // You can also filter nested fields. For example, you could specify
  87718. // scheduling.automaticRestart = false to include instances only if they
  87719. // are not scheduled for automatic restarts. You can use filtering on
  87720. // nested fields to filter based on resource labels.
  87721. //
  87722. // To filter on multiple expressions, provide each separate expression
  87723. // within parentheses. For example, (scheduling.automaticRestart = true)
  87724. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87725. // AND expression. However, you can include AND and OR expressions
  87726. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87727. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87728. // true).
  87729. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  87730. c.urlParams_.Set("filter", filter)
  87731. return c
  87732. }
  87733. // MaxResults sets the optional parameter "maxResults": The maximum
  87734. // number of results per page that should be returned. If the number of
  87735. // available results is larger than maxResults, Compute Engine returns a
  87736. // nextPageToken that can be used to get the next page of results in
  87737. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87738. // (Default: 500)
  87739. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  87740. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87741. return c
  87742. }
  87743. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87744. // a certain order. By default, results are returned in alphanumerical
  87745. // order based on the resource name.
  87746. //
  87747. // You can also sort results in descending order based on the creation
  87748. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87749. // based on the creationTimestamp field in reverse chronological order
  87750. // (newest result first). Use this to sort resources like operations so
  87751. // that the newest operation is returned first.
  87752. //
  87753. // Currently, only sorting by name or creationTimestamp desc is
  87754. // supported.
  87755. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  87756. c.urlParams_.Set("orderBy", orderBy)
  87757. return c
  87758. }
  87759. // PageToken sets the optional parameter "pageToken": Specifies a page
  87760. // token to use. Set pageToken to the nextPageToken returned by a
  87761. // previous list request to get the next page of results.
  87762. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  87763. c.urlParams_.Set("pageToken", pageToken)
  87764. return c
  87765. }
  87766. // Fields allows partial responses to be retrieved. See
  87767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87768. // for more information.
  87769. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  87770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87771. return c
  87772. }
  87773. // IfNoneMatch sets the optional parameter which makes the operation
  87774. // fail if the object's ETag matches the given value. This is useful for
  87775. // getting updates only after the object has changed since the last
  87776. // request. Use googleapi.IsNotModified to check whether the response
  87777. // error from Do is the result of In-None-Match.
  87778. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  87779. c.ifNoneMatch_ = entityTag
  87780. return c
  87781. }
  87782. // Context sets the context to be used in this call's Do method. Any
  87783. // pending HTTP request will be aborted if the provided context is
  87784. // canceled.
  87785. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  87786. c.ctx_ = ctx
  87787. return c
  87788. }
  87789. // Header returns an http.Header that can be modified by the caller to
  87790. // add HTTP headers to the request.
  87791. func (c *TargetInstancesListCall) Header() http.Header {
  87792. if c.header_ == nil {
  87793. c.header_ = make(http.Header)
  87794. }
  87795. return c.header_
  87796. }
  87797. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  87798. reqHeaders := make(http.Header)
  87799. for k, v := range c.header_ {
  87800. reqHeaders[k] = v
  87801. }
  87802. reqHeaders.Set("User-Agent", c.s.userAgent())
  87803. if c.ifNoneMatch_ != "" {
  87804. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87805. }
  87806. var body io.Reader = nil
  87807. c.urlParams_.Set("alt", alt)
  87808. c.urlParams_.Set("prettyPrint", "false")
  87809. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  87810. urls += "?" + c.urlParams_.Encode()
  87811. req, err := http.NewRequest("GET", urls, body)
  87812. if err != nil {
  87813. return nil, err
  87814. }
  87815. req.Header = reqHeaders
  87816. googleapi.Expand(req.URL, map[string]string{
  87817. "project": c.project,
  87818. "zone": c.zone,
  87819. })
  87820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87821. }
  87822. // Do executes the "compute.targetInstances.list" call.
  87823. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  87824. // non-2xx status code is an error. Response headers are in either
  87825. // *TargetInstanceList.ServerResponse.Header or (if a response was
  87826. // returned at all) in error.(*googleapi.Error).Header. Use
  87827. // googleapi.IsNotModified to check whether the returned error was
  87828. // because http.StatusNotModified was returned.
  87829. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  87830. gensupport.SetOptions(c.urlParams_, opts...)
  87831. res, err := c.doRequest("json")
  87832. if res != nil && res.StatusCode == http.StatusNotModified {
  87833. if res.Body != nil {
  87834. res.Body.Close()
  87835. }
  87836. return nil, &googleapi.Error{
  87837. Code: res.StatusCode,
  87838. Header: res.Header,
  87839. }
  87840. }
  87841. if err != nil {
  87842. return nil, err
  87843. }
  87844. defer googleapi.CloseBody(res)
  87845. if err := googleapi.CheckResponse(res); err != nil {
  87846. return nil, err
  87847. }
  87848. ret := &TargetInstanceList{
  87849. ServerResponse: googleapi.ServerResponse{
  87850. Header: res.Header,
  87851. HTTPStatusCode: res.StatusCode,
  87852. },
  87853. }
  87854. target := &ret
  87855. if err := gensupport.DecodeResponse(target, res); err != nil {
  87856. return nil, err
  87857. }
  87858. return ret, nil
  87859. // {
  87860. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  87861. // "httpMethod": "GET",
  87862. // "id": "compute.targetInstances.list",
  87863. // "parameterOrder": [
  87864. // "project",
  87865. // "zone"
  87866. // ],
  87867. // "parameters": {
  87868. // "filter": {
  87869. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87870. // "location": "query",
  87871. // "type": "string"
  87872. // },
  87873. // "maxResults": {
  87874. // "default": "500",
  87875. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87876. // "format": "uint32",
  87877. // "location": "query",
  87878. // "minimum": "0",
  87879. // "type": "integer"
  87880. // },
  87881. // "orderBy": {
  87882. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87883. // "location": "query",
  87884. // "type": "string"
  87885. // },
  87886. // "pageToken": {
  87887. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87888. // "location": "query",
  87889. // "type": "string"
  87890. // },
  87891. // "project": {
  87892. // "description": "Project ID for this request.",
  87893. // "location": "path",
  87894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87895. // "required": true,
  87896. // "type": "string"
  87897. // },
  87898. // "zone": {
  87899. // "description": "Name of the zone scoping this request.",
  87900. // "location": "path",
  87901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87902. // "required": true,
  87903. // "type": "string"
  87904. // }
  87905. // },
  87906. // "path": "{project}/zones/{zone}/targetInstances",
  87907. // "response": {
  87908. // "$ref": "TargetInstanceList"
  87909. // },
  87910. // "scopes": [
  87911. // "https://www.googleapis.com/auth/cloud-platform",
  87912. // "https://www.googleapis.com/auth/compute",
  87913. // "https://www.googleapis.com/auth/compute.readonly"
  87914. // ]
  87915. // }
  87916. }
  87917. // Pages invokes f for each page of results.
  87918. // A non-nil error returned from f will halt the iteration.
  87919. // The provided context supersedes any context provided to the Context method.
  87920. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  87921. c.ctx_ = ctx
  87922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87923. for {
  87924. x, err := c.Do()
  87925. if err != nil {
  87926. return err
  87927. }
  87928. if err := f(x); err != nil {
  87929. return err
  87930. }
  87931. if x.NextPageToken == "" {
  87932. return nil
  87933. }
  87934. c.PageToken(x.NextPageToken)
  87935. }
  87936. }
  87937. // method id "compute.targetPools.addHealthCheck":
  87938. type TargetPoolsAddHealthCheckCall struct {
  87939. s *Service
  87940. project string
  87941. region string
  87942. targetPool string
  87943. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  87944. urlParams_ gensupport.URLParams
  87945. ctx_ context.Context
  87946. header_ http.Header
  87947. }
  87948. // AddHealthCheck: Adds health check URLs to a target pool.
  87949. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  87950. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  87951. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87952. c.project = project
  87953. c.region = region
  87954. c.targetPool = targetPool
  87955. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  87956. return c
  87957. }
  87958. // RequestId sets the optional parameter "requestId": An optional
  87959. // request ID to identify requests. Specify a unique request ID so that
  87960. // if you must retry your request, the server will know to ignore the
  87961. // request if it has already been completed.
  87962. //
  87963. // For example, consider a situation where you make an initial request
  87964. // and the request times out. If you make the request again with the
  87965. // same request ID, the server can check if original operation with the
  87966. // same request ID was received, and if so, will ignore the second
  87967. // request. This prevents clients from accidentally creating duplicate
  87968. // commitments.
  87969. //
  87970. // The request ID must be a valid UUID with the exception that zero UUID
  87971. // is not supported (00000000-0000-0000-0000-000000000000).
  87972. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  87973. c.urlParams_.Set("requestId", requestId)
  87974. return c
  87975. }
  87976. // Fields allows partial responses to be retrieved. See
  87977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87978. // for more information.
  87979. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  87980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87981. return c
  87982. }
  87983. // Context sets the context to be used in this call's Do method. Any
  87984. // pending HTTP request will be aborted if the provided context is
  87985. // canceled.
  87986. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  87987. c.ctx_ = ctx
  87988. return c
  87989. }
  87990. // Header returns an http.Header that can be modified by the caller to
  87991. // add HTTP headers to the request.
  87992. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  87993. if c.header_ == nil {
  87994. c.header_ = make(http.Header)
  87995. }
  87996. return c.header_
  87997. }
  87998. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  87999. reqHeaders := make(http.Header)
  88000. for k, v := range c.header_ {
  88001. reqHeaders[k] = v
  88002. }
  88003. reqHeaders.Set("User-Agent", c.s.userAgent())
  88004. var body io.Reader = nil
  88005. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  88006. if err != nil {
  88007. return nil, err
  88008. }
  88009. reqHeaders.Set("Content-Type", "application/json")
  88010. c.urlParams_.Set("alt", alt)
  88011. c.urlParams_.Set("prettyPrint", "false")
  88012. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  88013. urls += "?" + c.urlParams_.Encode()
  88014. req, err := http.NewRequest("POST", urls, body)
  88015. if err != nil {
  88016. return nil, err
  88017. }
  88018. req.Header = reqHeaders
  88019. googleapi.Expand(req.URL, map[string]string{
  88020. "project": c.project,
  88021. "region": c.region,
  88022. "targetPool": c.targetPool,
  88023. })
  88024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88025. }
  88026. // Do executes the "compute.targetPools.addHealthCheck" call.
  88027. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88028. // status code is an error. Response headers are in either
  88029. // *Operation.ServerResponse.Header or (if a response was returned at
  88030. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88031. // to check whether the returned error was because
  88032. // http.StatusNotModified was returned.
  88033. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88034. gensupport.SetOptions(c.urlParams_, opts...)
  88035. res, err := c.doRequest("json")
  88036. if res != nil && res.StatusCode == http.StatusNotModified {
  88037. if res.Body != nil {
  88038. res.Body.Close()
  88039. }
  88040. return nil, &googleapi.Error{
  88041. Code: res.StatusCode,
  88042. Header: res.Header,
  88043. }
  88044. }
  88045. if err != nil {
  88046. return nil, err
  88047. }
  88048. defer googleapi.CloseBody(res)
  88049. if err := googleapi.CheckResponse(res); err != nil {
  88050. return nil, err
  88051. }
  88052. ret := &Operation{
  88053. ServerResponse: googleapi.ServerResponse{
  88054. Header: res.Header,
  88055. HTTPStatusCode: res.StatusCode,
  88056. },
  88057. }
  88058. target := &ret
  88059. if err := gensupport.DecodeResponse(target, res); err != nil {
  88060. return nil, err
  88061. }
  88062. return ret, nil
  88063. // {
  88064. // "description": "Adds health check URLs to a target pool.",
  88065. // "httpMethod": "POST",
  88066. // "id": "compute.targetPools.addHealthCheck",
  88067. // "parameterOrder": [
  88068. // "project",
  88069. // "region",
  88070. // "targetPool"
  88071. // ],
  88072. // "parameters": {
  88073. // "project": {
  88074. // "description": "Project ID for this request.",
  88075. // "location": "path",
  88076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88077. // "required": true,
  88078. // "type": "string"
  88079. // },
  88080. // "region": {
  88081. // "description": "Name of the region scoping this request.",
  88082. // "location": "path",
  88083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88084. // "required": true,
  88085. // "type": "string"
  88086. // },
  88087. // "requestId": {
  88088. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88089. // "location": "query",
  88090. // "type": "string"
  88091. // },
  88092. // "targetPool": {
  88093. // "description": "Name of the target pool to add a health check to.",
  88094. // "location": "path",
  88095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88096. // "required": true,
  88097. // "type": "string"
  88098. // }
  88099. // },
  88100. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  88101. // "request": {
  88102. // "$ref": "TargetPoolsAddHealthCheckRequest"
  88103. // },
  88104. // "response": {
  88105. // "$ref": "Operation"
  88106. // },
  88107. // "scopes": [
  88108. // "https://www.googleapis.com/auth/cloud-platform",
  88109. // "https://www.googleapis.com/auth/compute"
  88110. // ]
  88111. // }
  88112. }
  88113. // method id "compute.targetPools.addInstance":
  88114. type TargetPoolsAddInstanceCall struct {
  88115. s *Service
  88116. project string
  88117. region string
  88118. targetPool string
  88119. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  88120. urlParams_ gensupport.URLParams
  88121. ctx_ context.Context
  88122. header_ http.Header
  88123. }
  88124. // AddInstance: Adds an instance to a target pool.
  88125. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  88126. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  88127. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88128. c.project = project
  88129. c.region = region
  88130. c.targetPool = targetPool
  88131. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  88132. return c
  88133. }
  88134. // RequestId sets the optional parameter "requestId": An optional
  88135. // request ID to identify requests. Specify a unique request ID so that
  88136. // if you must retry your request, the server will know to ignore the
  88137. // request if it has already been completed.
  88138. //
  88139. // For example, consider a situation where you make an initial request
  88140. // and the request times out. If you make the request again with the
  88141. // same request ID, the server can check if original operation with the
  88142. // same request ID was received, and if so, will ignore the second
  88143. // request. This prevents clients from accidentally creating duplicate
  88144. // commitments.
  88145. //
  88146. // The request ID must be a valid UUID with the exception that zero UUID
  88147. // is not supported (00000000-0000-0000-0000-000000000000).
  88148. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  88149. c.urlParams_.Set("requestId", requestId)
  88150. return c
  88151. }
  88152. // Fields allows partial responses to be retrieved. See
  88153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88154. // for more information.
  88155. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  88156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88157. return c
  88158. }
  88159. // Context sets the context to be used in this call's Do method. Any
  88160. // pending HTTP request will be aborted if the provided context is
  88161. // canceled.
  88162. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  88163. c.ctx_ = ctx
  88164. return c
  88165. }
  88166. // Header returns an http.Header that can be modified by the caller to
  88167. // add HTTP headers to the request.
  88168. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  88169. if c.header_ == nil {
  88170. c.header_ = make(http.Header)
  88171. }
  88172. return c.header_
  88173. }
  88174. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  88175. reqHeaders := make(http.Header)
  88176. for k, v := range c.header_ {
  88177. reqHeaders[k] = v
  88178. }
  88179. reqHeaders.Set("User-Agent", c.s.userAgent())
  88180. var body io.Reader = nil
  88181. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  88182. if err != nil {
  88183. return nil, err
  88184. }
  88185. reqHeaders.Set("Content-Type", "application/json")
  88186. c.urlParams_.Set("alt", alt)
  88187. c.urlParams_.Set("prettyPrint", "false")
  88188. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  88189. urls += "?" + c.urlParams_.Encode()
  88190. req, err := http.NewRequest("POST", urls, body)
  88191. if err != nil {
  88192. return nil, err
  88193. }
  88194. req.Header = reqHeaders
  88195. googleapi.Expand(req.URL, map[string]string{
  88196. "project": c.project,
  88197. "region": c.region,
  88198. "targetPool": c.targetPool,
  88199. })
  88200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88201. }
  88202. // Do executes the "compute.targetPools.addInstance" call.
  88203. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88204. // status code is an error. Response headers are in either
  88205. // *Operation.ServerResponse.Header or (if a response was returned at
  88206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88207. // to check whether the returned error was because
  88208. // http.StatusNotModified was returned.
  88209. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88210. gensupport.SetOptions(c.urlParams_, opts...)
  88211. res, err := c.doRequest("json")
  88212. if res != nil && res.StatusCode == http.StatusNotModified {
  88213. if res.Body != nil {
  88214. res.Body.Close()
  88215. }
  88216. return nil, &googleapi.Error{
  88217. Code: res.StatusCode,
  88218. Header: res.Header,
  88219. }
  88220. }
  88221. if err != nil {
  88222. return nil, err
  88223. }
  88224. defer googleapi.CloseBody(res)
  88225. if err := googleapi.CheckResponse(res); err != nil {
  88226. return nil, err
  88227. }
  88228. ret := &Operation{
  88229. ServerResponse: googleapi.ServerResponse{
  88230. Header: res.Header,
  88231. HTTPStatusCode: res.StatusCode,
  88232. },
  88233. }
  88234. target := &ret
  88235. if err := gensupport.DecodeResponse(target, res); err != nil {
  88236. return nil, err
  88237. }
  88238. return ret, nil
  88239. // {
  88240. // "description": "Adds an instance to a target pool.",
  88241. // "httpMethod": "POST",
  88242. // "id": "compute.targetPools.addInstance",
  88243. // "parameterOrder": [
  88244. // "project",
  88245. // "region",
  88246. // "targetPool"
  88247. // ],
  88248. // "parameters": {
  88249. // "project": {
  88250. // "description": "Project ID for this request.",
  88251. // "location": "path",
  88252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88253. // "required": true,
  88254. // "type": "string"
  88255. // },
  88256. // "region": {
  88257. // "description": "Name of the region scoping this request.",
  88258. // "location": "path",
  88259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88260. // "required": true,
  88261. // "type": "string"
  88262. // },
  88263. // "requestId": {
  88264. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88265. // "location": "query",
  88266. // "type": "string"
  88267. // },
  88268. // "targetPool": {
  88269. // "description": "Name of the TargetPool resource to add instances to.",
  88270. // "location": "path",
  88271. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88272. // "required": true,
  88273. // "type": "string"
  88274. // }
  88275. // },
  88276. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  88277. // "request": {
  88278. // "$ref": "TargetPoolsAddInstanceRequest"
  88279. // },
  88280. // "response": {
  88281. // "$ref": "Operation"
  88282. // },
  88283. // "scopes": [
  88284. // "https://www.googleapis.com/auth/cloud-platform",
  88285. // "https://www.googleapis.com/auth/compute"
  88286. // ]
  88287. // }
  88288. }
  88289. // method id "compute.targetPools.aggregatedList":
  88290. type TargetPoolsAggregatedListCall struct {
  88291. s *Service
  88292. project string
  88293. urlParams_ gensupport.URLParams
  88294. ifNoneMatch_ string
  88295. ctx_ context.Context
  88296. header_ http.Header
  88297. }
  88298. // AggregatedList: Retrieves an aggregated list of target pools.
  88299. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  88300. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  88301. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88302. c.project = project
  88303. return c
  88304. }
  88305. // Filter sets the optional parameter "filter": A filter expression that
  88306. // filters resources listed in the response. The expression must specify
  88307. // the field name, a comparison operator, and the value that you want to
  88308. // use for filtering. The value must be a string, a number, or a
  88309. // boolean. The comparison operator must be either =, !=, >, or <.
  88310. //
  88311. // For example, if you are filtering Compute Engine instances, you can
  88312. // exclude instances named example-instance by specifying name !=
  88313. // example-instance.
  88314. //
  88315. // You can also filter nested fields. For example, you could specify
  88316. // scheduling.automaticRestart = false to include instances only if they
  88317. // are not scheduled for automatic restarts. You can use filtering on
  88318. // nested fields to filter based on resource labels.
  88319. //
  88320. // To filter on multiple expressions, provide each separate expression
  88321. // within parentheses. For example, (scheduling.automaticRestart = true)
  88322. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88323. // AND expression. However, you can include AND and OR expressions
  88324. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88325. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88326. // true).
  88327. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  88328. c.urlParams_.Set("filter", filter)
  88329. return c
  88330. }
  88331. // MaxResults sets the optional parameter "maxResults": The maximum
  88332. // number of results per page that should be returned. If the number of
  88333. // available results is larger than maxResults, Compute Engine returns a
  88334. // nextPageToken that can be used to get the next page of results in
  88335. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88336. // (Default: 500)
  88337. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  88338. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88339. return c
  88340. }
  88341. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88342. // a certain order. By default, results are returned in alphanumerical
  88343. // order based on the resource name.
  88344. //
  88345. // You can also sort results in descending order based on the creation
  88346. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88347. // based on the creationTimestamp field in reverse chronological order
  88348. // (newest result first). Use this to sort resources like operations so
  88349. // that the newest operation is returned first.
  88350. //
  88351. // Currently, only sorting by name or creationTimestamp desc is
  88352. // supported.
  88353. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  88354. c.urlParams_.Set("orderBy", orderBy)
  88355. return c
  88356. }
  88357. // PageToken sets the optional parameter "pageToken": Specifies a page
  88358. // token to use. Set pageToken to the nextPageToken returned by a
  88359. // previous list request to get the next page of results.
  88360. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  88361. c.urlParams_.Set("pageToken", pageToken)
  88362. return c
  88363. }
  88364. // Fields allows partial responses to be retrieved. See
  88365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88366. // for more information.
  88367. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  88368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88369. return c
  88370. }
  88371. // IfNoneMatch sets the optional parameter which makes the operation
  88372. // fail if the object's ETag matches the given value. This is useful for
  88373. // getting updates only after the object has changed since the last
  88374. // request. Use googleapi.IsNotModified to check whether the response
  88375. // error from Do is the result of In-None-Match.
  88376. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  88377. c.ifNoneMatch_ = entityTag
  88378. return c
  88379. }
  88380. // Context sets the context to be used in this call's Do method. Any
  88381. // pending HTTP request will be aborted if the provided context is
  88382. // canceled.
  88383. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  88384. c.ctx_ = ctx
  88385. return c
  88386. }
  88387. // Header returns an http.Header that can be modified by the caller to
  88388. // add HTTP headers to the request.
  88389. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  88390. if c.header_ == nil {
  88391. c.header_ = make(http.Header)
  88392. }
  88393. return c.header_
  88394. }
  88395. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  88396. reqHeaders := make(http.Header)
  88397. for k, v := range c.header_ {
  88398. reqHeaders[k] = v
  88399. }
  88400. reqHeaders.Set("User-Agent", c.s.userAgent())
  88401. if c.ifNoneMatch_ != "" {
  88402. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88403. }
  88404. var body io.Reader = nil
  88405. c.urlParams_.Set("alt", alt)
  88406. c.urlParams_.Set("prettyPrint", "false")
  88407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  88408. urls += "?" + c.urlParams_.Encode()
  88409. req, err := http.NewRequest("GET", urls, body)
  88410. if err != nil {
  88411. return nil, err
  88412. }
  88413. req.Header = reqHeaders
  88414. googleapi.Expand(req.URL, map[string]string{
  88415. "project": c.project,
  88416. })
  88417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88418. }
  88419. // Do executes the "compute.targetPools.aggregatedList" call.
  88420. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  88421. // Any non-2xx status code is an error. Response headers are in either
  88422. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  88423. // returned at all) in error.(*googleapi.Error).Header. Use
  88424. // googleapi.IsNotModified to check whether the returned error was
  88425. // because http.StatusNotModified was returned.
  88426. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  88427. gensupport.SetOptions(c.urlParams_, opts...)
  88428. res, err := c.doRequest("json")
  88429. if res != nil && res.StatusCode == http.StatusNotModified {
  88430. if res.Body != nil {
  88431. res.Body.Close()
  88432. }
  88433. return nil, &googleapi.Error{
  88434. Code: res.StatusCode,
  88435. Header: res.Header,
  88436. }
  88437. }
  88438. if err != nil {
  88439. return nil, err
  88440. }
  88441. defer googleapi.CloseBody(res)
  88442. if err := googleapi.CheckResponse(res); err != nil {
  88443. return nil, err
  88444. }
  88445. ret := &TargetPoolAggregatedList{
  88446. ServerResponse: googleapi.ServerResponse{
  88447. Header: res.Header,
  88448. HTTPStatusCode: res.StatusCode,
  88449. },
  88450. }
  88451. target := &ret
  88452. if err := gensupport.DecodeResponse(target, res); err != nil {
  88453. return nil, err
  88454. }
  88455. return ret, nil
  88456. // {
  88457. // "description": "Retrieves an aggregated list of target pools.",
  88458. // "httpMethod": "GET",
  88459. // "id": "compute.targetPools.aggregatedList",
  88460. // "parameterOrder": [
  88461. // "project"
  88462. // ],
  88463. // "parameters": {
  88464. // "filter": {
  88465. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88466. // "location": "query",
  88467. // "type": "string"
  88468. // },
  88469. // "maxResults": {
  88470. // "default": "500",
  88471. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88472. // "format": "uint32",
  88473. // "location": "query",
  88474. // "minimum": "0",
  88475. // "type": "integer"
  88476. // },
  88477. // "orderBy": {
  88478. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88479. // "location": "query",
  88480. // "type": "string"
  88481. // },
  88482. // "pageToken": {
  88483. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88484. // "location": "query",
  88485. // "type": "string"
  88486. // },
  88487. // "project": {
  88488. // "description": "Project ID for this request.",
  88489. // "location": "path",
  88490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88491. // "required": true,
  88492. // "type": "string"
  88493. // }
  88494. // },
  88495. // "path": "{project}/aggregated/targetPools",
  88496. // "response": {
  88497. // "$ref": "TargetPoolAggregatedList"
  88498. // },
  88499. // "scopes": [
  88500. // "https://www.googleapis.com/auth/cloud-platform",
  88501. // "https://www.googleapis.com/auth/compute",
  88502. // "https://www.googleapis.com/auth/compute.readonly"
  88503. // ]
  88504. // }
  88505. }
  88506. // Pages invokes f for each page of results.
  88507. // A non-nil error returned from f will halt the iteration.
  88508. // The provided context supersedes any context provided to the Context method.
  88509. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  88510. c.ctx_ = ctx
  88511. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88512. for {
  88513. x, err := c.Do()
  88514. if err != nil {
  88515. return err
  88516. }
  88517. if err := f(x); err != nil {
  88518. return err
  88519. }
  88520. if x.NextPageToken == "" {
  88521. return nil
  88522. }
  88523. c.PageToken(x.NextPageToken)
  88524. }
  88525. }
  88526. // method id "compute.targetPools.delete":
  88527. type TargetPoolsDeleteCall struct {
  88528. s *Service
  88529. project string
  88530. region string
  88531. targetPool string
  88532. urlParams_ gensupport.URLParams
  88533. ctx_ context.Context
  88534. header_ http.Header
  88535. }
  88536. // Delete: Deletes the specified target pool.
  88537. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  88538. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  88539. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88540. c.project = project
  88541. c.region = region
  88542. c.targetPool = targetPool
  88543. return c
  88544. }
  88545. // RequestId sets the optional parameter "requestId": An optional
  88546. // request ID to identify requests. Specify a unique request ID so that
  88547. // if you must retry your request, the server will know to ignore the
  88548. // request if it has already been completed.
  88549. //
  88550. // For example, consider a situation where you make an initial request
  88551. // and the request times out. If you make the request again with the
  88552. // same request ID, the server can check if original operation with the
  88553. // same request ID was received, and if so, will ignore the second
  88554. // request. This prevents clients from accidentally creating duplicate
  88555. // commitments.
  88556. //
  88557. // The request ID must be a valid UUID with the exception that zero UUID
  88558. // is not supported (00000000-0000-0000-0000-000000000000).
  88559. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  88560. c.urlParams_.Set("requestId", requestId)
  88561. return c
  88562. }
  88563. // Fields allows partial responses to be retrieved. See
  88564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88565. // for more information.
  88566. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  88567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88568. return c
  88569. }
  88570. // Context sets the context to be used in this call's Do method. Any
  88571. // pending HTTP request will be aborted if the provided context is
  88572. // canceled.
  88573. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  88574. c.ctx_ = ctx
  88575. return c
  88576. }
  88577. // Header returns an http.Header that can be modified by the caller to
  88578. // add HTTP headers to the request.
  88579. func (c *TargetPoolsDeleteCall) Header() http.Header {
  88580. if c.header_ == nil {
  88581. c.header_ = make(http.Header)
  88582. }
  88583. return c.header_
  88584. }
  88585. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  88586. reqHeaders := make(http.Header)
  88587. for k, v := range c.header_ {
  88588. reqHeaders[k] = v
  88589. }
  88590. reqHeaders.Set("User-Agent", c.s.userAgent())
  88591. var body io.Reader = nil
  88592. c.urlParams_.Set("alt", alt)
  88593. c.urlParams_.Set("prettyPrint", "false")
  88594. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  88595. urls += "?" + c.urlParams_.Encode()
  88596. req, err := http.NewRequest("DELETE", urls, body)
  88597. if err != nil {
  88598. return nil, err
  88599. }
  88600. req.Header = reqHeaders
  88601. googleapi.Expand(req.URL, map[string]string{
  88602. "project": c.project,
  88603. "region": c.region,
  88604. "targetPool": c.targetPool,
  88605. })
  88606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88607. }
  88608. // Do executes the "compute.targetPools.delete" call.
  88609. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88610. // status code is an error. Response headers are in either
  88611. // *Operation.ServerResponse.Header or (if a response was returned at
  88612. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88613. // to check whether the returned error was because
  88614. // http.StatusNotModified was returned.
  88615. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88616. gensupport.SetOptions(c.urlParams_, opts...)
  88617. res, err := c.doRequest("json")
  88618. if res != nil && res.StatusCode == http.StatusNotModified {
  88619. if res.Body != nil {
  88620. res.Body.Close()
  88621. }
  88622. return nil, &googleapi.Error{
  88623. Code: res.StatusCode,
  88624. Header: res.Header,
  88625. }
  88626. }
  88627. if err != nil {
  88628. return nil, err
  88629. }
  88630. defer googleapi.CloseBody(res)
  88631. if err := googleapi.CheckResponse(res); err != nil {
  88632. return nil, err
  88633. }
  88634. ret := &Operation{
  88635. ServerResponse: googleapi.ServerResponse{
  88636. Header: res.Header,
  88637. HTTPStatusCode: res.StatusCode,
  88638. },
  88639. }
  88640. target := &ret
  88641. if err := gensupport.DecodeResponse(target, res); err != nil {
  88642. return nil, err
  88643. }
  88644. return ret, nil
  88645. // {
  88646. // "description": "Deletes the specified target pool.",
  88647. // "httpMethod": "DELETE",
  88648. // "id": "compute.targetPools.delete",
  88649. // "parameterOrder": [
  88650. // "project",
  88651. // "region",
  88652. // "targetPool"
  88653. // ],
  88654. // "parameters": {
  88655. // "project": {
  88656. // "description": "Project ID for this request.",
  88657. // "location": "path",
  88658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88659. // "required": true,
  88660. // "type": "string"
  88661. // },
  88662. // "region": {
  88663. // "description": "Name of the region scoping this request.",
  88664. // "location": "path",
  88665. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88666. // "required": true,
  88667. // "type": "string"
  88668. // },
  88669. // "requestId": {
  88670. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88671. // "location": "query",
  88672. // "type": "string"
  88673. // },
  88674. // "targetPool": {
  88675. // "description": "Name of the TargetPool resource to delete.",
  88676. // "location": "path",
  88677. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88678. // "required": true,
  88679. // "type": "string"
  88680. // }
  88681. // },
  88682. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  88683. // "response": {
  88684. // "$ref": "Operation"
  88685. // },
  88686. // "scopes": [
  88687. // "https://www.googleapis.com/auth/cloud-platform",
  88688. // "https://www.googleapis.com/auth/compute"
  88689. // ]
  88690. // }
  88691. }
  88692. // method id "compute.targetPools.get":
  88693. type TargetPoolsGetCall struct {
  88694. s *Service
  88695. project string
  88696. region string
  88697. targetPool string
  88698. urlParams_ gensupport.URLParams
  88699. ifNoneMatch_ string
  88700. ctx_ context.Context
  88701. header_ http.Header
  88702. }
  88703. // Get: Returns the specified target pool. Gets a list of available
  88704. // target pools by making a list() request.
  88705. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  88706. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  88707. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88708. c.project = project
  88709. c.region = region
  88710. c.targetPool = targetPool
  88711. return c
  88712. }
  88713. // Fields allows partial responses to be retrieved. See
  88714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88715. // for more information.
  88716. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  88717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88718. return c
  88719. }
  88720. // IfNoneMatch sets the optional parameter which makes the operation
  88721. // fail if the object's ETag matches the given value. This is useful for
  88722. // getting updates only after the object has changed since the last
  88723. // request. Use googleapi.IsNotModified to check whether the response
  88724. // error from Do is the result of In-None-Match.
  88725. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  88726. c.ifNoneMatch_ = entityTag
  88727. return c
  88728. }
  88729. // Context sets the context to be used in this call's Do method. Any
  88730. // pending HTTP request will be aborted if the provided context is
  88731. // canceled.
  88732. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  88733. c.ctx_ = ctx
  88734. return c
  88735. }
  88736. // Header returns an http.Header that can be modified by the caller to
  88737. // add HTTP headers to the request.
  88738. func (c *TargetPoolsGetCall) Header() http.Header {
  88739. if c.header_ == nil {
  88740. c.header_ = make(http.Header)
  88741. }
  88742. return c.header_
  88743. }
  88744. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  88745. reqHeaders := make(http.Header)
  88746. for k, v := range c.header_ {
  88747. reqHeaders[k] = v
  88748. }
  88749. reqHeaders.Set("User-Agent", c.s.userAgent())
  88750. if c.ifNoneMatch_ != "" {
  88751. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88752. }
  88753. var body io.Reader = nil
  88754. c.urlParams_.Set("alt", alt)
  88755. c.urlParams_.Set("prettyPrint", "false")
  88756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  88757. urls += "?" + c.urlParams_.Encode()
  88758. req, err := http.NewRequest("GET", urls, body)
  88759. if err != nil {
  88760. return nil, err
  88761. }
  88762. req.Header = reqHeaders
  88763. googleapi.Expand(req.URL, map[string]string{
  88764. "project": c.project,
  88765. "region": c.region,
  88766. "targetPool": c.targetPool,
  88767. })
  88768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88769. }
  88770. // Do executes the "compute.targetPools.get" call.
  88771. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  88772. // status code is an error. Response headers are in either
  88773. // *TargetPool.ServerResponse.Header or (if a response was returned at
  88774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88775. // to check whether the returned error was because
  88776. // http.StatusNotModified was returned.
  88777. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  88778. gensupport.SetOptions(c.urlParams_, opts...)
  88779. res, err := c.doRequest("json")
  88780. if res != nil && res.StatusCode == http.StatusNotModified {
  88781. if res.Body != nil {
  88782. res.Body.Close()
  88783. }
  88784. return nil, &googleapi.Error{
  88785. Code: res.StatusCode,
  88786. Header: res.Header,
  88787. }
  88788. }
  88789. if err != nil {
  88790. return nil, err
  88791. }
  88792. defer googleapi.CloseBody(res)
  88793. if err := googleapi.CheckResponse(res); err != nil {
  88794. return nil, err
  88795. }
  88796. ret := &TargetPool{
  88797. ServerResponse: googleapi.ServerResponse{
  88798. Header: res.Header,
  88799. HTTPStatusCode: res.StatusCode,
  88800. },
  88801. }
  88802. target := &ret
  88803. if err := gensupport.DecodeResponse(target, res); err != nil {
  88804. return nil, err
  88805. }
  88806. return ret, nil
  88807. // {
  88808. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  88809. // "httpMethod": "GET",
  88810. // "id": "compute.targetPools.get",
  88811. // "parameterOrder": [
  88812. // "project",
  88813. // "region",
  88814. // "targetPool"
  88815. // ],
  88816. // "parameters": {
  88817. // "project": {
  88818. // "description": "Project ID for this request.",
  88819. // "location": "path",
  88820. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88821. // "required": true,
  88822. // "type": "string"
  88823. // },
  88824. // "region": {
  88825. // "description": "Name of the region scoping this request.",
  88826. // "location": "path",
  88827. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88828. // "required": true,
  88829. // "type": "string"
  88830. // },
  88831. // "targetPool": {
  88832. // "description": "Name of the TargetPool resource to return.",
  88833. // "location": "path",
  88834. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88835. // "required": true,
  88836. // "type": "string"
  88837. // }
  88838. // },
  88839. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  88840. // "response": {
  88841. // "$ref": "TargetPool"
  88842. // },
  88843. // "scopes": [
  88844. // "https://www.googleapis.com/auth/cloud-platform",
  88845. // "https://www.googleapis.com/auth/compute",
  88846. // "https://www.googleapis.com/auth/compute.readonly"
  88847. // ]
  88848. // }
  88849. }
  88850. // method id "compute.targetPools.getHealth":
  88851. type TargetPoolsGetHealthCall struct {
  88852. s *Service
  88853. project string
  88854. region string
  88855. targetPool string
  88856. instancereference *InstanceReference
  88857. urlParams_ gensupport.URLParams
  88858. ctx_ context.Context
  88859. header_ http.Header
  88860. }
  88861. // GetHealth: Gets the most recent health check results for each IP for
  88862. // the instance that is referenced by the given target pool.
  88863. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  88864. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  88865. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88866. c.project = project
  88867. c.region = region
  88868. c.targetPool = targetPool
  88869. c.instancereference = instancereference
  88870. return c
  88871. }
  88872. // Fields allows partial responses to be retrieved. See
  88873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88874. // for more information.
  88875. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  88876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88877. return c
  88878. }
  88879. // Context sets the context to be used in this call's Do method. Any
  88880. // pending HTTP request will be aborted if the provided context is
  88881. // canceled.
  88882. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  88883. c.ctx_ = ctx
  88884. return c
  88885. }
  88886. // Header returns an http.Header that can be modified by the caller to
  88887. // add HTTP headers to the request.
  88888. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  88889. if c.header_ == nil {
  88890. c.header_ = make(http.Header)
  88891. }
  88892. return c.header_
  88893. }
  88894. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  88895. reqHeaders := make(http.Header)
  88896. for k, v := range c.header_ {
  88897. reqHeaders[k] = v
  88898. }
  88899. reqHeaders.Set("User-Agent", c.s.userAgent())
  88900. var body io.Reader = nil
  88901. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  88902. if err != nil {
  88903. return nil, err
  88904. }
  88905. reqHeaders.Set("Content-Type", "application/json")
  88906. c.urlParams_.Set("alt", alt)
  88907. c.urlParams_.Set("prettyPrint", "false")
  88908. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  88909. urls += "?" + c.urlParams_.Encode()
  88910. req, err := http.NewRequest("POST", urls, body)
  88911. if err != nil {
  88912. return nil, err
  88913. }
  88914. req.Header = reqHeaders
  88915. googleapi.Expand(req.URL, map[string]string{
  88916. "project": c.project,
  88917. "region": c.region,
  88918. "targetPool": c.targetPool,
  88919. })
  88920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88921. }
  88922. // Do executes the "compute.targetPools.getHealth" call.
  88923. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  88924. // Any non-2xx status code is an error. Response headers are in either
  88925. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  88926. // returned at all) in error.(*googleapi.Error).Header. Use
  88927. // googleapi.IsNotModified to check whether the returned error was
  88928. // because http.StatusNotModified was returned.
  88929. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  88930. gensupport.SetOptions(c.urlParams_, opts...)
  88931. res, err := c.doRequest("json")
  88932. if res != nil && res.StatusCode == http.StatusNotModified {
  88933. if res.Body != nil {
  88934. res.Body.Close()
  88935. }
  88936. return nil, &googleapi.Error{
  88937. Code: res.StatusCode,
  88938. Header: res.Header,
  88939. }
  88940. }
  88941. if err != nil {
  88942. return nil, err
  88943. }
  88944. defer googleapi.CloseBody(res)
  88945. if err := googleapi.CheckResponse(res); err != nil {
  88946. return nil, err
  88947. }
  88948. ret := &TargetPoolInstanceHealth{
  88949. ServerResponse: googleapi.ServerResponse{
  88950. Header: res.Header,
  88951. HTTPStatusCode: res.StatusCode,
  88952. },
  88953. }
  88954. target := &ret
  88955. if err := gensupport.DecodeResponse(target, res); err != nil {
  88956. return nil, err
  88957. }
  88958. return ret, nil
  88959. // {
  88960. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  88961. // "httpMethod": "POST",
  88962. // "id": "compute.targetPools.getHealth",
  88963. // "parameterOrder": [
  88964. // "project",
  88965. // "region",
  88966. // "targetPool"
  88967. // ],
  88968. // "parameters": {
  88969. // "project": {
  88970. // "description": "Project ID for this request.",
  88971. // "location": "path",
  88972. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88973. // "required": true,
  88974. // "type": "string"
  88975. // },
  88976. // "region": {
  88977. // "description": "Name of the region scoping this request.",
  88978. // "location": "path",
  88979. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88980. // "required": true,
  88981. // "type": "string"
  88982. // },
  88983. // "targetPool": {
  88984. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  88985. // "location": "path",
  88986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88987. // "required": true,
  88988. // "type": "string"
  88989. // }
  88990. // },
  88991. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  88992. // "request": {
  88993. // "$ref": "InstanceReference"
  88994. // },
  88995. // "response": {
  88996. // "$ref": "TargetPoolInstanceHealth"
  88997. // },
  88998. // "scopes": [
  88999. // "https://www.googleapis.com/auth/cloud-platform",
  89000. // "https://www.googleapis.com/auth/compute",
  89001. // "https://www.googleapis.com/auth/compute.readonly"
  89002. // ]
  89003. // }
  89004. }
  89005. // method id "compute.targetPools.insert":
  89006. type TargetPoolsInsertCall struct {
  89007. s *Service
  89008. project string
  89009. region string
  89010. targetpool *TargetPool
  89011. urlParams_ gensupport.URLParams
  89012. ctx_ context.Context
  89013. header_ http.Header
  89014. }
  89015. // Insert: Creates a target pool in the specified project and region
  89016. // using the data included in the request.
  89017. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  89018. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  89019. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89020. c.project = project
  89021. c.region = region
  89022. c.targetpool = targetpool
  89023. return c
  89024. }
  89025. // RequestId sets the optional parameter "requestId": An optional
  89026. // request ID to identify requests. Specify a unique request ID so that
  89027. // if you must retry your request, the server will know to ignore the
  89028. // request if it has already been completed.
  89029. //
  89030. // For example, consider a situation where you make an initial request
  89031. // and the request times out. If you make the request again with the
  89032. // same request ID, the server can check if original operation with the
  89033. // same request ID was received, and if so, will ignore the second
  89034. // request. This prevents clients from accidentally creating duplicate
  89035. // commitments.
  89036. //
  89037. // The request ID must be a valid UUID with the exception that zero UUID
  89038. // is not supported (00000000-0000-0000-0000-000000000000).
  89039. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  89040. c.urlParams_.Set("requestId", requestId)
  89041. return c
  89042. }
  89043. // Fields allows partial responses to be retrieved. See
  89044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89045. // for more information.
  89046. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  89047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89048. return c
  89049. }
  89050. // Context sets the context to be used in this call's Do method. Any
  89051. // pending HTTP request will be aborted if the provided context is
  89052. // canceled.
  89053. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  89054. c.ctx_ = ctx
  89055. return c
  89056. }
  89057. // Header returns an http.Header that can be modified by the caller to
  89058. // add HTTP headers to the request.
  89059. func (c *TargetPoolsInsertCall) Header() http.Header {
  89060. if c.header_ == nil {
  89061. c.header_ = make(http.Header)
  89062. }
  89063. return c.header_
  89064. }
  89065. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  89066. reqHeaders := make(http.Header)
  89067. for k, v := range c.header_ {
  89068. reqHeaders[k] = v
  89069. }
  89070. reqHeaders.Set("User-Agent", c.s.userAgent())
  89071. var body io.Reader = nil
  89072. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  89073. if err != nil {
  89074. return nil, err
  89075. }
  89076. reqHeaders.Set("Content-Type", "application/json")
  89077. c.urlParams_.Set("alt", alt)
  89078. c.urlParams_.Set("prettyPrint", "false")
  89079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  89080. urls += "?" + c.urlParams_.Encode()
  89081. req, err := http.NewRequest("POST", urls, body)
  89082. if err != nil {
  89083. return nil, err
  89084. }
  89085. req.Header = reqHeaders
  89086. googleapi.Expand(req.URL, map[string]string{
  89087. "project": c.project,
  89088. "region": c.region,
  89089. })
  89090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89091. }
  89092. // Do executes the "compute.targetPools.insert" call.
  89093. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89094. // status code is an error. Response headers are in either
  89095. // *Operation.ServerResponse.Header or (if a response was returned at
  89096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89097. // to check whether the returned error was because
  89098. // http.StatusNotModified was returned.
  89099. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89100. gensupport.SetOptions(c.urlParams_, opts...)
  89101. res, err := c.doRequest("json")
  89102. if res != nil && res.StatusCode == http.StatusNotModified {
  89103. if res.Body != nil {
  89104. res.Body.Close()
  89105. }
  89106. return nil, &googleapi.Error{
  89107. Code: res.StatusCode,
  89108. Header: res.Header,
  89109. }
  89110. }
  89111. if err != nil {
  89112. return nil, err
  89113. }
  89114. defer googleapi.CloseBody(res)
  89115. if err := googleapi.CheckResponse(res); err != nil {
  89116. return nil, err
  89117. }
  89118. ret := &Operation{
  89119. ServerResponse: googleapi.ServerResponse{
  89120. Header: res.Header,
  89121. HTTPStatusCode: res.StatusCode,
  89122. },
  89123. }
  89124. target := &ret
  89125. if err := gensupport.DecodeResponse(target, res); err != nil {
  89126. return nil, err
  89127. }
  89128. return ret, nil
  89129. // {
  89130. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  89131. // "httpMethod": "POST",
  89132. // "id": "compute.targetPools.insert",
  89133. // "parameterOrder": [
  89134. // "project",
  89135. // "region"
  89136. // ],
  89137. // "parameters": {
  89138. // "project": {
  89139. // "description": "Project ID for this request.",
  89140. // "location": "path",
  89141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89142. // "required": true,
  89143. // "type": "string"
  89144. // },
  89145. // "region": {
  89146. // "description": "Name of the region scoping this request.",
  89147. // "location": "path",
  89148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89149. // "required": true,
  89150. // "type": "string"
  89151. // },
  89152. // "requestId": {
  89153. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89154. // "location": "query",
  89155. // "type": "string"
  89156. // }
  89157. // },
  89158. // "path": "{project}/regions/{region}/targetPools",
  89159. // "request": {
  89160. // "$ref": "TargetPool"
  89161. // },
  89162. // "response": {
  89163. // "$ref": "Operation"
  89164. // },
  89165. // "scopes": [
  89166. // "https://www.googleapis.com/auth/cloud-platform",
  89167. // "https://www.googleapis.com/auth/compute"
  89168. // ]
  89169. // }
  89170. }
  89171. // method id "compute.targetPools.list":
  89172. type TargetPoolsListCall struct {
  89173. s *Service
  89174. project string
  89175. region string
  89176. urlParams_ gensupport.URLParams
  89177. ifNoneMatch_ string
  89178. ctx_ context.Context
  89179. header_ http.Header
  89180. }
  89181. // List: Retrieves a list of target pools available to the specified
  89182. // project and region.
  89183. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  89184. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  89185. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89186. c.project = project
  89187. c.region = region
  89188. return c
  89189. }
  89190. // Filter sets the optional parameter "filter": A filter expression that
  89191. // filters resources listed in the response. The expression must specify
  89192. // the field name, a comparison operator, and the value that you want to
  89193. // use for filtering. The value must be a string, a number, or a
  89194. // boolean. The comparison operator must be either =, !=, >, or <.
  89195. //
  89196. // For example, if you are filtering Compute Engine instances, you can
  89197. // exclude instances named example-instance by specifying name !=
  89198. // example-instance.
  89199. //
  89200. // You can also filter nested fields. For example, you could specify
  89201. // scheduling.automaticRestart = false to include instances only if they
  89202. // are not scheduled for automatic restarts. You can use filtering on
  89203. // nested fields to filter based on resource labels.
  89204. //
  89205. // To filter on multiple expressions, provide each separate expression
  89206. // within parentheses. For example, (scheduling.automaticRestart = true)
  89207. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89208. // AND expression. However, you can include AND and OR expressions
  89209. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89210. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89211. // true).
  89212. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  89213. c.urlParams_.Set("filter", filter)
  89214. return c
  89215. }
  89216. // MaxResults sets the optional parameter "maxResults": The maximum
  89217. // number of results per page that should be returned. If the number of
  89218. // available results is larger than maxResults, Compute Engine returns a
  89219. // nextPageToken that can be used to get the next page of results in
  89220. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89221. // (Default: 500)
  89222. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  89223. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89224. return c
  89225. }
  89226. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89227. // a certain order. By default, results are returned in alphanumerical
  89228. // order based on the resource name.
  89229. //
  89230. // You can also sort results in descending order based on the creation
  89231. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89232. // based on the creationTimestamp field in reverse chronological order
  89233. // (newest result first). Use this to sort resources like operations so
  89234. // that the newest operation is returned first.
  89235. //
  89236. // Currently, only sorting by name or creationTimestamp desc is
  89237. // supported.
  89238. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  89239. c.urlParams_.Set("orderBy", orderBy)
  89240. return c
  89241. }
  89242. // PageToken sets the optional parameter "pageToken": Specifies a page
  89243. // token to use. Set pageToken to the nextPageToken returned by a
  89244. // previous list request to get the next page of results.
  89245. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  89246. c.urlParams_.Set("pageToken", pageToken)
  89247. return c
  89248. }
  89249. // Fields allows partial responses to be retrieved. See
  89250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89251. // for more information.
  89252. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  89253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89254. return c
  89255. }
  89256. // IfNoneMatch sets the optional parameter which makes the operation
  89257. // fail if the object's ETag matches the given value. This is useful for
  89258. // getting updates only after the object has changed since the last
  89259. // request. Use googleapi.IsNotModified to check whether the response
  89260. // error from Do is the result of In-None-Match.
  89261. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  89262. c.ifNoneMatch_ = entityTag
  89263. return c
  89264. }
  89265. // Context sets the context to be used in this call's Do method. Any
  89266. // pending HTTP request will be aborted if the provided context is
  89267. // canceled.
  89268. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  89269. c.ctx_ = ctx
  89270. return c
  89271. }
  89272. // Header returns an http.Header that can be modified by the caller to
  89273. // add HTTP headers to the request.
  89274. func (c *TargetPoolsListCall) Header() http.Header {
  89275. if c.header_ == nil {
  89276. c.header_ = make(http.Header)
  89277. }
  89278. return c.header_
  89279. }
  89280. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  89281. reqHeaders := make(http.Header)
  89282. for k, v := range c.header_ {
  89283. reqHeaders[k] = v
  89284. }
  89285. reqHeaders.Set("User-Agent", c.s.userAgent())
  89286. if c.ifNoneMatch_ != "" {
  89287. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89288. }
  89289. var body io.Reader = nil
  89290. c.urlParams_.Set("alt", alt)
  89291. c.urlParams_.Set("prettyPrint", "false")
  89292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  89293. urls += "?" + c.urlParams_.Encode()
  89294. req, err := http.NewRequest("GET", urls, body)
  89295. if err != nil {
  89296. return nil, err
  89297. }
  89298. req.Header = reqHeaders
  89299. googleapi.Expand(req.URL, map[string]string{
  89300. "project": c.project,
  89301. "region": c.region,
  89302. })
  89303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89304. }
  89305. // Do executes the "compute.targetPools.list" call.
  89306. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  89307. // status code is an error. Response headers are in either
  89308. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  89309. // at all) in error.(*googleapi.Error).Header. Use
  89310. // googleapi.IsNotModified to check whether the returned error was
  89311. // because http.StatusNotModified was returned.
  89312. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  89313. gensupport.SetOptions(c.urlParams_, opts...)
  89314. res, err := c.doRequest("json")
  89315. if res != nil && res.StatusCode == http.StatusNotModified {
  89316. if res.Body != nil {
  89317. res.Body.Close()
  89318. }
  89319. return nil, &googleapi.Error{
  89320. Code: res.StatusCode,
  89321. Header: res.Header,
  89322. }
  89323. }
  89324. if err != nil {
  89325. return nil, err
  89326. }
  89327. defer googleapi.CloseBody(res)
  89328. if err := googleapi.CheckResponse(res); err != nil {
  89329. return nil, err
  89330. }
  89331. ret := &TargetPoolList{
  89332. ServerResponse: googleapi.ServerResponse{
  89333. Header: res.Header,
  89334. HTTPStatusCode: res.StatusCode,
  89335. },
  89336. }
  89337. target := &ret
  89338. if err := gensupport.DecodeResponse(target, res); err != nil {
  89339. return nil, err
  89340. }
  89341. return ret, nil
  89342. // {
  89343. // "description": "Retrieves a list of target pools available to the specified project and region.",
  89344. // "httpMethod": "GET",
  89345. // "id": "compute.targetPools.list",
  89346. // "parameterOrder": [
  89347. // "project",
  89348. // "region"
  89349. // ],
  89350. // "parameters": {
  89351. // "filter": {
  89352. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  89353. // "location": "query",
  89354. // "type": "string"
  89355. // },
  89356. // "maxResults": {
  89357. // "default": "500",
  89358. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  89359. // "format": "uint32",
  89360. // "location": "query",
  89361. // "minimum": "0",
  89362. // "type": "integer"
  89363. // },
  89364. // "orderBy": {
  89365. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  89366. // "location": "query",
  89367. // "type": "string"
  89368. // },
  89369. // "pageToken": {
  89370. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  89371. // "location": "query",
  89372. // "type": "string"
  89373. // },
  89374. // "project": {
  89375. // "description": "Project ID for this request.",
  89376. // "location": "path",
  89377. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89378. // "required": true,
  89379. // "type": "string"
  89380. // },
  89381. // "region": {
  89382. // "description": "Name of the region scoping this request.",
  89383. // "location": "path",
  89384. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89385. // "required": true,
  89386. // "type": "string"
  89387. // }
  89388. // },
  89389. // "path": "{project}/regions/{region}/targetPools",
  89390. // "response": {
  89391. // "$ref": "TargetPoolList"
  89392. // },
  89393. // "scopes": [
  89394. // "https://www.googleapis.com/auth/cloud-platform",
  89395. // "https://www.googleapis.com/auth/compute",
  89396. // "https://www.googleapis.com/auth/compute.readonly"
  89397. // ]
  89398. // }
  89399. }
  89400. // Pages invokes f for each page of results.
  89401. // A non-nil error returned from f will halt the iteration.
  89402. // The provided context supersedes any context provided to the Context method.
  89403. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  89404. c.ctx_ = ctx
  89405. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89406. for {
  89407. x, err := c.Do()
  89408. if err != nil {
  89409. return err
  89410. }
  89411. if err := f(x); err != nil {
  89412. return err
  89413. }
  89414. if x.NextPageToken == "" {
  89415. return nil
  89416. }
  89417. c.PageToken(x.NextPageToken)
  89418. }
  89419. }
  89420. // method id "compute.targetPools.removeHealthCheck":
  89421. type TargetPoolsRemoveHealthCheckCall struct {
  89422. s *Service
  89423. project string
  89424. region string
  89425. targetPool string
  89426. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  89427. urlParams_ gensupport.URLParams
  89428. ctx_ context.Context
  89429. header_ http.Header
  89430. }
  89431. // RemoveHealthCheck: Removes health check URL from a target pool.
  89432. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  89433. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  89434. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89435. c.project = project
  89436. c.region = region
  89437. c.targetPool = targetPool
  89438. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  89439. return c
  89440. }
  89441. // RequestId sets the optional parameter "requestId": An optional
  89442. // request ID to identify requests. Specify a unique request ID so that
  89443. // if you must retry your request, the server will know to ignore the
  89444. // request if it has already been completed.
  89445. //
  89446. // For example, consider a situation where you make an initial request
  89447. // and the request times out. If you make the request again with the
  89448. // same request ID, the server can check if original operation with the
  89449. // same request ID was received, and if so, will ignore the second
  89450. // request. This prevents clients from accidentally creating duplicate
  89451. // commitments.
  89452. //
  89453. // The request ID must be a valid UUID with the exception that zero UUID
  89454. // is not supported (00000000-0000-0000-0000-000000000000).
  89455. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  89456. c.urlParams_.Set("requestId", requestId)
  89457. return c
  89458. }
  89459. // Fields allows partial responses to be retrieved. See
  89460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89461. // for more information.
  89462. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  89463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89464. return c
  89465. }
  89466. // Context sets the context to be used in this call's Do method. Any
  89467. // pending HTTP request will be aborted if the provided context is
  89468. // canceled.
  89469. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  89470. c.ctx_ = ctx
  89471. return c
  89472. }
  89473. // Header returns an http.Header that can be modified by the caller to
  89474. // add HTTP headers to the request.
  89475. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  89476. if c.header_ == nil {
  89477. c.header_ = make(http.Header)
  89478. }
  89479. return c.header_
  89480. }
  89481. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  89482. reqHeaders := make(http.Header)
  89483. for k, v := range c.header_ {
  89484. reqHeaders[k] = v
  89485. }
  89486. reqHeaders.Set("User-Agent", c.s.userAgent())
  89487. var body io.Reader = nil
  89488. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  89489. if err != nil {
  89490. return nil, err
  89491. }
  89492. reqHeaders.Set("Content-Type", "application/json")
  89493. c.urlParams_.Set("alt", alt)
  89494. c.urlParams_.Set("prettyPrint", "false")
  89495. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  89496. urls += "?" + c.urlParams_.Encode()
  89497. req, err := http.NewRequest("POST", urls, body)
  89498. if err != nil {
  89499. return nil, err
  89500. }
  89501. req.Header = reqHeaders
  89502. googleapi.Expand(req.URL, map[string]string{
  89503. "project": c.project,
  89504. "region": c.region,
  89505. "targetPool": c.targetPool,
  89506. })
  89507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89508. }
  89509. // Do executes the "compute.targetPools.removeHealthCheck" call.
  89510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89511. // status code is an error. Response headers are in either
  89512. // *Operation.ServerResponse.Header or (if a response was returned at
  89513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89514. // to check whether the returned error was because
  89515. // http.StatusNotModified was returned.
  89516. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89517. gensupport.SetOptions(c.urlParams_, opts...)
  89518. res, err := c.doRequest("json")
  89519. if res != nil && res.StatusCode == http.StatusNotModified {
  89520. if res.Body != nil {
  89521. res.Body.Close()
  89522. }
  89523. return nil, &googleapi.Error{
  89524. Code: res.StatusCode,
  89525. Header: res.Header,
  89526. }
  89527. }
  89528. if err != nil {
  89529. return nil, err
  89530. }
  89531. defer googleapi.CloseBody(res)
  89532. if err := googleapi.CheckResponse(res); err != nil {
  89533. return nil, err
  89534. }
  89535. ret := &Operation{
  89536. ServerResponse: googleapi.ServerResponse{
  89537. Header: res.Header,
  89538. HTTPStatusCode: res.StatusCode,
  89539. },
  89540. }
  89541. target := &ret
  89542. if err := gensupport.DecodeResponse(target, res); err != nil {
  89543. return nil, err
  89544. }
  89545. return ret, nil
  89546. // {
  89547. // "description": "Removes health check URL from a target pool.",
  89548. // "httpMethod": "POST",
  89549. // "id": "compute.targetPools.removeHealthCheck",
  89550. // "parameterOrder": [
  89551. // "project",
  89552. // "region",
  89553. // "targetPool"
  89554. // ],
  89555. // "parameters": {
  89556. // "project": {
  89557. // "description": "Project ID for this request.",
  89558. // "location": "path",
  89559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89560. // "required": true,
  89561. // "type": "string"
  89562. // },
  89563. // "region": {
  89564. // "description": "Name of the region for this request.",
  89565. // "location": "path",
  89566. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89567. // "required": true,
  89568. // "type": "string"
  89569. // },
  89570. // "requestId": {
  89571. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89572. // "location": "query",
  89573. // "type": "string"
  89574. // },
  89575. // "targetPool": {
  89576. // "description": "Name of the target pool to remove health checks from.",
  89577. // "location": "path",
  89578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89579. // "required": true,
  89580. // "type": "string"
  89581. // }
  89582. // },
  89583. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  89584. // "request": {
  89585. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  89586. // },
  89587. // "response": {
  89588. // "$ref": "Operation"
  89589. // },
  89590. // "scopes": [
  89591. // "https://www.googleapis.com/auth/cloud-platform",
  89592. // "https://www.googleapis.com/auth/compute"
  89593. // ]
  89594. // }
  89595. }
  89596. // method id "compute.targetPools.removeInstance":
  89597. type TargetPoolsRemoveInstanceCall struct {
  89598. s *Service
  89599. project string
  89600. region string
  89601. targetPool string
  89602. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  89603. urlParams_ gensupport.URLParams
  89604. ctx_ context.Context
  89605. header_ http.Header
  89606. }
  89607. // RemoveInstance: Removes instance URL from a target pool.
  89608. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  89609. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  89610. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89611. c.project = project
  89612. c.region = region
  89613. c.targetPool = targetPool
  89614. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  89615. return c
  89616. }
  89617. // RequestId sets the optional parameter "requestId": An optional
  89618. // request ID to identify requests. Specify a unique request ID so that
  89619. // if you must retry your request, the server will know to ignore the
  89620. // request if it has already been completed.
  89621. //
  89622. // For example, consider a situation where you make an initial request
  89623. // and the request times out. If you make the request again with the
  89624. // same request ID, the server can check if original operation with the
  89625. // same request ID was received, and if so, will ignore the second
  89626. // request. This prevents clients from accidentally creating duplicate
  89627. // commitments.
  89628. //
  89629. // The request ID must be a valid UUID with the exception that zero UUID
  89630. // is not supported (00000000-0000-0000-0000-000000000000).
  89631. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  89632. c.urlParams_.Set("requestId", requestId)
  89633. return c
  89634. }
  89635. // Fields allows partial responses to be retrieved. See
  89636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89637. // for more information.
  89638. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  89639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89640. return c
  89641. }
  89642. // Context sets the context to be used in this call's Do method. Any
  89643. // pending HTTP request will be aborted if the provided context is
  89644. // canceled.
  89645. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  89646. c.ctx_ = ctx
  89647. return c
  89648. }
  89649. // Header returns an http.Header that can be modified by the caller to
  89650. // add HTTP headers to the request.
  89651. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  89652. if c.header_ == nil {
  89653. c.header_ = make(http.Header)
  89654. }
  89655. return c.header_
  89656. }
  89657. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  89658. reqHeaders := make(http.Header)
  89659. for k, v := range c.header_ {
  89660. reqHeaders[k] = v
  89661. }
  89662. reqHeaders.Set("User-Agent", c.s.userAgent())
  89663. var body io.Reader = nil
  89664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  89665. if err != nil {
  89666. return nil, err
  89667. }
  89668. reqHeaders.Set("Content-Type", "application/json")
  89669. c.urlParams_.Set("alt", alt)
  89670. c.urlParams_.Set("prettyPrint", "false")
  89671. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  89672. urls += "?" + c.urlParams_.Encode()
  89673. req, err := http.NewRequest("POST", urls, body)
  89674. if err != nil {
  89675. return nil, err
  89676. }
  89677. req.Header = reqHeaders
  89678. googleapi.Expand(req.URL, map[string]string{
  89679. "project": c.project,
  89680. "region": c.region,
  89681. "targetPool": c.targetPool,
  89682. })
  89683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89684. }
  89685. // Do executes the "compute.targetPools.removeInstance" call.
  89686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89687. // status code is an error. Response headers are in either
  89688. // *Operation.ServerResponse.Header or (if a response was returned at
  89689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89690. // to check whether the returned error was because
  89691. // http.StatusNotModified was returned.
  89692. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89693. gensupport.SetOptions(c.urlParams_, opts...)
  89694. res, err := c.doRequest("json")
  89695. if res != nil && res.StatusCode == http.StatusNotModified {
  89696. if res.Body != nil {
  89697. res.Body.Close()
  89698. }
  89699. return nil, &googleapi.Error{
  89700. Code: res.StatusCode,
  89701. Header: res.Header,
  89702. }
  89703. }
  89704. if err != nil {
  89705. return nil, err
  89706. }
  89707. defer googleapi.CloseBody(res)
  89708. if err := googleapi.CheckResponse(res); err != nil {
  89709. return nil, err
  89710. }
  89711. ret := &Operation{
  89712. ServerResponse: googleapi.ServerResponse{
  89713. Header: res.Header,
  89714. HTTPStatusCode: res.StatusCode,
  89715. },
  89716. }
  89717. target := &ret
  89718. if err := gensupport.DecodeResponse(target, res); err != nil {
  89719. return nil, err
  89720. }
  89721. return ret, nil
  89722. // {
  89723. // "description": "Removes instance URL from a target pool.",
  89724. // "httpMethod": "POST",
  89725. // "id": "compute.targetPools.removeInstance",
  89726. // "parameterOrder": [
  89727. // "project",
  89728. // "region",
  89729. // "targetPool"
  89730. // ],
  89731. // "parameters": {
  89732. // "project": {
  89733. // "description": "Project ID for this request.",
  89734. // "location": "path",
  89735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89736. // "required": true,
  89737. // "type": "string"
  89738. // },
  89739. // "region": {
  89740. // "description": "Name of the region scoping this request.",
  89741. // "location": "path",
  89742. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89743. // "required": true,
  89744. // "type": "string"
  89745. // },
  89746. // "requestId": {
  89747. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89748. // "location": "query",
  89749. // "type": "string"
  89750. // },
  89751. // "targetPool": {
  89752. // "description": "Name of the TargetPool resource to remove instances from.",
  89753. // "location": "path",
  89754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89755. // "required": true,
  89756. // "type": "string"
  89757. // }
  89758. // },
  89759. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  89760. // "request": {
  89761. // "$ref": "TargetPoolsRemoveInstanceRequest"
  89762. // },
  89763. // "response": {
  89764. // "$ref": "Operation"
  89765. // },
  89766. // "scopes": [
  89767. // "https://www.googleapis.com/auth/cloud-platform",
  89768. // "https://www.googleapis.com/auth/compute"
  89769. // ]
  89770. // }
  89771. }
  89772. // method id "compute.targetPools.setBackup":
  89773. type TargetPoolsSetBackupCall struct {
  89774. s *Service
  89775. project string
  89776. region string
  89777. targetPool string
  89778. targetreference *TargetReference
  89779. urlParams_ gensupport.URLParams
  89780. ctx_ context.Context
  89781. header_ http.Header
  89782. }
  89783. // SetBackup: Changes a backup target pool's configurations.
  89784. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  89785. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  89786. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89787. c.project = project
  89788. c.region = region
  89789. c.targetPool = targetPool
  89790. c.targetreference = targetreference
  89791. return c
  89792. }
  89793. // FailoverRatio sets the optional parameter "failoverRatio": New
  89794. // failoverRatio value for the target pool.
  89795. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  89796. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  89797. return c
  89798. }
  89799. // RequestId sets the optional parameter "requestId": An optional
  89800. // request ID to identify requests. Specify a unique request ID so that
  89801. // if you must retry your request, the server will know to ignore the
  89802. // request if it has already been completed.
  89803. //
  89804. // For example, consider a situation where you make an initial request
  89805. // and the request times out. If you make the request again with the
  89806. // same request ID, the server can check if original operation with the
  89807. // same request ID was received, and if so, will ignore the second
  89808. // request. This prevents clients from accidentally creating duplicate
  89809. // commitments.
  89810. //
  89811. // The request ID must be a valid UUID with the exception that zero UUID
  89812. // is not supported (00000000-0000-0000-0000-000000000000).
  89813. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  89814. c.urlParams_.Set("requestId", requestId)
  89815. return c
  89816. }
  89817. // Fields allows partial responses to be retrieved. See
  89818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89819. // for more information.
  89820. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  89821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89822. return c
  89823. }
  89824. // Context sets the context to be used in this call's Do method. Any
  89825. // pending HTTP request will be aborted if the provided context is
  89826. // canceled.
  89827. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  89828. c.ctx_ = ctx
  89829. return c
  89830. }
  89831. // Header returns an http.Header that can be modified by the caller to
  89832. // add HTTP headers to the request.
  89833. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  89834. if c.header_ == nil {
  89835. c.header_ = make(http.Header)
  89836. }
  89837. return c.header_
  89838. }
  89839. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  89840. reqHeaders := make(http.Header)
  89841. for k, v := range c.header_ {
  89842. reqHeaders[k] = v
  89843. }
  89844. reqHeaders.Set("User-Agent", c.s.userAgent())
  89845. var body io.Reader = nil
  89846. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  89847. if err != nil {
  89848. return nil, err
  89849. }
  89850. reqHeaders.Set("Content-Type", "application/json")
  89851. c.urlParams_.Set("alt", alt)
  89852. c.urlParams_.Set("prettyPrint", "false")
  89853. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  89854. urls += "?" + c.urlParams_.Encode()
  89855. req, err := http.NewRequest("POST", urls, body)
  89856. if err != nil {
  89857. return nil, err
  89858. }
  89859. req.Header = reqHeaders
  89860. googleapi.Expand(req.URL, map[string]string{
  89861. "project": c.project,
  89862. "region": c.region,
  89863. "targetPool": c.targetPool,
  89864. })
  89865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89866. }
  89867. // Do executes the "compute.targetPools.setBackup" call.
  89868. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89869. // status code is an error. Response headers are in either
  89870. // *Operation.ServerResponse.Header or (if a response was returned at
  89871. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89872. // to check whether the returned error was because
  89873. // http.StatusNotModified was returned.
  89874. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89875. gensupport.SetOptions(c.urlParams_, opts...)
  89876. res, err := c.doRequest("json")
  89877. if res != nil && res.StatusCode == http.StatusNotModified {
  89878. if res.Body != nil {
  89879. res.Body.Close()
  89880. }
  89881. return nil, &googleapi.Error{
  89882. Code: res.StatusCode,
  89883. Header: res.Header,
  89884. }
  89885. }
  89886. if err != nil {
  89887. return nil, err
  89888. }
  89889. defer googleapi.CloseBody(res)
  89890. if err := googleapi.CheckResponse(res); err != nil {
  89891. return nil, err
  89892. }
  89893. ret := &Operation{
  89894. ServerResponse: googleapi.ServerResponse{
  89895. Header: res.Header,
  89896. HTTPStatusCode: res.StatusCode,
  89897. },
  89898. }
  89899. target := &ret
  89900. if err := gensupport.DecodeResponse(target, res); err != nil {
  89901. return nil, err
  89902. }
  89903. return ret, nil
  89904. // {
  89905. // "description": "Changes a backup target pool's configurations.",
  89906. // "httpMethod": "POST",
  89907. // "id": "compute.targetPools.setBackup",
  89908. // "parameterOrder": [
  89909. // "project",
  89910. // "region",
  89911. // "targetPool"
  89912. // ],
  89913. // "parameters": {
  89914. // "failoverRatio": {
  89915. // "description": "New failoverRatio value for the target pool.",
  89916. // "format": "float",
  89917. // "location": "query",
  89918. // "type": "number"
  89919. // },
  89920. // "project": {
  89921. // "description": "Project ID for this request.",
  89922. // "location": "path",
  89923. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89924. // "required": true,
  89925. // "type": "string"
  89926. // },
  89927. // "region": {
  89928. // "description": "Name of the region scoping this request.",
  89929. // "location": "path",
  89930. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89931. // "required": true,
  89932. // "type": "string"
  89933. // },
  89934. // "requestId": {
  89935. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89936. // "location": "query",
  89937. // "type": "string"
  89938. // },
  89939. // "targetPool": {
  89940. // "description": "Name of the TargetPool resource to set a backup pool for.",
  89941. // "location": "path",
  89942. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89943. // "required": true,
  89944. // "type": "string"
  89945. // }
  89946. // },
  89947. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  89948. // "request": {
  89949. // "$ref": "TargetReference"
  89950. // },
  89951. // "response": {
  89952. // "$ref": "Operation"
  89953. // },
  89954. // "scopes": [
  89955. // "https://www.googleapis.com/auth/cloud-platform",
  89956. // "https://www.googleapis.com/auth/compute"
  89957. // ]
  89958. // }
  89959. }
  89960. // method id "compute.targetSslProxies.delete":
  89961. type TargetSslProxiesDeleteCall struct {
  89962. s *Service
  89963. project string
  89964. targetSslProxy string
  89965. urlParams_ gensupport.URLParams
  89966. ctx_ context.Context
  89967. header_ http.Header
  89968. }
  89969. // Delete: Deletes the specified TargetSslProxy resource.
  89970. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  89971. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89972. c.project = project
  89973. c.targetSslProxy = targetSslProxy
  89974. return c
  89975. }
  89976. // RequestId sets the optional parameter "requestId": An optional
  89977. // request ID to identify requests. Specify a unique request ID so that
  89978. // if you must retry your request, the server will know to ignore the
  89979. // request if it has already been completed.
  89980. //
  89981. // For example, consider a situation where you make an initial request
  89982. // and the request times out. If you make the request again with the
  89983. // same request ID, the server can check if original operation with the
  89984. // same request ID was received, and if so, will ignore the second
  89985. // request. This prevents clients from accidentally creating duplicate
  89986. // commitments.
  89987. //
  89988. // The request ID must be a valid UUID with the exception that zero UUID
  89989. // is not supported (00000000-0000-0000-0000-000000000000).
  89990. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  89991. c.urlParams_.Set("requestId", requestId)
  89992. return c
  89993. }
  89994. // Fields allows partial responses to be retrieved. See
  89995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89996. // for more information.
  89997. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  89998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89999. return c
  90000. }
  90001. // Context sets the context to be used in this call's Do method. Any
  90002. // pending HTTP request will be aborted if the provided context is
  90003. // canceled.
  90004. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  90005. c.ctx_ = ctx
  90006. return c
  90007. }
  90008. // Header returns an http.Header that can be modified by the caller to
  90009. // add HTTP headers to the request.
  90010. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  90011. if c.header_ == nil {
  90012. c.header_ = make(http.Header)
  90013. }
  90014. return c.header_
  90015. }
  90016. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  90017. reqHeaders := make(http.Header)
  90018. for k, v := range c.header_ {
  90019. reqHeaders[k] = v
  90020. }
  90021. reqHeaders.Set("User-Agent", c.s.userAgent())
  90022. var body io.Reader = nil
  90023. c.urlParams_.Set("alt", alt)
  90024. c.urlParams_.Set("prettyPrint", "false")
  90025. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  90026. urls += "?" + c.urlParams_.Encode()
  90027. req, err := http.NewRequest("DELETE", urls, body)
  90028. if err != nil {
  90029. return nil, err
  90030. }
  90031. req.Header = reqHeaders
  90032. googleapi.Expand(req.URL, map[string]string{
  90033. "project": c.project,
  90034. "targetSslProxy": c.targetSslProxy,
  90035. })
  90036. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90037. }
  90038. // Do executes the "compute.targetSslProxies.delete" call.
  90039. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90040. // status code is an error. Response headers are in either
  90041. // *Operation.ServerResponse.Header or (if a response was returned at
  90042. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90043. // to check whether the returned error was because
  90044. // http.StatusNotModified was returned.
  90045. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90046. gensupport.SetOptions(c.urlParams_, opts...)
  90047. res, err := c.doRequest("json")
  90048. if res != nil && res.StatusCode == http.StatusNotModified {
  90049. if res.Body != nil {
  90050. res.Body.Close()
  90051. }
  90052. return nil, &googleapi.Error{
  90053. Code: res.StatusCode,
  90054. Header: res.Header,
  90055. }
  90056. }
  90057. if err != nil {
  90058. return nil, err
  90059. }
  90060. defer googleapi.CloseBody(res)
  90061. if err := googleapi.CheckResponse(res); err != nil {
  90062. return nil, err
  90063. }
  90064. ret := &Operation{
  90065. ServerResponse: googleapi.ServerResponse{
  90066. Header: res.Header,
  90067. HTTPStatusCode: res.StatusCode,
  90068. },
  90069. }
  90070. target := &ret
  90071. if err := gensupport.DecodeResponse(target, res); err != nil {
  90072. return nil, err
  90073. }
  90074. return ret, nil
  90075. // {
  90076. // "description": "Deletes the specified TargetSslProxy resource.",
  90077. // "httpMethod": "DELETE",
  90078. // "id": "compute.targetSslProxies.delete",
  90079. // "parameterOrder": [
  90080. // "project",
  90081. // "targetSslProxy"
  90082. // ],
  90083. // "parameters": {
  90084. // "project": {
  90085. // "description": "Project ID for this request.",
  90086. // "location": "path",
  90087. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90088. // "required": true,
  90089. // "type": "string"
  90090. // },
  90091. // "requestId": {
  90092. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90093. // "location": "query",
  90094. // "type": "string"
  90095. // },
  90096. // "targetSslProxy": {
  90097. // "description": "Name of the TargetSslProxy resource to delete.",
  90098. // "location": "path",
  90099. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90100. // "required": true,
  90101. // "type": "string"
  90102. // }
  90103. // },
  90104. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  90105. // "response": {
  90106. // "$ref": "Operation"
  90107. // },
  90108. // "scopes": [
  90109. // "https://www.googleapis.com/auth/cloud-platform",
  90110. // "https://www.googleapis.com/auth/compute"
  90111. // ]
  90112. // }
  90113. }
  90114. // method id "compute.targetSslProxies.get":
  90115. type TargetSslProxiesGetCall struct {
  90116. s *Service
  90117. project string
  90118. targetSslProxy string
  90119. urlParams_ gensupport.URLParams
  90120. ifNoneMatch_ string
  90121. ctx_ context.Context
  90122. header_ http.Header
  90123. }
  90124. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  90125. // available target SSL proxies by making a list() request.
  90126. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  90127. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90128. c.project = project
  90129. c.targetSslProxy = targetSslProxy
  90130. return c
  90131. }
  90132. // Fields allows partial responses to be retrieved. See
  90133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90134. // for more information.
  90135. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  90136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90137. return c
  90138. }
  90139. // IfNoneMatch sets the optional parameter which makes the operation
  90140. // fail if the object's ETag matches the given value. This is useful for
  90141. // getting updates only after the object has changed since the last
  90142. // request. Use googleapi.IsNotModified to check whether the response
  90143. // error from Do is the result of In-None-Match.
  90144. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  90145. c.ifNoneMatch_ = entityTag
  90146. return c
  90147. }
  90148. // Context sets the context to be used in this call's Do method. Any
  90149. // pending HTTP request will be aborted if the provided context is
  90150. // canceled.
  90151. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  90152. c.ctx_ = ctx
  90153. return c
  90154. }
  90155. // Header returns an http.Header that can be modified by the caller to
  90156. // add HTTP headers to the request.
  90157. func (c *TargetSslProxiesGetCall) Header() http.Header {
  90158. if c.header_ == nil {
  90159. c.header_ = make(http.Header)
  90160. }
  90161. return c.header_
  90162. }
  90163. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  90164. reqHeaders := make(http.Header)
  90165. for k, v := range c.header_ {
  90166. reqHeaders[k] = v
  90167. }
  90168. reqHeaders.Set("User-Agent", c.s.userAgent())
  90169. if c.ifNoneMatch_ != "" {
  90170. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90171. }
  90172. var body io.Reader = nil
  90173. c.urlParams_.Set("alt", alt)
  90174. c.urlParams_.Set("prettyPrint", "false")
  90175. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  90176. urls += "?" + c.urlParams_.Encode()
  90177. req, err := http.NewRequest("GET", urls, body)
  90178. if err != nil {
  90179. return nil, err
  90180. }
  90181. req.Header = reqHeaders
  90182. googleapi.Expand(req.URL, map[string]string{
  90183. "project": c.project,
  90184. "targetSslProxy": c.targetSslProxy,
  90185. })
  90186. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90187. }
  90188. // Do executes the "compute.targetSslProxies.get" call.
  90189. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  90190. // status code is an error. Response headers are in either
  90191. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  90192. // at all) in error.(*googleapi.Error).Header. Use
  90193. // googleapi.IsNotModified to check whether the returned error was
  90194. // because http.StatusNotModified was returned.
  90195. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  90196. gensupport.SetOptions(c.urlParams_, opts...)
  90197. res, err := c.doRequest("json")
  90198. if res != nil && res.StatusCode == http.StatusNotModified {
  90199. if res.Body != nil {
  90200. res.Body.Close()
  90201. }
  90202. return nil, &googleapi.Error{
  90203. Code: res.StatusCode,
  90204. Header: res.Header,
  90205. }
  90206. }
  90207. if err != nil {
  90208. return nil, err
  90209. }
  90210. defer googleapi.CloseBody(res)
  90211. if err := googleapi.CheckResponse(res); err != nil {
  90212. return nil, err
  90213. }
  90214. ret := &TargetSslProxy{
  90215. ServerResponse: googleapi.ServerResponse{
  90216. Header: res.Header,
  90217. HTTPStatusCode: res.StatusCode,
  90218. },
  90219. }
  90220. target := &ret
  90221. if err := gensupport.DecodeResponse(target, res); err != nil {
  90222. return nil, err
  90223. }
  90224. return ret, nil
  90225. // {
  90226. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  90227. // "httpMethod": "GET",
  90228. // "id": "compute.targetSslProxies.get",
  90229. // "parameterOrder": [
  90230. // "project",
  90231. // "targetSslProxy"
  90232. // ],
  90233. // "parameters": {
  90234. // "project": {
  90235. // "description": "Project ID for this request.",
  90236. // "location": "path",
  90237. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90238. // "required": true,
  90239. // "type": "string"
  90240. // },
  90241. // "targetSslProxy": {
  90242. // "description": "Name of the TargetSslProxy resource to return.",
  90243. // "location": "path",
  90244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90245. // "required": true,
  90246. // "type": "string"
  90247. // }
  90248. // },
  90249. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  90250. // "response": {
  90251. // "$ref": "TargetSslProxy"
  90252. // },
  90253. // "scopes": [
  90254. // "https://www.googleapis.com/auth/cloud-platform",
  90255. // "https://www.googleapis.com/auth/compute",
  90256. // "https://www.googleapis.com/auth/compute.readonly"
  90257. // ]
  90258. // }
  90259. }
  90260. // method id "compute.targetSslProxies.insert":
  90261. type TargetSslProxiesInsertCall struct {
  90262. s *Service
  90263. project string
  90264. targetsslproxy *TargetSslProxy
  90265. urlParams_ gensupport.URLParams
  90266. ctx_ context.Context
  90267. header_ http.Header
  90268. }
  90269. // Insert: Creates a TargetSslProxy resource in the specified project
  90270. // using the data included in the request.
  90271. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  90272. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90273. c.project = project
  90274. c.targetsslproxy = targetsslproxy
  90275. return c
  90276. }
  90277. // RequestId sets the optional parameter "requestId": An optional
  90278. // request ID to identify requests. Specify a unique request ID so that
  90279. // if you must retry your request, the server will know to ignore the
  90280. // request if it has already been completed.
  90281. //
  90282. // For example, consider a situation where you make an initial request
  90283. // and the request times out. If you make the request again with the
  90284. // same request ID, the server can check if original operation with the
  90285. // same request ID was received, and if so, will ignore the second
  90286. // request. This prevents clients from accidentally creating duplicate
  90287. // commitments.
  90288. //
  90289. // The request ID must be a valid UUID with the exception that zero UUID
  90290. // is not supported (00000000-0000-0000-0000-000000000000).
  90291. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  90292. c.urlParams_.Set("requestId", requestId)
  90293. return c
  90294. }
  90295. // Fields allows partial responses to be retrieved. See
  90296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90297. // for more information.
  90298. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  90299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90300. return c
  90301. }
  90302. // Context sets the context to be used in this call's Do method. Any
  90303. // pending HTTP request will be aborted if the provided context is
  90304. // canceled.
  90305. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  90306. c.ctx_ = ctx
  90307. return c
  90308. }
  90309. // Header returns an http.Header that can be modified by the caller to
  90310. // add HTTP headers to the request.
  90311. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  90312. if c.header_ == nil {
  90313. c.header_ = make(http.Header)
  90314. }
  90315. return c.header_
  90316. }
  90317. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  90318. reqHeaders := make(http.Header)
  90319. for k, v := range c.header_ {
  90320. reqHeaders[k] = v
  90321. }
  90322. reqHeaders.Set("User-Agent", c.s.userAgent())
  90323. var body io.Reader = nil
  90324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  90325. if err != nil {
  90326. return nil, err
  90327. }
  90328. reqHeaders.Set("Content-Type", "application/json")
  90329. c.urlParams_.Set("alt", alt)
  90330. c.urlParams_.Set("prettyPrint", "false")
  90331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  90332. urls += "?" + c.urlParams_.Encode()
  90333. req, err := http.NewRequest("POST", urls, body)
  90334. if err != nil {
  90335. return nil, err
  90336. }
  90337. req.Header = reqHeaders
  90338. googleapi.Expand(req.URL, map[string]string{
  90339. "project": c.project,
  90340. })
  90341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90342. }
  90343. // Do executes the "compute.targetSslProxies.insert" call.
  90344. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90345. // status code is an error. Response headers are in either
  90346. // *Operation.ServerResponse.Header or (if a response was returned at
  90347. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90348. // to check whether the returned error was because
  90349. // http.StatusNotModified was returned.
  90350. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90351. gensupport.SetOptions(c.urlParams_, opts...)
  90352. res, err := c.doRequest("json")
  90353. if res != nil && res.StatusCode == http.StatusNotModified {
  90354. if res.Body != nil {
  90355. res.Body.Close()
  90356. }
  90357. return nil, &googleapi.Error{
  90358. Code: res.StatusCode,
  90359. Header: res.Header,
  90360. }
  90361. }
  90362. if err != nil {
  90363. return nil, err
  90364. }
  90365. defer googleapi.CloseBody(res)
  90366. if err := googleapi.CheckResponse(res); err != nil {
  90367. return nil, err
  90368. }
  90369. ret := &Operation{
  90370. ServerResponse: googleapi.ServerResponse{
  90371. Header: res.Header,
  90372. HTTPStatusCode: res.StatusCode,
  90373. },
  90374. }
  90375. target := &ret
  90376. if err := gensupport.DecodeResponse(target, res); err != nil {
  90377. return nil, err
  90378. }
  90379. return ret, nil
  90380. // {
  90381. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  90382. // "httpMethod": "POST",
  90383. // "id": "compute.targetSslProxies.insert",
  90384. // "parameterOrder": [
  90385. // "project"
  90386. // ],
  90387. // "parameters": {
  90388. // "project": {
  90389. // "description": "Project ID for this request.",
  90390. // "location": "path",
  90391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90392. // "required": true,
  90393. // "type": "string"
  90394. // },
  90395. // "requestId": {
  90396. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90397. // "location": "query",
  90398. // "type": "string"
  90399. // }
  90400. // },
  90401. // "path": "{project}/global/targetSslProxies",
  90402. // "request": {
  90403. // "$ref": "TargetSslProxy"
  90404. // },
  90405. // "response": {
  90406. // "$ref": "Operation"
  90407. // },
  90408. // "scopes": [
  90409. // "https://www.googleapis.com/auth/cloud-platform",
  90410. // "https://www.googleapis.com/auth/compute"
  90411. // ]
  90412. // }
  90413. }
  90414. // method id "compute.targetSslProxies.list":
  90415. type TargetSslProxiesListCall struct {
  90416. s *Service
  90417. project string
  90418. urlParams_ gensupport.URLParams
  90419. ifNoneMatch_ string
  90420. ctx_ context.Context
  90421. header_ http.Header
  90422. }
  90423. // List: Retrieves the list of TargetSslProxy resources available to the
  90424. // specified project.
  90425. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  90426. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90427. c.project = project
  90428. return c
  90429. }
  90430. // Filter sets the optional parameter "filter": A filter expression that
  90431. // filters resources listed in the response. The expression must specify
  90432. // the field name, a comparison operator, and the value that you want to
  90433. // use for filtering. The value must be a string, a number, or a
  90434. // boolean. The comparison operator must be either =, !=, >, or <.
  90435. //
  90436. // For example, if you are filtering Compute Engine instances, you can
  90437. // exclude instances named example-instance by specifying name !=
  90438. // example-instance.
  90439. //
  90440. // You can also filter nested fields. For example, you could specify
  90441. // scheduling.automaticRestart = false to include instances only if they
  90442. // are not scheduled for automatic restarts. You can use filtering on
  90443. // nested fields to filter based on resource labels.
  90444. //
  90445. // To filter on multiple expressions, provide each separate expression
  90446. // within parentheses. For example, (scheduling.automaticRestart = true)
  90447. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90448. // AND expression. However, you can include AND and OR expressions
  90449. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90450. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90451. // true).
  90452. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  90453. c.urlParams_.Set("filter", filter)
  90454. return c
  90455. }
  90456. // MaxResults sets the optional parameter "maxResults": The maximum
  90457. // number of results per page that should be returned. If the number of
  90458. // available results is larger than maxResults, Compute Engine returns a
  90459. // nextPageToken that can be used to get the next page of results in
  90460. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90461. // (Default: 500)
  90462. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  90463. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90464. return c
  90465. }
  90466. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90467. // a certain order. By default, results are returned in alphanumerical
  90468. // order based on the resource name.
  90469. //
  90470. // You can also sort results in descending order based on the creation
  90471. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90472. // based on the creationTimestamp field in reverse chronological order
  90473. // (newest result first). Use this to sort resources like operations so
  90474. // that the newest operation is returned first.
  90475. //
  90476. // Currently, only sorting by name or creationTimestamp desc is
  90477. // supported.
  90478. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  90479. c.urlParams_.Set("orderBy", orderBy)
  90480. return c
  90481. }
  90482. // PageToken sets the optional parameter "pageToken": Specifies a page
  90483. // token to use. Set pageToken to the nextPageToken returned by a
  90484. // previous list request to get the next page of results.
  90485. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  90486. c.urlParams_.Set("pageToken", pageToken)
  90487. return c
  90488. }
  90489. // Fields allows partial responses to be retrieved. See
  90490. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90491. // for more information.
  90492. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  90493. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90494. return c
  90495. }
  90496. // IfNoneMatch sets the optional parameter which makes the operation
  90497. // fail if the object's ETag matches the given value. This is useful for
  90498. // getting updates only after the object has changed since the last
  90499. // request. Use googleapi.IsNotModified to check whether the response
  90500. // error from Do is the result of In-None-Match.
  90501. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  90502. c.ifNoneMatch_ = entityTag
  90503. return c
  90504. }
  90505. // Context sets the context to be used in this call's Do method. Any
  90506. // pending HTTP request will be aborted if the provided context is
  90507. // canceled.
  90508. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  90509. c.ctx_ = ctx
  90510. return c
  90511. }
  90512. // Header returns an http.Header that can be modified by the caller to
  90513. // add HTTP headers to the request.
  90514. func (c *TargetSslProxiesListCall) Header() http.Header {
  90515. if c.header_ == nil {
  90516. c.header_ = make(http.Header)
  90517. }
  90518. return c.header_
  90519. }
  90520. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  90521. reqHeaders := make(http.Header)
  90522. for k, v := range c.header_ {
  90523. reqHeaders[k] = v
  90524. }
  90525. reqHeaders.Set("User-Agent", c.s.userAgent())
  90526. if c.ifNoneMatch_ != "" {
  90527. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90528. }
  90529. var body io.Reader = nil
  90530. c.urlParams_.Set("alt", alt)
  90531. c.urlParams_.Set("prettyPrint", "false")
  90532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  90533. urls += "?" + c.urlParams_.Encode()
  90534. req, err := http.NewRequest("GET", urls, body)
  90535. if err != nil {
  90536. return nil, err
  90537. }
  90538. req.Header = reqHeaders
  90539. googleapi.Expand(req.URL, map[string]string{
  90540. "project": c.project,
  90541. })
  90542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90543. }
  90544. // Do executes the "compute.targetSslProxies.list" call.
  90545. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  90546. // non-2xx status code is an error. Response headers are in either
  90547. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  90548. // returned at all) in error.(*googleapi.Error).Header. Use
  90549. // googleapi.IsNotModified to check whether the returned error was
  90550. // because http.StatusNotModified was returned.
  90551. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  90552. gensupport.SetOptions(c.urlParams_, opts...)
  90553. res, err := c.doRequest("json")
  90554. if res != nil && res.StatusCode == http.StatusNotModified {
  90555. if res.Body != nil {
  90556. res.Body.Close()
  90557. }
  90558. return nil, &googleapi.Error{
  90559. Code: res.StatusCode,
  90560. Header: res.Header,
  90561. }
  90562. }
  90563. if err != nil {
  90564. return nil, err
  90565. }
  90566. defer googleapi.CloseBody(res)
  90567. if err := googleapi.CheckResponse(res); err != nil {
  90568. return nil, err
  90569. }
  90570. ret := &TargetSslProxyList{
  90571. ServerResponse: googleapi.ServerResponse{
  90572. Header: res.Header,
  90573. HTTPStatusCode: res.StatusCode,
  90574. },
  90575. }
  90576. target := &ret
  90577. if err := gensupport.DecodeResponse(target, res); err != nil {
  90578. return nil, err
  90579. }
  90580. return ret, nil
  90581. // {
  90582. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  90583. // "httpMethod": "GET",
  90584. // "id": "compute.targetSslProxies.list",
  90585. // "parameterOrder": [
  90586. // "project"
  90587. // ],
  90588. // "parameters": {
  90589. // "filter": {
  90590. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90591. // "location": "query",
  90592. // "type": "string"
  90593. // },
  90594. // "maxResults": {
  90595. // "default": "500",
  90596. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90597. // "format": "uint32",
  90598. // "location": "query",
  90599. // "minimum": "0",
  90600. // "type": "integer"
  90601. // },
  90602. // "orderBy": {
  90603. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90604. // "location": "query",
  90605. // "type": "string"
  90606. // },
  90607. // "pageToken": {
  90608. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90609. // "location": "query",
  90610. // "type": "string"
  90611. // },
  90612. // "project": {
  90613. // "description": "Project ID for this request.",
  90614. // "location": "path",
  90615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90616. // "required": true,
  90617. // "type": "string"
  90618. // }
  90619. // },
  90620. // "path": "{project}/global/targetSslProxies",
  90621. // "response": {
  90622. // "$ref": "TargetSslProxyList"
  90623. // },
  90624. // "scopes": [
  90625. // "https://www.googleapis.com/auth/cloud-platform",
  90626. // "https://www.googleapis.com/auth/compute",
  90627. // "https://www.googleapis.com/auth/compute.readonly"
  90628. // ]
  90629. // }
  90630. }
  90631. // Pages invokes f for each page of results.
  90632. // A non-nil error returned from f will halt the iteration.
  90633. // The provided context supersedes any context provided to the Context method.
  90634. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  90635. c.ctx_ = ctx
  90636. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90637. for {
  90638. x, err := c.Do()
  90639. if err != nil {
  90640. return err
  90641. }
  90642. if err := f(x); err != nil {
  90643. return err
  90644. }
  90645. if x.NextPageToken == "" {
  90646. return nil
  90647. }
  90648. c.PageToken(x.NextPageToken)
  90649. }
  90650. }
  90651. // method id "compute.targetSslProxies.setBackendService":
  90652. type TargetSslProxiesSetBackendServiceCall struct {
  90653. s *Service
  90654. project string
  90655. targetSslProxy string
  90656. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  90657. urlParams_ gensupport.URLParams
  90658. ctx_ context.Context
  90659. header_ http.Header
  90660. }
  90661. // SetBackendService: Changes the BackendService for TargetSslProxy.
  90662. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  90663. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90664. c.project = project
  90665. c.targetSslProxy = targetSslProxy
  90666. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  90667. return c
  90668. }
  90669. // RequestId sets the optional parameter "requestId": An optional
  90670. // request ID to identify requests. Specify a unique request ID so that
  90671. // if you must retry your request, the server will know to ignore the
  90672. // request if it has already been completed.
  90673. //
  90674. // For example, consider a situation where you make an initial request
  90675. // and the request times out. If you make the request again with the
  90676. // same request ID, the server can check if original operation with the
  90677. // same request ID was received, and if so, will ignore the second
  90678. // request. This prevents clients from accidentally creating duplicate
  90679. // commitments.
  90680. //
  90681. // The request ID must be a valid UUID with the exception that zero UUID
  90682. // is not supported (00000000-0000-0000-0000-000000000000).
  90683. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  90684. c.urlParams_.Set("requestId", requestId)
  90685. return c
  90686. }
  90687. // Fields allows partial responses to be retrieved. See
  90688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90689. // for more information.
  90690. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  90691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90692. return c
  90693. }
  90694. // Context sets the context to be used in this call's Do method. Any
  90695. // pending HTTP request will be aborted if the provided context is
  90696. // canceled.
  90697. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  90698. c.ctx_ = ctx
  90699. return c
  90700. }
  90701. // Header returns an http.Header that can be modified by the caller to
  90702. // add HTTP headers to the request.
  90703. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  90704. if c.header_ == nil {
  90705. c.header_ = make(http.Header)
  90706. }
  90707. return c.header_
  90708. }
  90709. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  90710. reqHeaders := make(http.Header)
  90711. for k, v := range c.header_ {
  90712. reqHeaders[k] = v
  90713. }
  90714. reqHeaders.Set("User-Agent", c.s.userAgent())
  90715. var body io.Reader = nil
  90716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  90717. if err != nil {
  90718. return nil, err
  90719. }
  90720. reqHeaders.Set("Content-Type", "application/json")
  90721. c.urlParams_.Set("alt", alt)
  90722. c.urlParams_.Set("prettyPrint", "false")
  90723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  90724. urls += "?" + c.urlParams_.Encode()
  90725. req, err := http.NewRequest("POST", urls, body)
  90726. if err != nil {
  90727. return nil, err
  90728. }
  90729. req.Header = reqHeaders
  90730. googleapi.Expand(req.URL, map[string]string{
  90731. "project": c.project,
  90732. "targetSslProxy": c.targetSslProxy,
  90733. })
  90734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90735. }
  90736. // Do executes the "compute.targetSslProxies.setBackendService" call.
  90737. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90738. // status code is an error. Response headers are in either
  90739. // *Operation.ServerResponse.Header or (if a response was returned at
  90740. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90741. // to check whether the returned error was because
  90742. // http.StatusNotModified was returned.
  90743. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90744. gensupport.SetOptions(c.urlParams_, opts...)
  90745. res, err := c.doRequest("json")
  90746. if res != nil && res.StatusCode == http.StatusNotModified {
  90747. if res.Body != nil {
  90748. res.Body.Close()
  90749. }
  90750. return nil, &googleapi.Error{
  90751. Code: res.StatusCode,
  90752. Header: res.Header,
  90753. }
  90754. }
  90755. if err != nil {
  90756. return nil, err
  90757. }
  90758. defer googleapi.CloseBody(res)
  90759. if err := googleapi.CheckResponse(res); err != nil {
  90760. return nil, err
  90761. }
  90762. ret := &Operation{
  90763. ServerResponse: googleapi.ServerResponse{
  90764. Header: res.Header,
  90765. HTTPStatusCode: res.StatusCode,
  90766. },
  90767. }
  90768. target := &ret
  90769. if err := gensupport.DecodeResponse(target, res); err != nil {
  90770. return nil, err
  90771. }
  90772. return ret, nil
  90773. // {
  90774. // "description": "Changes the BackendService for TargetSslProxy.",
  90775. // "httpMethod": "POST",
  90776. // "id": "compute.targetSslProxies.setBackendService",
  90777. // "parameterOrder": [
  90778. // "project",
  90779. // "targetSslProxy"
  90780. // ],
  90781. // "parameters": {
  90782. // "project": {
  90783. // "description": "Project ID for this request.",
  90784. // "location": "path",
  90785. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90786. // "required": true,
  90787. // "type": "string"
  90788. // },
  90789. // "requestId": {
  90790. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90791. // "location": "query",
  90792. // "type": "string"
  90793. // },
  90794. // "targetSslProxy": {
  90795. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  90796. // "location": "path",
  90797. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90798. // "required": true,
  90799. // "type": "string"
  90800. // }
  90801. // },
  90802. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  90803. // "request": {
  90804. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  90805. // },
  90806. // "response": {
  90807. // "$ref": "Operation"
  90808. // },
  90809. // "scopes": [
  90810. // "https://www.googleapis.com/auth/cloud-platform",
  90811. // "https://www.googleapis.com/auth/compute"
  90812. // ]
  90813. // }
  90814. }
  90815. // method id "compute.targetSslProxies.setProxyHeader":
  90816. type TargetSslProxiesSetProxyHeaderCall struct {
  90817. s *Service
  90818. project string
  90819. targetSslProxy string
  90820. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  90821. urlParams_ gensupport.URLParams
  90822. ctx_ context.Context
  90823. header_ http.Header
  90824. }
  90825. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  90826. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  90827. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90828. c.project = project
  90829. c.targetSslProxy = targetSslProxy
  90830. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  90831. return c
  90832. }
  90833. // RequestId sets the optional parameter "requestId": An optional
  90834. // request ID to identify requests. Specify a unique request ID so that
  90835. // if you must retry your request, the server will know to ignore the
  90836. // request if it has already been completed.
  90837. //
  90838. // For example, consider a situation where you make an initial request
  90839. // and the request times out. If you make the request again with the
  90840. // same request ID, the server can check if original operation with the
  90841. // same request ID was received, and if so, will ignore the second
  90842. // request. This prevents clients from accidentally creating duplicate
  90843. // commitments.
  90844. //
  90845. // The request ID must be a valid UUID with the exception that zero UUID
  90846. // is not supported (00000000-0000-0000-0000-000000000000).
  90847. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  90848. c.urlParams_.Set("requestId", requestId)
  90849. return c
  90850. }
  90851. // Fields allows partial responses to be retrieved. See
  90852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90853. // for more information.
  90854. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  90855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90856. return c
  90857. }
  90858. // Context sets the context to be used in this call's Do method. Any
  90859. // pending HTTP request will be aborted if the provided context is
  90860. // canceled.
  90861. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  90862. c.ctx_ = ctx
  90863. return c
  90864. }
  90865. // Header returns an http.Header that can be modified by the caller to
  90866. // add HTTP headers to the request.
  90867. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  90868. if c.header_ == nil {
  90869. c.header_ = make(http.Header)
  90870. }
  90871. return c.header_
  90872. }
  90873. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  90874. reqHeaders := make(http.Header)
  90875. for k, v := range c.header_ {
  90876. reqHeaders[k] = v
  90877. }
  90878. reqHeaders.Set("User-Agent", c.s.userAgent())
  90879. var body io.Reader = nil
  90880. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  90881. if err != nil {
  90882. return nil, err
  90883. }
  90884. reqHeaders.Set("Content-Type", "application/json")
  90885. c.urlParams_.Set("alt", alt)
  90886. c.urlParams_.Set("prettyPrint", "false")
  90887. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  90888. urls += "?" + c.urlParams_.Encode()
  90889. req, err := http.NewRequest("POST", urls, body)
  90890. if err != nil {
  90891. return nil, err
  90892. }
  90893. req.Header = reqHeaders
  90894. googleapi.Expand(req.URL, map[string]string{
  90895. "project": c.project,
  90896. "targetSslProxy": c.targetSslProxy,
  90897. })
  90898. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90899. }
  90900. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  90901. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90902. // status code is an error. Response headers are in either
  90903. // *Operation.ServerResponse.Header or (if a response was returned at
  90904. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90905. // to check whether the returned error was because
  90906. // http.StatusNotModified was returned.
  90907. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90908. gensupport.SetOptions(c.urlParams_, opts...)
  90909. res, err := c.doRequest("json")
  90910. if res != nil && res.StatusCode == http.StatusNotModified {
  90911. if res.Body != nil {
  90912. res.Body.Close()
  90913. }
  90914. return nil, &googleapi.Error{
  90915. Code: res.StatusCode,
  90916. Header: res.Header,
  90917. }
  90918. }
  90919. if err != nil {
  90920. return nil, err
  90921. }
  90922. defer googleapi.CloseBody(res)
  90923. if err := googleapi.CheckResponse(res); err != nil {
  90924. return nil, err
  90925. }
  90926. ret := &Operation{
  90927. ServerResponse: googleapi.ServerResponse{
  90928. Header: res.Header,
  90929. HTTPStatusCode: res.StatusCode,
  90930. },
  90931. }
  90932. target := &ret
  90933. if err := gensupport.DecodeResponse(target, res); err != nil {
  90934. return nil, err
  90935. }
  90936. return ret, nil
  90937. // {
  90938. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  90939. // "httpMethod": "POST",
  90940. // "id": "compute.targetSslProxies.setProxyHeader",
  90941. // "parameterOrder": [
  90942. // "project",
  90943. // "targetSslProxy"
  90944. // ],
  90945. // "parameters": {
  90946. // "project": {
  90947. // "description": "Project ID for this request.",
  90948. // "location": "path",
  90949. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90950. // "required": true,
  90951. // "type": "string"
  90952. // },
  90953. // "requestId": {
  90954. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90955. // "location": "query",
  90956. // "type": "string"
  90957. // },
  90958. // "targetSslProxy": {
  90959. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  90960. // "location": "path",
  90961. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90962. // "required": true,
  90963. // "type": "string"
  90964. // }
  90965. // },
  90966. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  90967. // "request": {
  90968. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  90969. // },
  90970. // "response": {
  90971. // "$ref": "Operation"
  90972. // },
  90973. // "scopes": [
  90974. // "https://www.googleapis.com/auth/cloud-platform",
  90975. // "https://www.googleapis.com/auth/compute"
  90976. // ]
  90977. // }
  90978. }
  90979. // method id "compute.targetSslProxies.setSslCertificates":
  90980. type TargetSslProxiesSetSslCertificatesCall struct {
  90981. s *Service
  90982. project string
  90983. targetSslProxy string
  90984. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  90985. urlParams_ gensupport.URLParams
  90986. ctx_ context.Context
  90987. header_ http.Header
  90988. }
  90989. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  90990. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  90991. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90992. c.project = project
  90993. c.targetSslProxy = targetSslProxy
  90994. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  90995. return c
  90996. }
  90997. // RequestId sets the optional parameter "requestId": An optional
  90998. // request ID to identify requests. Specify a unique request ID so that
  90999. // if you must retry your request, the server will know to ignore the
  91000. // request if it has already been completed.
  91001. //
  91002. // For example, consider a situation where you make an initial request
  91003. // and the request times out. If you make the request again with the
  91004. // same request ID, the server can check if original operation with the
  91005. // same request ID was received, and if so, will ignore the second
  91006. // request. This prevents clients from accidentally creating duplicate
  91007. // commitments.
  91008. //
  91009. // The request ID must be a valid UUID with the exception that zero UUID
  91010. // is not supported (00000000-0000-0000-0000-000000000000).
  91011. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  91012. c.urlParams_.Set("requestId", requestId)
  91013. return c
  91014. }
  91015. // Fields allows partial responses to be retrieved. See
  91016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91017. // for more information.
  91018. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  91019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91020. return c
  91021. }
  91022. // Context sets the context to be used in this call's Do method. Any
  91023. // pending HTTP request will be aborted if the provided context is
  91024. // canceled.
  91025. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  91026. c.ctx_ = ctx
  91027. return c
  91028. }
  91029. // Header returns an http.Header that can be modified by the caller to
  91030. // add HTTP headers to the request.
  91031. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  91032. if c.header_ == nil {
  91033. c.header_ = make(http.Header)
  91034. }
  91035. return c.header_
  91036. }
  91037. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  91038. reqHeaders := make(http.Header)
  91039. for k, v := range c.header_ {
  91040. reqHeaders[k] = v
  91041. }
  91042. reqHeaders.Set("User-Agent", c.s.userAgent())
  91043. var body io.Reader = nil
  91044. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  91045. if err != nil {
  91046. return nil, err
  91047. }
  91048. reqHeaders.Set("Content-Type", "application/json")
  91049. c.urlParams_.Set("alt", alt)
  91050. c.urlParams_.Set("prettyPrint", "false")
  91051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  91052. urls += "?" + c.urlParams_.Encode()
  91053. req, err := http.NewRequest("POST", urls, body)
  91054. if err != nil {
  91055. return nil, err
  91056. }
  91057. req.Header = reqHeaders
  91058. googleapi.Expand(req.URL, map[string]string{
  91059. "project": c.project,
  91060. "targetSslProxy": c.targetSslProxy,
  91061. })
  91062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91063. }
  91064. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  91065. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91066. // status code is an error. Response headers are in either
  91067. // *Operation.ServerResponse.Header or (if a response was returned at
  91068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91069. // to check whether the returned error was because
  91070. // http.StatusNotModified was returned.
  91071. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91072. gensupport.SetOptions(c.urlParams_, opts...)
  91073. res, err := c.doRequest("json")
  91074. if res != nil && res.StatusCode == http.StatusNotModified {
  91075. if res.Body != nil {
  91076. res.Body.Close()
  91077. }
  91078. return nil, &googleapi.Error{
  91079. Code: res.StatusCode,
  91080. Header: res.Header,
  91081. }
  91082. }
  91083. if err != nil {
  91084. return nil, err
  91085. }
  91086. defer googleapi.CloseBody(res)
  91087. if err := googleapi.CheckResponse(res); err != nil {
  91088. return nil, err
  91089. }
  91090. ret := &Operation{
  91091. ServerResponse: googleapi.ServerResponse{
  91092. Header: res.Header,
  91093. HTTPStatusCode: res.StatusCode,
  91094. },
  91095. }
  91096. target := &ret
  91097. if err := gensupport.DecodeResponse(target, res); err != nil {
  91098. return nil, err
  91099. }
  91100. return ret, nil
  91101. // {
  91102. // "description": "Changes SslCertificates for TargetSslProxy.",
  91103. // "httpMethod": "POST",
  91104. // "id": "compute.targetSslProxies.setSslCertificates",
  91105. // "parameterOrder": [
  91106. // "project",
  91107. // "targetSslProxy"
  91108. // ],
  91109. // "parameters": {
  91110. // "project": {
  91111. // "description": "Project ID for this request.",
  91112. // "location": "path",
  91113. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91114. // "required": true,
  91115. // "type": "string"
  91116. // },
  91117. // "requestId": {
  91118. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91119. // "location": "query",
  91120. // "type": "string"
  91121. // },
  91122. // "targetSslProxy": {
  91123. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  91124. // "location": "path",
  91125. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91126. // "required": true,
  91127. // "type": "string"
  91128. // }
  91129. // },
  91130. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  91131. // "request": {
  91132. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  91133. // },
  91134. // "response": {
  91135. // "$ref": "Operation"
  91136. // },
  91137. // "scopes": [
  91138. // "https://www.googleapis.com/auth/cloud-platform",
  91139. // "https://www.googleapis.com/auth/compute"
  91140. // ]
  91141. // }
  91142. }
  91143. // method id "compute.targetSslProxies.setSslPolicy":
  91144. type TargetSslProxiesSetSslPolicyCall struct {
  91145. s *Service
  91146. project string
  91147. targetSslProxy string
  91148. sslpolicyreference *SslPolicyReference
  91149. urlParams_ gensupport.URLParams
  91150. ctx_ context.Context
  91151. header_ http.Header
  91152. }
  91153. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  91154. // specifies the server-side support for SSL features. This affects
  91155. // connections between clients and the SSL proxy load balancer. They do
  91156. // not affect the connection between the load balancer and the backends.
  91157. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  91158. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91159. c.project = project
  91160. c.targetSslProxy = targetSslProxy
  91161. c.sslpolicyreference = sslpolicyreference
  91162. return c
  91163. }
  91164. // RequestId sets the optional parameter "requestId": An optional
  91165. // request ID to identify requests. Specify a unique request ID so that
  91166. // if you must retry your request, the server will know to ignore the
  91167. // request if it has already been completed.
  91168. //
  91169. // For example, consider a situation where you make an initial request
  91170. // and the request times out. If you make the request again with the
  91171. // same request ID, the server can check if original operation with the
  91172. // same request ID was received, and if so, will ignore the second
  91173. // request. This prevents clients from accidentally creating duplicate
  91174. // commitments.
  91175. //
  91176. // The request ID must be a valid UUID with the exception that zero UUID
  91177. // is not supported (00000000-0000-0000-0000-000000000000).
  91178. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  91179. c.urlParams_.Set("requestId", requestId)
  91180. return c
  91181. }
  91182. // Fields allows partial responses to be retrieved. See
  91183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91184. // for more information.
  91185. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  91186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91187. return c
  91188. }
  91189. // Context sets the context to be used in this call's Do method. Any
  91190. // pending HTTP request will be aborted if the provided context is
  91191. // canceled.
  91192. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  91193. c.ctx_ = ctx
  91194. return c
  91195. }
  91196. // Header returns an http.Header that can be modified by the caller to
  91197. // add HTTP headers to the request.
  91198. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  91199. if c.header_ == nil {
  91200. c.header_ = make(http.Header)
  91201. }
  91202. return c.header_
  91203. }
  91204. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  91205. reqHeaders := make(http.Header)
  91206. for k, v := range c.header_ {
  91207. reqHeaders[k] = v
  91208. }
  91209. reqHeaders.Set("User-Agent", c.s.userAgent())
  91210. var body io.Reader = nil
  91211. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  91212. if err != nil {
  91213. return nil, err
  91214. }
  91215. reqHeaders.Set("Content-Type", "application/json")
  91216. c.urlParams_.Set("alt", alt)
  91217. c.urlParams_.Set("prettyPrint", "false")
  91218. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  91219. urls += "?" + c.urlParams_.Encode()
  91220. req, err := http.NewRequest("POST", urls, body)
  91221. if err != nil {
  91222. return nil, err
  91223. }
  91224. req.Header = reqHeaders
  91225. googleapi.Expand(req.URL, map[string]string{
  91226. "project": c.project,
  91227. "targetSslProxy": c.targetSslProxy,
  91228. })
  91229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91230. }
  91231. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  91232. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91233. // status code is an error. Response headers are in either
  91234. // *Operation.ServerResponse.Header or (if a response was returned at
  91235. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91236. // to check whether the returned error was because
  91237. // http.StatusNotModified was returned.
  91238. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91239. gensupport.SetOptions(c.urlParams_, opts...)
  91240. res, err := c.doRequest("json")
  91241. if res != nil && res.StatusCode == http.StatusNotModified {
  91242. if res.Body != nil {
  91243. res.Body.Close()
  91244. }
  91245. return nil, &googleapi.Error{
  91246. Code: res.StatusCode,
  91247. Header: res.Header,
  91248. }
  91249. }
  91250. if err != nil {
  91251. return nil, err
  91252. }
  91253. defer googleapi.CloseBody(res)
  91254. if err := googleapi.CheckResponse(res); err != nil {
  91255. return nil, err
  91256. }
  91257. ret := &Operation{
  91258. ServerResponse: googleapi.ServerResponse{
  91259. Header: res.Header,
  91260. HTTPStatusCode: res.StatusCode,
  91261. },
  91262. }
  91263. target := &ret
  91264. if err := gensupport.DecodeResponse(target, res); err != nil {
  91265. return nil, err
  91266. }
  91267. return ret, nil
  91268. // {
  91269. // "description": "Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.",
  91270. // "httpMethod": "POST",
  91271. // "id": "compute.targetSslProxies.setSslPolicy",
  91272. // "parameterOrder": [
  91273. // "project",
  91274. // "targetSslProxy"
  91275. // ],
  91276. // "parameters": {
  91277. // "project": {
  91278. // "description": "Project ID for this request.",
  91279. // "location": "path",
  91280. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91281. // "required": true,
  91282. // "type": "string"
  91283. // },
  91284. // "requestId": {
  91285. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91286. // "location": "query",
  91287. // "type": "string"
  91288. // },
  91289. // "targetSslProxy": {
  91290. // "description": "Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
  91291. // "location": "path",
  91292. // "required": true,
  91293. // "type": "string"
  91294. // }
  91295. // },
  91296. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  91297. // "request": {
  91298. // "$ref": "SslPolicyReference"
  91299. // },
  91300. // "response": {
  91301. // "$ref": "Operation"
  91302. // },
  91303. // "scopes": [
  91304. // "https://www.googleapis.com/auth/cloud-platform",
  91305. // "https://www.googleapis.com/auth/compute"
  91306. // ]
  91307. // }
  91308. }
  91309. // method id "compute.targetTcpProxies.delete":
  91310. type TargetTcpProxiesDeleteCall struct {
  91311. s *Service
  91312. project string
  91313. targetTcpProxy string
  91314. urlParams_ gensupport.URLParams
  91315. ctx_ context.Context
  91316. header_ http.Header
  91317. }
  91318. // Delete: Deletes the specified TargetTcpProxy resource.
  91319. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  91320. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91321. c.project = project
  91322. c.targetTcpProxy = targetTcpProxy
  91323. return c
  91324. }
  91325. // RequestId sets the optional parameter "requestId": An optional
  91326. // request ID to identify requests. Specify a unique request ID so that
  91327. // if you must retry your request, the server will know to ignore the
  91328. // request if it has already been completed.
  91329. //
  91330. // For example, consider a situation where you make an initial request
  91331. // and the request times out. If you make the request again with the
  91332. // same request ID, the server can check if original operation with the
  91333. // same request ID was received, and if so, will ignore the second
  91334. // request. This prevents clients from accidentally creating duplicate
  91335. // commitments.
  91336. //
  91337. // The request ID must be a valid UUID with the exception that zero UUID
  91338. // is not supported (00000000-0000-0000-0000-000000000000).
  91339. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  91340. c.urlParams_.Set("requestId", requestId)
  91341. return c
  91342. }
  91343. // Fields allows partial responses to be retrieved. See
  91344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91345. // for more information.
  91346. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  91347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91348. return c
  91349. }
  91350. // Context sets the context to be used in this call's Do method. Any
  91351. // pending HTTP request will be aborted if the provided context is
  91352. // canceled.
  91353. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  91354. c.ctx_ = ctx
  91355. return c
  91356. }
  91357. // Header returns an http.Header that can be modified by the caller to
  91358. // add HTTP headers to the request.
  91359. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  91360. if c.header_ == nil {
  91361. c.header_ = make(http.Header)
  91362. }
  91363. return c.header_
  91364. }
  91365. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  91366. reqHeaders := make(http.Header)
  91367. for k, v := range c.header_ {
  91368. reqHeaders[k] = v
  91369. }
  91370. reqHeaders.Set("User-Agent", c.s.userAgent())
  91371. var body io.Reader = nil
  91372. c.urlParams_.Set("alt", alt)
  91373. c.urlParams_.Set("prettyPrint", "false")
  91374. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  91375. urls += "?" + c.urlParams_.Encode()
  91376. req, err := http.NewRequest("DELETE", urls, body)
  91377. if err != nil {
  91378. return nil, err
  91379. }
  91380. req.Header = reqHeaders
  91381. googleapi.Expand(req.URL, map[string]string{
  91382. "project": c.project,
  91383. "targetTcpProxy": c.targetTcpProxy,
  91384. })
  91385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91386. }
  91387. // Do executes the "compute.targetTcpProxies.delete" call.
  91388. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91389. // status code is an error. Response headers are in either
  91390. // *Operation.ServerResponse.Header or (if a response was returned at
  91391. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91392. // to check whether the returned error was because
  91393. // http.StatusNotModified was returned.
  91394. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91395. gensupport.SetOptions(c.urlParams_, opts...)
  91396. res, err := c.doRequest("json")
  91397. if res != nil && res.StatusCode == http.StatusNotModified {
  91398. if res.Body != nil {
  91399. res.Body.Close()
  91400. }
  91401. return nil, &googleapi.Error{
  91402. Code: res.StatusCode,
  91403. Header: res.Header,
  91404. }
  91405. }
  91406. if err != nil {
  91407. return nil, err
  91408. }
  91409. defer googleapi.CloseBody(res)
  91410. if err := googleapi.CheckResponse(res); err != nil {
  91411. return nil, err
  91412. }
  91413. ret := &Operation{
  91414. ServerResponse: googleapi.ServerResponse{
  91415. Header: res.Header,
  91416. HTTPStatusCode: res.StatusCode,
  91417. },
  91418. }
  91419. target := &ret
  91420. if err := gensupport.DecodeResponse(target, res); err != nil {
  91421. return nil, err
  91422. }
  91423. return ret, nil
  91424. // {
  91425. // "description": "Deletes the specified TargetTcpProxy resource.",
  91426. // "httpMethod": "DELETE",
  91427. // "id": "compute.targetTcpProxies.delete",
  91428. // "parameterOrder": [
  91429. // "project",
  91430. // "targetTcpProxy"
  91431. // ],
  91432. // "parameters": {
  91433. // "project": {
  91434. // "description": "Project ID for this request.",
  91435. // "location": "path",
  91436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91437. // "required": true,
  91438. // "type": "string"
  91439. // },
  91440. // "requestId": {
  91441. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91442. // "location": "query",
  91443. // "type": "string"
  91444. // },
  91445. // "targetTcpProxy": {
  91446. // "description": "Name of the TargetTcpProxy resource to delete.",
  91447. // "location": "path",
  91448. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91449. // "required": true,
  91450. // "type": "string"
  91451. // }
  91452. // },
  91453. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  91454. // "response": {
  91455. // "$ref": "Operation"
  91456. // },
  91457. // "scopes": [
  91458. // "https://www.googleapis.com/auth/cloud-platform",
  91459. // "https://www.googleapis.com/auth/compute"
  91460. // ]
  91461. // }
  91462. }
  91463. // method id "compute.targetTcpProxies.get":
  91464. type TargetTcpProxiesGetCall struct {
  91465. s *Service
  91466. project string
  91467. targetTcpProxy string
  91468. urlParams_ gensupport.URLParams
  91469. ifNoneMatch_ string
  91470. ctx_ context.Context
  91471. header_ http.Header
  91472. }
  91473. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  91474. // available target TCP proxies by making a list() request.
  91475. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  91476. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91477. c.project = project
  91478. c.targetTcpProxy = targetTcpProxy
  91479. return c
  91480. }
  91481. // Fields allows partial responses to be retrieved. See
  91482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91483. // for more information.
  91484. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  91485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91486. return c
  91487. }
  91488. // IfNoneMatch sets the optional parameter which makes the operation
  91489. // fail if the object's ETag matches the given value. This is useful for
  91490. // getting updates only after the object has changed since the last
  91491. // request. Use googleapi.IsNotModified to check whether the response
  91492. // error from Do is the result of In-None-Match.
  91493. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  91494. c.ifNoneMatch_ = entityTag
  91495. return c
  91496. }
  91497. // Context sets the context to be used in this call's Do method. Any
  91498. // pending HTTP request will be aborted if the provided context is
  91499. // canceled.
  91500. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  91501. c.ctx_ = ctx
  91502. return c
  91503. }
  91504. // Header returns an http.Header that can be modified by the caller to
  91505. // add HTTP headers to the request.
  91506. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  91507. if c.header_ == nil {
  91508. c.header_ = make(http.Header)
  91509. }
  91510. return c.header_
  91511. }
  91512. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  91513. reqHeaders := make(http.Header)
  91514. for k, v := range c.header_ {
  91515. reqHeaders[k] = v
  91516. }
  91517. reqHeaders.Set("User-Agent", c.s.userAgent())
  91518. if c.ifNoneMatch_ != "" {
  91519. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91520. }
  91521. var body io.Reader = nil
  91522. c.urlParams_.Set("alt", alt)
  91523. c.urlParams_.Set("prettyPrint", "false")
  91524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  91525. urls += "?" + c.urlParams_.Encode()
  91526. req, err := http.NewRequest("GET", urls, body)
  91527. if err != nil {
  91528. return nil, err
  91529. }
  91530. req.Header = reqHeaders
  91531. googleapi.Expand(req.URL, map[string]string{
  91532. "project": c.project,
  91533. "targetTcpProxy": c.targetTcpProxy,
  91534. })
  91535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91536. }
  91537. // Do executes the "compute.targetTcpProxies.get" call.
  91538. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  91539. // status code is an error. Response headers are in either
  91540. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  91541. // at all) in error.(*googleapi.Error).Header. Use
  91542. // googleapi.IsNotModified to check whether the returned error was
  91543. // because http.StatusNotModified was returned.
  91544. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  91545. gensupport.SetOptions(c.urlParams_, opts...)
  91546. res, err := c.doRequest("json")
  91547. if res != nil && res.StatusCode == http.StatusNotModified {
  91548. if res.Body != nil {
  91549. res.Body.Close()
  91550. }
  91551. return nil, &googleapi.Error{
  91552. Code: res.StatusCode,
  91553. Header: res.Header,
  91554. }
  91555. }
  91556. if err != nil {
  91557. return nil, err
  91558. }
  91559. defer googleapi.CloseBody(res)
  91560. if err := googleapi.CheckResponse(res); err != nil {
  91561. return nil, err
  91562. }
  91563. ret := &TargetTcpProxy{
  91564. ServerResponse: googleapi.ServerResponse{
  91565. Header: res.Header,
  91566. HTTPStatusCode: res.StatusCode,
  91567. },
  91568. }
  91569. target := &ret
  91570. if err := gensupport.DecodeResponse(target, res); err != nil {
  91571. return nil, err
  91572. }
  91573. return ret, nil
  91574. // {
  91575. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  91576. // "httpMethod": "GET",
  91577. // "id": "compute.targetTcpProxies.get",
  91578. // "parameterOrder": [
  91579. // "project",
  91580. // "targetTcpProxy"
  91581. // ],
  91582. // "parameters": {
  91583. // "project": {
  91584. // "description": "Project ID for this request.",
  91585. // "location": "path",
  91586. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91587. // "required": true,
  91588. // "type": "string"
  91589. // },
  91590. // "targetTcpProxy": {
  91591. // "description": "Name of the TargetTcpProxy resource to return.",
  91592. // "location": "path",
  91593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91594. // "required": true,
  91595. // "type": "string"
  91596. // }
  91597. // },
  91598. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  91599. // "response": {
  91600. // "$ref": "TargetTcpProxy"
  91601. // },
  91602. // "scopes": [
  91603. // "https://www.googleapis.com/auth/cloud-platform",
  91604. // "https://www.googleapis.com/auth/compute",
  91605. // "https://www.googleapis.com/auth/compute.readonly"
  91606. // ]
  91607. // }
  91608. }
  91609. // method id "compute.targetTcpProxies.insert":
  91610. type TargetTcpProxiesInsertCall struct {
  91611. s *Service
  91612. project string
  91613. targettcpproxy *TargetTcpProxy
  91614. urlParams_ gensupport.URLParams
  91615. ctx_ context.Context
  91616. header_ http.Header
  91617. }
  91618. // Insert: Creates a TargetTcpProxy resource in the specified project
  91619. // using the data included in the request.
  91620. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  91621. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91622. c.project = project
  91623. c.targettcpproxy = targettcpproxy
  91624. return c
  91625. }
  91626. // RequestId sets the optional parameter "requestId": An optional
  91627. // request ID to identify requests. Specify a unique request ID so that
  91628. // if you must retry your request, the server will know to ignore the
  91629. // request if it has already been completed.
  91630. //
  91631. // For example, consider a situation where you make an initial request
  91632. // and the request times out. If you make the request again with the
  91633. // same request ID, the server can check if original operation with the
  91634. // same request ID was received, and if so, will ignore the second
  91635. // request. This prevents clients from accidentally creating duplicate
  91636. // commitments.
  91637. //
  91638. // The request ID must be a valid UUID with the exception that zero UUID
  91639. // is not supported (00000000-0000-0000-0000-000000000000).
  91640. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  91641. c.urlParams_.Set("requestId", requestId)
  91642. return c
  91643. }
  91644. // Fields allows partial responses to be retrieved. See
  91645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91646. // for more information.
  91647. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  91648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91649. return c
  91650. }
  91651. // Context sets the context to be used in this call's Do method. Any
  91652. // pending HTTP request will be aborted if the provided context is
  91653. // canceled.
  91654. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  91655. c.ctx_ = ctx
  91656. return c
  91657. }
  91658. // Header returns an http.Header that can be modified by the caller to
  91659. // add HTTP headers to the request.
  91660. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  91661. if c.header_ == nil {
  91662. c.header_ = make(http.Header)
  91663. }
  91664. return c.header_
  91665. }
  91666. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  91667. reqHeaders := make(http.Header)
  91668. for k, v := range c.header_ {
  91669. reqHeaders[k] = v
  91670. }
  91671. reqHeaders.Set("User-Agent", c.s.userAgent())
  91672. var body io.Reader = nil
  91673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  91674. if err != nil {
  91675. return nil, err
  91676. }
  91677. reqHeaders.Set("Content-Type", "application/json")
  91678. c.urlParams_.Set("alt", alt)
  91679. c.urlParams_.Set("prettyPrint", "false")
  91680. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  91681. urls += "?" + c.urlParams_.Encode()
  91682. req, err := http.NewRequest("POST", urls, body)
  91683. if err != nil {
  91684. return nil, err
  91685. }
  91686. req.Header = reqHeaders
  91687. googleapi.Expand(req.URL, map[string]string{
  91688. "project": c.project,
  91689. })
  91690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91691. }
  91692. // Do executes the "compute.targetTcpProxies.insert" call.
  91693. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91694. // status code is an error. Response headers are in either
  91695. // *Operation.ServerResponse.Header or (if a response was returned at
  91696. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91697. // to check whether the returned error was because
  91698. // http.StatusNotModified was returned.
  91699. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91700. gensupport.SetOptions(c.urlParams_, opts...)
  91701. res, err := c.doRequest("json")
  91702. if res != nil && res.StatusCode == http.StatusNotModified {
  91703. if res.Body != nil {
  91704. res.Body.Close()
  91705. }
  91706. return nil, &googleapi.Error{
  91707. Code: res.StatusCode,
  91708. Header: res.Header,
  91709. }
  91710. }
  91711. if err != nil {
  91712. return nil, err
  91713. }
  91714. defer googleapi.CloseBody(res)
  91715. if err := googleapi.CheckResponse(res); err != nil {
  91716. return nil, err
  91717. }
  91718. ret := &Operation{
  91719. ServerResponse: googleapi.ServerResponse{
  91720. Header: res.Header,
  91721. HTTPStatusCode: res.StatusCode,
  91722. },
  91723. }
  91724. target := &ret
  91725. if err := gensupport.DecodeResponse(target, res); err != nil {
  91726. return nil, err
  91727. }
  91728. return ret, nil
  91729. // {
  91730. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  91731. // "httpMethod": "POST",
  91732. // "id": "compute.targetTcpProxies.insert",
  91733. // "parameterOrder": [
  91734. // "project"
  91735. // ],
  91736. // "parameters": {
  91737. // "project": {
  91738. // "description": "Project ID for this request.",
  91739. // "location": "path",
  91740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91741. // "required": true,
  91742. // "type": "string"
  91743. // },
  91744. // "requestId": {
  91745. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91746. // "location": "query",
  91747. // "type": "string"
  91748. // }
  91749. // },
  91750. // "path": "{project}/global/targetTcpProxies",
  91751. // "request": {
  91752. // "$ref": "TargetTcpProxy"
  91753. // },
  91754. // "response": {
  91755. // "$ref": "Operation"
  91756. // },
  91757. // "scopes": [
  91758. // "https://www.googleapis.com/auth/cloud-platform",
  91759. // "https://www.googleapis.com/auth/compute"
  91760. // ]
  91761. // }
  91762. }
  91763. // method id "compute.targetTcpProxies.list":
  91764. type TargetTcpProxiesListCall struct {
  91765. s *Service
  91766. project string
  91767. urlParams_ gensupport.URLParams
  91768. ifNoneMatch_ string
  91769. ctx_ context.Context
  91770. header_ http.Header
  91771. }
  91772. // List: Retrieves the list of TargetTcpProxy resources available to the
  91773. // specified project.
  91774. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  91775. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91776. c.project = project
  91777. return c
  91778. }
  91779. // Filter sets the optional parameter "filter": A filter expression that
  91780. // filters resources listed in the response. The expression must specify
  91781. // the field name, a comparison operator, and the value that you want to
  91782. // use for filtering. The value must be a string, a number, or a
  91783. // boolean. The comparison operator must be either =, !=, >, or <.
  91784. //
  91785. // For example, if you are filtering Compute Engine instances, you can
  91786. // exclude instances named example-instance by specifying name !=
  91787. // example-instance.
  91788. //
  91789. // You can also filter nested fields. For example, you could specify
  91790. // scheduling.automaticRestart = false to include instances only if they
  91791. // are not scheduled for automatic restarts. You can use filtering on
  91792. // nested fields to filter based on resource labels.
  91793. //
  91794. // To filter on multiple expressions, provide each separate expression
  91795. // within parentheses. For example, (scheduling.automaticRestart = true)
  91796. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91797. // AND expression. However, you can include AND and OR expressions
  91798. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91799. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91800. // true).
  91801. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  91802. c.urlParams_.Set("filter", filter)
  91803. return c
  91804. }
  91805. // MaxResults sets the optional parameter "maxResults": The maximum
  91806. // number of results per page that should be returned. If the number of
  91807. // available results is larger than maxResults, Compute Engine returns a
  91808. // nextPageToken that can be used to get the next page of results in
  91809. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91810. // (Default: 500)
  91811. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  91812. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91813. return c
  91814. }
  91815. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91816. // a certain order. By default, results are returned in alphanumerical
  91817. // order based on the resource name.
  91818. //
  91819. // You can also sort results in descending order based on the creation
  91820. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91821. // based on the creationTimestamp field in reverse chronological order
  91822. // (newest result first). Use this to sort resources like operations so
  91823. // that the newest operation is returned first.
  91824. //
  91825. // Currently, only sorting by name or creationTimestamp desc is
  91826. // supported.
  91827. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  91828. c.urlParams_.Set("orderBy", orderBy)
  91829. return c
  91830. }
  91831. // PageToken sets the optional parameter "pageToken": Specifies a page
  91832. // token to use. Set pageToken to the nextPageToken returned by a
  91833. // previous list request to get the next page of results.
  91834. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  91835. c.urlParams_.Set("pageToken", pageToken)
  91836. return c
  91837. }
  91838. // Fields allows partial responses to be retrieved. See
  91839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91840. // for more information.
  91841. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  91842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91843. return c
  91844. }
  91845. // IfNoneMatch sets the optional parameter which makes the operation
  91846. // fail if the object's ETag matches the given value. This is useful for
  91847. // getting updates only after the object has changed since the last
  91848. // request. Use googleapi.IsNotModified to check whether the response
  91849. // error from Do is the result of In-None-Match.
  91850. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  91851. c.ifNoneMatch_ = entityTag
  91852. return c
  91853. }
  91854. // Context sets the context to be used in this call's Do method. Any
  91855. // pending HTTP request will be aborted if the provided context is
  91856. // canceled.
  91857. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  91858. c.ctx_ = ctx
  91859. return c
  91860. }
  91861. // Header returns an http.Header that can be modified by the caller to
  91862. // add HTTP headers to the request.
  91863. func (c *TargetTcpProxiesListCall) Header() http.Header {
  91864. if c.header_ == nil {
  91865. c.header_ = make(http.Header)
  91866. }
  91867. return c.header_
  91868. }
  91869. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  91870. reqHeaders := make(http.Header)
  91871. for k, v := range c.header_ {
  91872. reqHeaders[k] = v
  91873. }
  91874. reqHeaders.Set("User-Agent", c.s.userAgent())
  91875. if c.ifNoneMatch_ != "" {
  91876. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91877. }
  91878. var body io.Reader = nil
  91879. c.urlParams_.Set("alt", alt)
  91880. c.urlParams_.Set("prettyPrint", "false")
  91881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  91882. urls += "?" + c.urlParams_.Encode()
  91883. req, err := http.NewRequest("GET", urls, body)
  91884. if err != nil {
  91885. return nil, err
  91886. }
  91887. req.Header = reqHeaders
  91888. googleapi.Expand(req.URL, map[string]string{
  91889. "project": c.project,
  91890. })
  91891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91892. }
  91893. // Do executes the "compute.targetTcpProxies.list" call.
  91894. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  91895. // non-2xx status code is an error. Response headers are in either
  91896. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  91897. // returned at all) in error.(*googleapi.Error).Header. Use
  91898. // googleapi.IsNotModified to check whether the returned error was
  91899. // because http.StatusNotModified was returned.
  91900. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  91901. gensupport.SetOptions(c.urlParams_, opts...)
  91902. res, err := c.doRequest("json")
  91903. if res != nil && res.StatusCode == http.StatusNotModified {
  91904. if res.Body != nil {
  91905. res.Body.Close()
  91906. }
  91907. return nil, &googleapi.Error{
  91908. Code: res.StatusCode,
  91909. Header: res.Header,
  91910. }
  91911. }
  91912. if err != nil {
  91913. return nil, err
  91914. }
  91915. defer googleapi.CloseBody(res)
  91916. if err := googleapi.CheckResponse(res); err != nil {
  91917. return nil, err
  91918. }
  91919. ret := &TargetTcpProxyList{
  91920. ServerResponse: googleapi.ServerResponse{
  91921. Header: res.Header,
  91922. HTTPStatusCode: res.StatusCode,
  91923. },
  91924. }
  91925. target := &ret
  91926. if err := gensupport.DecodeResponse(target, res); err != nil {
  91927. return nil, err
  91928. }
  91929. return ret, nil
  91930. // {
  91931. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  91932. // "httpMethod": "GET",
  91933. // "id": "compute.targetTcpProxies.list",
  91934. // "parameterOrder": [
  91935. // "project"
  91936. // ],
  91937. // "parameters": {
  91938. // "filter": {
  91939. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  91940. // "location": "query",
  91941. // "type": "string"
  91942. // },
  91943. // "maxResults": {
  91944. // "default": "500",
  91945. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  91946. // "format": "uint32",
  91947. // "location": "query",
  91948. // "minimum": "0",
  91949. // "type": "integer"
  91950. // },
  91951. // "orderBy": {
  91952. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  91953. // "location": "query",
  91954. // "type": "string"
  91955. // },
  91956. // "pageToken": {
  91957. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  91958. // "location": "query",
  91959. // "type": "string"
  91960. // },
  91961. // "project": {
  91962. // "description": "Project ID for this request.",
  91963. // "location": "path",
  91964. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91965. // "required": true,
  91966. // "type": "string"
  91967. // }
  91968. // },
  91969. // "path": "{project}/global/targetTcpProxies",
  91970. // "response": {
  91971. // "$ref": "TargetTcpProxyList"
  91972. // },
  91973. // "scopes": [
  91974. // "https://www.googleapis.com/auth/cloud-platform",
  91975. // "https://www.googleapis.com/auth/compute",
  91976. // "https://www.googleapis.com/auth/compute.readonly"
  91977. // ]
  91978. // }
  91979. }
  91980. // Pages invokes f for each page of results.
  91981. // A non-nil error returned from f will halt the iteration.
  91982. // The provided context supersedes any context provided to the Context method.
  91983. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  91984. c.ctx_ = ctx
  91985. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91986. for {
  91987. x, err := c.Do()
  91988. if err != nil {
  91989. return err
  91990. }
  91991. if err := f(x); err != nil {
  91992. return err
  91993. }
  91994. if x.NextPageToken == "" {
  91995. return nil
  91996. }
  91997. c.PageToken(x.NextPageToken)
  91998. }
  91999. }
  92000. // method id "compute.targetTcpProxies.setBackendService":
  92001. type TargetTcpProxiesSetBackendServiceCall struct {
  92002. s *Service
  92003. project string
  92004. targetTcpProxy string
  92005. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  92006. urlParams_ gensupport.URLParams
  92007. ctx_ context.Context
  92008. header_ http.Header
  92009. }
  92010. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  92011. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  92012. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92013. c.project = project
  92014. c.targetTcpProxy = targetTcpProxy
  92015. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  92016. return c
  92017. }
  92018. // RequestId sets the optional parameter "requestId": An optional
  92019. // request ID to identify requests. Specify a unique request ID so that
  92020. // if you must retry your request, the server will know to ignore the
  92021. // request if it has already been completed.
  92022. //
  92023. // For example, consider a situation where you make an initial request
  92024. // and the request times out. If you make the request again with the
  92025. // same request ID, the server can check if original operation with the
  92026. // same request ID was received, and if so, will ignore the second
  92027. // request. This prevents clients from accidentally creating duplicate
  92028. // commitments.
  92029. //
  92030. // The request ID must be a valid UUID with the exception that zero UUID
  92031. // is not supported (00000000-0000-0000-0000-000000000000).
  92032. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  92033. c.urlParams_.Set("requestId", requestId)
  92034. return c
  92035. }
  92036. // Fields allows partial responses to be retrieved. See
  92037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92038. // for more information.
  92039. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  92040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92041. return c
  92042. }
  92043. // Context sets the context to be used in this call's Do method. Any
  92044. // pending HTTP request will be aborted if the provided context is
  92045. // canceled.
  92046. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  92047. c.ctx_ = ctx
  92048. return c
  92049. }
  92050. // Header returns an http.Header that can be modified by the caller to
  92051. // add HTTP headers to the request.
  92052. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  92053. if c.header_ == nil {
  92054. c.header_ = make(http.Header)
  92055. }
  92056. return c.header_
  92057. }
  92058. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  92059. reqHeaders := make(http.Header)
  92060. for k, v := range c.header_ {
  92061. reqHeaders[k] = v
  92062. }
  92063. reqHeaders.Set("User-Agent", c.s.userAgent())
  92064. var body io.Reader = nil
  92065. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  92066. if err != nil {
  92067. return nil, err
  92068. }
  92069. reqHeaders.Set("Content-Type", "application/json")
  92070. c.urlParams_.Set("alt", alt)
  92071. c.urlParams_.Set("prettyPrint", "false")
  92072. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  92073. urls += "?" + c.urlParams_.Encode()
  92074. req, err := http.NewRequest("POST", urls, body)
  92075. if err != nil {
  92076. return nil, err
  92077. }
  92078. req.Header = reqHeaders
  92079. googleapi.Expand(req.URL, map[string]string{
  92080. "project": c.project,
  92081. "targetTcpProxy": c.targetTcpProxy,
  92082. })
  92083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92084. }
  92085. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  92086. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92087. // status code is an error. Response headers are in either
  92088. // *Operation.ServerResponse.Header or (if a response was returned at
  92089. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92090. // to check whether the returned error was because
  92091. // http.StatusNotModified was returned.
  92092. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92093. gensupport.SetOptions(c.urlParams_, opts...)
  92094. res, err := c.doRequest("json")
  92095. if res != nil && res.StatusCode == http.StatusNotModified {
  92096. if res.Body != nil {
  92097. res.Body.Close()
  92098. }
  92099. return nil, &googleapi.Error{
  92100. Code: res.StatusCode,
  92101. Header: res.Header,
  92102. }
  92103. }
  92104. if err != nil {
  92105. return nil, err
  92106. }
  92107. defer googleapi.CloseBody(res)
  92108. if err := googleapi.CheckResponse(res); err != nil {
  92109. return nil, err
  92110. }
  92111. ret := &Operation{
  92112. ServerResponse: googleapi.ServerResponse{
  92113. Header: res.Header,
  92114. HTTPStatusCode: res.StatusCode,
  92115. },
  92116. }
  92117. target := &ret
  92118. if err := gensupport.DecodeResponse(target, res); err != nil {
  92119. return nil, err
  92120. }
  92121. return ret, nil
  92122. // {
  92123. // "description": "Changes the BackendService for TargetTcpProxy.",
  92124. // "httpMethod": "POST",
  92125. // "id": "compute.targetTcpProxies.setBackendService",
  92126. // "parameterOrder": [
  92127. // "project",
  92128. // "targetTcpProxy"
  92129. // ],
  92130. // "parameters": {
  92131. // "project": {
  92132. // "description": "Project ID for this request.",
  92133. // "location": "path",
  92134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92135. // "required": true,
  92136. // "type": "string"
  92137. // },
  92138. // "requestId": {
  92139. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92140. // "location": "query",
  92141. // "type": "string"
  92142. // },
  92143. // "targetTcpProxy": {
  92144. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  92145. // "location": "path",
  92146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92147. // "required": true,
  92148. // "type": "string"
  92149. // }
  92150. // },
  92151. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  92152. // "request": {
  92153. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  92154. // },
  92155. // "response": {
  92156. // "$ref": "Operation"
  92157. // },
  92158. // "scopes": [
  92159. // "https://www.googleapis.com/auth/cloud-platform",
  92160. // "https://www.googleapis.com/auth/compute"
  92161. // ]
  92162. // }
  92163. }
  92164. // method id "compute.targetTcpProxies.setProxyHeader":
  92165. type TargetTcpProxiesSetProxyHeaderCall struct {
  92166. s *Service
  92167. project string
  92168. targetTcpProxy string
  92169. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  92170. urlParams_ gensupport.URLParams
  92171. ctx_ context.Context
  92172. header_ http.Header
  92173. }
  92174. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  92175. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  92176. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92177. c.project = project
  92178. c.targetTcpProxy = targetTcpProxy
  92179. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  92180. return c
  92181. }
  92182. // RequestId sets the optional parameter "requestId": An optional
  92183. // request ID to identify requests. Specify a unique request ID so that
  92184. // if you must retry your request, the server will know to ignore the
  92185. // request if it has already been completed.
  92186. //
  92187. // For example, consider a situation where you make an initial request
  92188. // and the request times out. If you make the request again with the
  92189. // same request ID, the server can check if original operation with the
  92190. // same request ID was received, and if so, will ignore the second
  92191. // request. This prevents clients from accidentally creating duplicate
  92192. // commitments.
  92193. //
  92194. // The request ID must be a valid UUID with the exception that zero UUID
  92195. // is not supported (00000000-0000-0000-0000-000000000000).
  92196. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  92197. c.urlParams_.Set("requestId", requestId)
  92198. return c
  92199. }
  92200. // Fields allows partial responses to be retrieved. See
  92201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92202. // for more information.
  92203. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  92204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92205. return c
  92206. }
  92207. // Context sets the context to be used in this call's Do method. Any
  92208. // pending HTTP request will be aborted if the provided context is
  92209. // canceled.
  92210. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  92211. c.ctx_ = ctx
  92212. return c
  92213. }
  92214. // Header returns an http.Header that can be modified by the caller to
  92215. // add HTTP headers to the request.
  92216. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  92217. if c.header_ == nil {
  92218. c.header_ = make(http.Header)
  92219. }
  92220. return c.header_
  92221. }
  92222. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  92223. reqHeaders := make(http.Header)
  92224. for k, v := range c.header_ {
  92225. reqHeaders[k] = v
  92226. }
  92227. reqHeaders.Set("User-Agent", c.s.userAgent())
  92228. var body io.Reader = nil
  92229. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  92230. if err != nil {
  92231. return nil, err
  92232. }
  92233. reqHeaders.Set("Content-Type", "application/json")
  92234. c.urlParams_.Set("alt", alt)
  92235. c.urlParams_.Set("prettyPrint", "false")
  92236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  92237. urls += "?" + c.urlParams_.Encode()
  92238. req, err := http.NewRequest("POST", urls, body)
  92239. if err != nil {
  92240. return nil, err
  92241. }
  92242. req.Header = reqHeaders
  92243. googleapi.Expand(req.URL, map[string]string{
  92244. "project": c.project,
  92245. "targetTcpProxy": c.targetTcpProxy,
  92246. })
  92247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92248. }
  92249. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  92250. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92251. // status code is an error. Response headers are in either
  92252. // *Operation.ServerResponse.Header or (if a response was returned at
  92253. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92254. // to check whether the returned error was because
  92255. // http.StatusNotModified was returned.
  92256. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92257. gensupport.SetOptions(c.urlParams_, opts...)
  92258. res, err := c.doRequest("json")
  92259. if res != nil && res.StatusCode == http.StatusNotModified {
  92260. if res.Body != nil {
  92261. res.Body.Close()
  92262. }
  92263. return nil, &googleapi.Error{
  92264. Code: res.StatusCode,
  92265. Header: res.Header,
  92266. }
  92267. }
  92268. if err != nil {
  92269. return nil, err
  92270. }
  92271. defer googleapi.CloseBody(res)
  92272. if err := googleapi.CheckResponse(res); err != nil {
  92273. return nil, err
  92274. }
  92275. ret := &Operation{
  92276. ServerResponse: googleapi.ServerResponse{
  92277. Header: res.Header,
  92278. HTTPStatusCode: res.StatusCode,
  92279. },
  92280. }
  92281. target := &ret
  92282. if err := gensupport.DecodeResponse(target, res); err != nil {
  92283. return nil, err
  92284. }
  92285. return ret, nil
  92286. // {
  92287. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  92288. // "httpMethod": "POST",
  92289. // "id": "compute.targetTcpProxies.setProxyHeader",
  92290. // "parameterOrder": [
  92291. // "project",
  92292. // "targetTcpProxy"
  92293. // ],
  92294. // "parameters": {
  92295. // "project": {
  92296. // "description": "Project ID for this request.",
  92297. // "location": "path",
  92298. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92299. // "required": true,
  92300. // "type": "string"
  92301. // },
  92302. // "requestId": {
  92303. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92304. // "location": "query",
  92305. // "type": "string"
  92306. // },
  92307. // "targetTcpProxy": {
  92308. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  92309. // "location": "path",
  92310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92311. // "required": true,
  92312. // "type": "string"
  92313. // }
  92314. // },
  92315. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  92316. // "request": {
  92317. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  92318. // },
  92319. // "response": {
  92320. // "$ref": "Operation"
  92321. // },
  92322. // "scopes": [
  92323. // "https://www.googleapis.com/auth/cloud-platform",
  92324. // "https://www.googleapis.com/auth/compute"
  92325. // ]
  92326. // }
  92327. }
  92328. // method id "compute.targetVpnGateways.aggregatedList":
  92329. type TargetVpnGatewaysAggregatedListCall struct {
  92330. s *Service
  92331. project string
  92332. urlParams_ gensupport.URLParams
  92333. ifNoneMatch_ string
  92334. ctx_ context.Context
  92335. header_ http.Header
  92336. }
  92337. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  92338. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  92339. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92340. c.project = project
  92341. return c
  92342. }
  92343. // Filter sets the optional parameter "filter": A filter expression that
  92344. // filters resources listed in the response. The expression must specify
  92345. // the field name, a comparison operator, and the value that you want to
  92346. // use for filtering. The value must be a string, a number, or a
  92347. // boolean. The comparison operator must be either =, !=, >, or <.
  92348. //
  92349. // For example, if you are filtering Compute Engine instances, you can
  92350. // exclude instances named example-instance by specifying name !=
  92351. // example-instance.
  92352. //
  92353. // You can also filter nested fields. For example, you could specify
  92354. // scheduling.automaticRestart = false to include instances only if they
  92355. // are not scheduled for automatic restarts. You can use filtering on
  92356. // nested fields to filter based on resource labels.
  92357. //
  92358. // To filter on multiple expressions, provide each separate expression
  92359. // within parentheses. For example, (scheduling.automaticRestart = true)
  92360. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92361. // AND expression. However, you can include AND and OR expressions
  92362. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92363. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92364. // true).
  92365. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  92366. c.urlParams_.Set("filter", filter)
  92367. return c
  92368. }
  92369. // MaxResults sets the optional parameter "maxResults": The maximum
  92370. // number of results per page that should be returned. If the number of
  92371. // available results is larger than maxResults, Compute Engine returns a
  92372. // nextPageToken that can be used to get the next page of results in
  92373. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92374. // (Default: 500)
  92375. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  92376. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92377. return c
  92378. }
  92379. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92380. // a certain order. By default, results are returned in alphanumerical
  92381. // order based on the resource name.
  92382. //
  92383. // You can also sort results in descending order based on the creation
  92384. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92385. // based on the creationTimestamp field in reverse chronological order
  92386. // (newest result first). Use this to sort resources like operations so
  92387. // that the newest operation is returned first.
  92388. //
  92389. // Currently, only sorting by name or creationTimestamp desc is
  92390. // supported.
  92391. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  92392. c.urlParams_.Set("orderBy", orderBy)
  92393. return c
  92394. }
  92395. // PageToken sets the optional parameter "pageToken": Specifies a page
  92396. // token to use. Set pageToken to the nextPageToken returned by a
  92397. // previous list request to get the next page of results.
  92398. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  92399. c.urlParams_.Set("pageToken", pageToken)
  92400. return c
  92401. }
  92402. // Fields allows partial responses to be retrieved. See
  92403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92404. // for more information.
  92405. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  92406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92407. return c
  92408. }
  92409. // IfNoneMatch sets the optional parameter which makes the operation
  92410. // fail if the object's ETag matches the given value. This is useful for
  92411. // getting updates only after the object has changed since the last
  92412. // request. Use googleapi.IsNotModified to check whether the response
  92413. // error from Do is the result of In-None-Match.
  92414. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  92415. c.ifNoneMatch_ = entityTag
  92416. return c
  92417. }
  92418. // Context sets the context to be used in this call's Do method. Any
  92419. // pending HTTP request will be aborted if the provided context is
  92420. // canceled.
  92421. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  92422. c.ctx_ = ctx
  92423. return c
  92424. }
  92425. // Header returns an http.Header that can be modified by the caller to
  92426. // add HTTP headers to the request.
  92427. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  92428. if c.header_ == nil {
  92429. c.header_ = make(http.Header)
  92430. }
  92431. return c.header_
  92432. }
  92433. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  92434. reqHeaders := make(http.Header)
  92435. for k, v := range c.header_ {
  92436. reqHeaders[k] = v
  92437. }
  92438. reqHeaders.Set("User-Agent", c.s.userAgent())
  92439. if c.ifNoneMatch_ != "" {
  92440. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92441. }
  92442. var body io.Reader = nil
  92443. c.urlParams_.Set("alt", alt)
  92444. c.urlParams_.Set("prettyPrint", "false")
  92445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  92446. urls += "?" + c.urlParams_.Encode()
  92447. req, err := http.NewRequest("GET", urls, body)
  92448. if err != nil {
  92449. return nil, err
  92450. }
  92451. req.Header = reqHeaders
  92452. googleapi.Expand(req.URL, map[string]string{
  92453. "project": c.project,
  92454. })
  92455. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92456. }
  92457. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  92458. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  92459. // non-nil. Any non-2xx status code is an error. Response headers are in
  92460. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  92461. // response was returned at all) in error.(*googleapi.Error).Header. Use
  92462. // googleapi.IsNotModified to check whether the returned error was
  92463. // because http.StatusNotModified was returned.
  92464. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  92465. gensupport.SetOptions(c.urlParams_, opts...)
  92466. res, err := c.doRequest("json")
  92467. if res != nil && res.StatusCode == http.StatusNotModified {
  92468. if res.Body != nil {
  92469. res.Body.Close()
  92470. }
  92471. return nil, &googleapi.Error{
  92472. Code: res.StatusCode,
  92473. Header: res.Header,
  92474. }
  92475. }
  92476. if err != nil {
  92477. return nil, err
  92478. }
  92479. defer googleapi.CloseBody(res)
  92480. if err := googleapi.CheckResponse(res); err != nil {
  92481. return nil, err
  92482. }
  92483. ret := &TargetVpnGatewayAggregatedList{
  92484. ServerResponse: googleapi.ServerResponse{
  92485. Header: res.Header,
  92486. HTTPStatusCode: res.StatusCode,
  92487. },
  92488. }
  92489. target := &ret
  92490. if err := gensupport.DecodeResponse(target, res); err != nil {
  92491. return nil, err
  92492. }
  92493. return ret, nil
  92494. // {
  92495. // "description": "Retrieves an aggregated list of target VPN gateways.",
  92496. // "httpMethod": "GET",
  92497. // "id": "compute.targetVpnGateways.aggregatedList",
  92498. // "parameterOrder": [
  92499. // "project"
  92500. // ],
  92501. // "parameters": {
  92502. // "filter": {
  92503. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92504. // "location": "query",
  92505. // "type": "string"
  92506. // },
  92507. // "maxResults": {
  92508. // "default": "500",
  92509. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92510. // "format": "uint32",
  92511. // "location": "query",
  92512. // "minimum": "0",
  92513. // "type": "integer"
  92514. // },
  92515. // "orderBy": {
  92516. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92517. // "location": "query",
  92518. // "type": "string"
  92519. // },
  92520. // "pageToken": {
  92521. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92522. // "location": "query",
  92523. // "type": "string"
  92524. // },
  92525. // "project": {
  92526. // "description": "Project ID for this request.",
  92527. // "location": "path",
  92528. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92529. // "required": true,
  92530. // "type": "string"
  92531. // }
  92532. // },
  92533. // "path": "{project}/aggregated/targetVpnGateways",
  92534. // "response": {
  92535. // "$ref": "TargetVpnGatewayAggregatedList"
  92536. // },
  92537. // "scopes": [
  92538. // "https://www.googleapis.com/auth/cloud-platform",
  92539. // "https://www.googleapis.com/auth/compute",
  92540. // "https://www.googleapis.com/auth/compute.readonly"
  92541. // ]
  92542. // }
  92543. }
  92544. // Pages invokes f for each page of results.
  92545. // A non-nil error returned from f will halt the iteration.
  92546. // The provided context supersedes any context provided to the Context method.
  92547. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  92548. c.ctx_ = ctx
  92549. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92550. for {
  92551. x, err := c.Do()
  92552. if err != nil {
  92553. return err
  92554. }
  92555. if err := f(x); err != nil {
  92556. return err
  92557. }
  92558. if x.NextPageToken == "" {
  92559. return nil
  92560. }
  92561. c.PageToken(x.NextPageToken)
  92562. }
  92563. }
  92564. // method id "compute.targetVpnGateways.delete":
  92565. type TargetVpnGatewaysDeleteCall struct {
  92566. s *Service
  92567. project string
  92568. region string
  92569. targetVpnGateway string
  92570. urlParams_ gensupport.URLParams
  92571. ctx_ context.Context
  92572. header_ http.Header
  92573. }
  92574. // Delete: Deletes the specified target VPN gateway.
  92575. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  92576. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92577. c.project = project
  92578. c.region = region
  92579. c.targetVpnGateway = targetVpnGateway
  92580. return c
  92581. }
  92582. // RequestId sets the optional parameter "requestId": An optional
  92583. // request ID to identify requests. Specify a unique request ID so that
  92584. // if you must retry your request, the server will know to ignore the
  92585. // request if it has already been completed.
  92586. //
  92587. // For example, consider a situation where you make an initial request
  92588. // and the request times out. If you make the request again with the
  92589. // same request ID, the server can check if original operation with the
  92590. // same request ID was received, and if so, will ignore the second
  92591. // request. This prevents clients from accidentally creating duplicate
  92592. // commitments.
  92593. //
  92594. // The request ID must be a valid UUID with the exception that zero UUID
  92595. // is not supported (00000000-0000-0000-0000-000000000000).
  92596. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  92597. c.urlParams_.Set("requestId", requestId)
  92598. return c
  92599. }
  92600. // Fields allows partial responses to be retrieved. See
  92601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92602. // for more information.
  92603. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  92604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92605. return c
  92606. }
  92607. // Context sets the context to be used in this call's Do method. Any
  92608. // pending HTTP request will be aborted if the provided context is
  92609. // canceled.
  92610. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  92611. c.ctx_ = ctx
  92612. return c
  92613. }
  92614. // Header returns an http.Header that can be modified by the caller to
  92615. // add HTTP headers to the request.
  92616. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  92617. if c.header_ == nil {
  92618. c.header_ = make(http.Header)
  92619. }
  92620. return c.header_
  92621. }
  92622. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  92623. reqHeaders := make(http.Header)
  92624. for k, v := range c.header_ {
  92625. reqHeaders[k] = v
  92626. }
  92627. reqHeaders.Set("User-Agent", c.s.userAgent())
  92628. var body io.Reader = nil
  92629. c.urlParams_.Set("alt", alt)
  92630. c.urlParams_.Set("prettyPrint", "false")
  92631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  92632. urls += "?" + c.urlParams_.Encode()
  92633. req, err := http.NewRequest("DELETE", urls, body)
  92634. if err != nil {
  92635. return nil, err
  92636. }
  92637. req.Header = reqHeaders
  92638. googleapi.Expand(req.URL, map[string]string{
  92639. "project": c.project,
  92640. "region": c.region,
  92641. "targetVpnGateway": c.targetVpnGateway,
  92642. })
  92643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92644. }
  92645. // Do executes the "compute.targetVpnGateways.delete" call.
  92646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92647. // status code is an error. Response headers are in either
  92648. // *Operation.ServerResponse.Header or (if a response was returned at
  92649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92650. // to check whether the returned error was because
  92651. // http.StatusNotModified was returned.
  92652. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92653. gensupport.SetOptions(c.urlParams_, opts...)
  92654. res, err := c.doRequest("json")
  92655. if res != nil && res.StatusCode == http.StatusNotModified {
  92656. if res.Body != nil {
  92657. res.Body.Close()
  92658. }
  92659. return nil, &googleapi.Error{
  92660. Code: res.StatusCode,
  92661. Header: res.Header,
  92662. }
  92663. }
  92664. if err != nil {
  92665. return nil, err
  92666. }
  92667. defer googleapi.CloseBody(res)
  92668. if err := googleapi.CheckResponse(res); err != nil {
  92669. return nil, err
  92670. }
  92671. ret := &Operation{
  92672. ServerResponse: googleapi.ServerResponse{
  92673. Header: res.Header,
  92674. HTTPStatusCode: res.StatusCode,
  92675. },
  92676. }
  92677. target := &ret
  92678. if err := gensupport.DecodeResponse(target, res); err != nil {
  92679. return nil, err
  92680. }
  92681. return ret, nil
  92682. // {
  92683. // "description": "Deletes the specified target VPN gateway.",
  92684. // "httpMethod": "DELETE",
  92685. // "id": "compute.targetVpnGateways.delete",
  92686. // "parameterOrder": [
  92687. // "project",
  92688. // "region",
  92689. // "targetVpnGateway"
  92690. // ],
  92691. // "parameters": {
  92692. // "project": {
  92693. // "description": "Project ID for this request.",
  92694. // "location": "path",
  92695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92696. // "required": true,
  92697. // "type": "string"
  92698. // },
  92699. // "region": {
  92700. // "description": "Name of the region for this request.",
  92701. // "location": "path",
  92702. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92703. // "required": true,
  92704. // "type": "string"
  92705. // },
  92706. // "requestId": {
  92707. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92708. // "location": "query",
  92709. // "type": "string"
  92710. // },
  92711. // "targetVpnGateway": {
  92712. // "description": "Name of the target VPN gateway to delete.",
  92713. // "location": "path",
  92714. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92715. // "required": true,
  92716. // "type": "string"
  92717. // }
  92718. // },
  92719. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  92720. // "response": {
  92721. // "$ref": "Operation"
  92722. // },
  92723. // "scopes": [
  92724. // "https://www.googleapis.com/auth/cloud-platform",
  92725. // "https://www.googleapis.com/auth/compute"
  92726. // ]
  92727. // }
  92728. }
  92729. // method id "compute.targetVpnGateways.get":
  92730. type TargetVpnGatewaysGetCall struct {
  92731. s *Service
  92732. project string
  92733. region string
  92734. targetVpnGateway string
  92735. urlParams_ gensupport.URLParams
  92736. ifNoneMatch_ string
  92737. ctx_ context.Context
  92738. header_ http.Header
  92739. }
  92740. // Get: Returns the specified target VPN gateway. Gets a list of
  92741. // available target VPN gateways by making a list() request.
  92742. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  92743. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92744. c.project = project
  92745. c.region = region
  92746. c.targetVpnGateway = targetVpnGateway
  92747. return c
  92748. }
  92749. // Fields allows partial responses to be retrieved. See
  92750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92751. // for more information.
  92752. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  92753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92754. return c
  92755. }
  92756. // IfNoneMatch sets the optional parameter which makes the operation
  92757. // fail if the object's ETag matches the given value. This is useful for
  92758. // getting updates only after the object has changed since the last
  92759. // request. Use googleapi.IsNotModified to check whether the response
  92760. // error from Do is the result of In-None-Match.
  92761. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  92762. c.ifNoneMatch_ = entityTag
  92763. return c
  92764. }
  92765. // Context sets the context to be used in this call's Do method. Any
  92766. // pending HTTP request will be aborted if the provided context is
  92767. // canceled.
  92768. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  92769. c.ctx_ = ctx
  92770. return c
  92771. }
  92772. // Header returns an http.Header that can be modified by the caller to
  92773. // add HTTP headers to the request.
  92774. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  92775. if c.header_ == nil {
  92776. c.header_ = make(http.Header)
  92777. }
  92778. return c.header_
  92779. }
  92780. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  92781. reqHeaders := make(http.Header)
  92782. for k, v := range c.header_ {
  92783. reqHeaders[k] = v
  92784. }
  92785. reqHeaders.Set("User-Agent", c.s.userAgent())
  92786. if c.ifNoneMatch_ != "" {
  92787. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92788. }
  92789. var body io.Reader = nil
  92790. c.urlParams_.Set("alt", alt)
  92791. c.urlParams_.Set("prettyPrint", "false")
  92792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  92793. urls += "?" + c.urlParams_.Encode()
  92794. req, err := http.NewRequest("GET", urls, body)
  92795. if err != nil {
  92796. return nil, err
  92797. }
  92798. req.Header = reqHeaders
  92799. googleapi.Expand(req.URL, map[string]string{
  92800. "project": c.project,
  92801. "region": c.region,
  92802. "targetVpnGateway": c.targetVpnGateway,
  92803. })
  92804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92805. }
  92806. // Do executes the "compute.targetVpnGateways.get" call.
  92807. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  92808. // non-2xx status code is an error. Response headers are in either
  92809. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  92810. // returned at all) in error.(*googleapi.Error).Header. Use
  92811. // googleapi.IsNotModified to check whether the returned error was
  92812. // because http.StatusNotModified was returned.
  92813. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  92814. gensupport.SetOptions(c.urlParams_, opts...)
  92815. res, err := c.doRequest("json")
  92816. if res != nil && res.StatusCode == http.StatusNotModified {
  92817. if res.Body != nil {
  92818. res.Body.Close()
  92819. }
  92820. return nil, &googleapi.Error{
  92821. Code: res.StatusCode,
  92822. Header: res.Header,
  92823. }
  92824. }
  92825. if err != nil {
  92826. return nil, err
  92827. }
  92828. defer googleapi.CloseBody(res)
  92829. if err := googleapi.CheckResponse(res); err != nil {
  92830. return nil, err
  92831. }
  92832. ret := &TargetVpnGateway{
  92833. ServerResponse: googleapi.ServerResponse{
  92834. Header: res.Header,
  92835. HTTPStatusCode: res.StatusCode,
  92836. },
  92837. }
  92838. target := &ret
  92839. if err := gensupport.DecodeResponse(target, res); err != nil {
  92840. return nil, err
  92841. }
  92842. return ret, nil
  92843. // {
  92844. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  92845. // "httpMethod": "GET",
  92846. // "id": "compute.targetVpnGateways.get",
  92847. // "parameterOrder": [
  92848. // "project",
  92849. // "region",
  92850. // "targetVpnGateway"
  92851. // ],
  92852. // "parameters": {
  92853. // "project": {
  92854. // "description": "Project ID for this request.",
  92855. // "location": "path",
  92856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92857. // "required": true,
  92858. // "type": "string"
  92859. // },
  92860. // "region": {
  92861. // "description": "Name of the region for this request.",
  92862. // "location": "path",
  92863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92864. // "required": true,
  92865. // "type": "string"
  92866. // },
  92867. // "targetVpnGateway": {
  92868. // "description": "Name of the target VPN gateway to return.",
  92869. // "location": "path",
  92870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92871. // "required": true,
  92872. // "type": "string"
  92873. // }
  92874. // },
  92875. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  92876. // "response": {
  92877. // "$ref": "TargetVpnGateway"
  92878. // },
  92879. // "scopes": [
  92880. // "https://www.googleapis.com/auth/cloud-platform",
  92881. // "https://www.googleapis.com/auth/compute",
  92882. // "https://www.googleapis.com/auth/compute.readonly"
  92883. // ]
  92884. // }
  92885. }
  92886. // method id "compute.targetVpnGateways.insert":
  92887. type TargetVpnGatewaysInsertCall struct {
  92888. s *Service
  92889. project string
  92890. region string
  92891. targetvpngateway *TargetVpnGateway
  92892. urlParams_ gensupport.URLParams
  92893. ctx_ context.Context
  92894. header_ http.Header
  92895. }
  92896. // Insert: Creates a target VPN gateway in the specified project and
  92897. // region using the data included in the request.
  92898. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  92899. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92900. c.project = project
  92901. c.region = region
  92902. c.targetvpngateway = targetvpngateway
  92903. return c
  92904. }
  92905. // RequestId sets the optional parameter "requestId": An optional
  92906. // request ID to identify requests. Specify a unique request ID so that
  92907. // if you must retry your request, the server will know to ignore the
  92908. // request if it has already been completed.
  92909. //
  92910. // For example, consider a situation where you make an initial request
  92911. // and the request times out. If you make the request again with the
  92912. // same request ID, the server can check if original operation with the
  92913. // same request ID was received, and if so, will ignore the second
  92914. // request. This prevents clients from accidentally creating duplicate
  92915. // commitments.
  92916. //
  92917. // The request ID must be a valid UUID with the exception that zero UUID
  92918. // is not supported (00000000-0000-0000-0000-000000000000).
  92919. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  92920. c.urlParams_.Set("requestId", requestId)
  92921. return c
  92922. }
  92923. // Fields allows partial responses to be retrieved. See
  92924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92925. // for more information.
  92926. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  92927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92928. return c
  92929. }
  92930. // Context sets the context to be used in this call's Do method. Any
  92931. // pending HTTP request will be aborted if the provided context is
  92932. // canceled.
  92933. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  92934. c.ctx_ = ctx
  92935. return c
  92936. }
  92937. // Header returns an http.Header that can be modified by the caller to
  92938. // add HTTP headers to the request.
  92939. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  92940. if c.header_ == nil {
  92941. c.header_ = make(http.Header)
  92942. }
  92943. return c.header_
  92944. }
  92945. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  92946. reqHeaders := make(http.Header)
  92947. for k, v := range c.header_ {
  92948. reqHeaders[k] = v
  92949. }
  92950. reqHeaders.Set("User-Agent", c.s.userAgent())
  92951. var body io.Reader = nil
  92952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  92953. if err != nil {
  92954. return nil, err
  92955. }
  92956. reqHeaders.Set("Content-Type", "application/json")
  92957. c.urlParams_.Set("alt", alt)
  92958. c.urlParams_.Set("prettyPrint", "false")
  92959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  92960. urls += "?" + c.urlParams_.Encode()
  92961. req, err := http.NewRequest("POST", urls, body)
  92962. if err != nil {
  92963. return nil, err
  92964. }
  92965. req.Header = reqHeaders
  92966. googleapi.Expand(req.URL, map[string]string{
  92967. "project": c.project,
  92968. "region": c.region,
  92969. })
  92970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92971. }
  92972. // Do executes the "compute.targetVpnGateways.insert" call.
  92973. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92974. // status code is an error. Response headers are in either
  92975. // *Operation.ServerResponse.Header or (if a response was returned at
  92976. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92977. // to check whether the returned error was because
  92978. // http.StatusNotModified was returned.
  92979. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92980. gensupport.SetOptions(c.urlParams_, opts...)
  92981. res, err := c.doRequest("json")
  92982. if res != nil && res.StatusCode == http.StatusNotModified {
  92983. if res.Body != nil {
  92984. res.Body.Close()
  92985. }
  92986. return nil, &googleapi.Error{
  92987. Code: res.StatusCode,
  92988. Header: res.Header,
  92989. }
  92990. }
  92991. if err != nil {
  92992. return nil, err
  92993. }
  92994. defer googleapi.CloseBody(res)
  92995. if err := googleapi.CheckResponse(res); err != nil {
  92996. return nil, err
  92997. }
  92998. ret := &Operation{
  92999. ServerResponse: googleapi.ServerResponse{
  93000. Header: res.Header,
  93001. HTTPStatusCode: res.StatusCode,
  93002. },
  93003. }
  93004. target := &ret
  93005. if err := gensupport.DecodeResponse(target, res); err != nil {
  93006. return nil, err
  93007. }
  93008. return ret, nil
  93009. // {
  93010. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  93011. // "httpMethod": "POST",
  93012. // "id": "compute.targetVpnGateways.insert",
  93013. // "parameterOrder": [
  93014. // "project",
  93015. // "region"
  93016. // ],
  93017. // "parameters": {
  93018. // "project": {
  93019. // "description": "Project ID for this request.",
  93020. // "location": "path",
  93021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93022. // "required": true,
  93023. // "type": "string"
  93024. // },
  93025. // "region": {
  93026. // "description": "Name of the region for this request.",
  93027. // "location": "path",
  93028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93029. // "required": true,
  93030. // "type": "string"
  93031. // },
  93032. // "requestId": {
  93033. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93034. // "location": "query",
  93035. // "type": "string"
  93036. // }
  93037. // },
  93038. // "path": "{project}/regions/{region}/targetVpnGateways",
  93039. // "request": {
  93040. // "$ref": "TargetVpnGateway"
  93041. // },
  93042. // "response": {
  93043. // "$ref": "Operation"
  93044. // },
  93045. // "scopes": [
  93046. // "https://www.googleapis.com/auth/cloud-platform",
  93047. // "https://www.googleapis.com/auth/compute"
  93048. // ]
  93049. // }
  93050. }
  93051. // method id "compute.targetVpnGateways.list":
  93052. type TargetVpnGatewaysListCall struct {
  93053. s *Service
  93054. project string
  93055. region string
  93056. urlParams_ gensupport.URLParams
  93057. ifNoneMatch_ string
  93058. ctx_ context.Context
  93059. header_ http.Header
  93060. }
  93061. // List: Retrieves a list of target VPN gateways available to the
  93062. // specified project and region.
  93063. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  93064. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93065. c.project = project
  93066. c.region = region
  93067. return c
  93068. }
  93069. // Filter sets the optional parameter "filter": A filter expression that
  93070. // filters resources listed in the response. The expression must specify
  93071. // the field name, a comparison operator, and the value that you want to
  93072. // use for filtering. The value must be a string, a number, or a
  93073. // boolean. The comparison operator must be either =, !=, >, or <.
  93074. //
  93075. // For example, if you are filtering Compute Engine instances, you can
  93076. // exclude instances named example-instance by specifying name !=
  93077. // example-instance.
  93078. //
  93079. // You can also filter nested fields. For example, you could specify
  93080. // scheduling.automaticRestart = false to include instances only if they
  93081. // are not scheduled for automatic restarts. You can use filtering on
  93082. // nested fields to filter based on resource labels.
  93083. //
  93084. // To filter on multiple expressions, provide each separate expression
  93085. // within parentheses. For example, (scheduling.automaticRestart = true)
  93086. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93087. // AND expression. However, you can include AND and OR expressions
  93088. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93089. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93090. // true).
  93091. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  93092. c.urlParams_.Set("filter", filter)
  93093. return c
  93094. }
  93095. // MaxResults sets the optional parameter "maxResults": The maximum
  93096. // number of results per page that should be returned. If the number of
  93097. // available results is larger than maxResults, Compute Engine returns a
  93098. // nextPageToken that can be used to get the next page of results in
  93099. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93100. // (Default: 500)
  93101. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  93102. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93103. return c
  93104. }
  93105. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93106. // a certain order. By default, results are returned in alphanumerical
  93107. // order based on the resource name.
  93108. //
  93109. // You can also sort results in descending order based on the creation
  93110. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93111. // based on the creationTimestamp field in reverse chronological order
  93112. // (newest result first). Use this to sort resources like operations so
  93113. // that the newest operation is returned first.
  93114. //
  93115. // Currently, only sorting by name or creationTimestamp desc is
  93116. // supported.
  93117. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  93118. c.urlParams_.Set("orderBy", orderBy)
  93119. return c
  93120. }
  93121. // PageToken sets the optional parameter "pageToken": Specifies a page
  93122. // token to use. Set pageToken to the nextPageToken returned by a
  93123. // previous list request to get the next page of results.
  93124. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  93125. c.urlParams_.Set("pageToken", pageToken)
  93126. return c
  93127. }
  93128. // Fields allows partial responses to be retrieved. See
  93129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93130. // for more information.
  93131. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  93132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93133. return c
  93134. }
  93135. // IfNoneMatch sets the optional parameter which makes the operation
  93136. // fail if the object's ETag matches the given value. This is useful for
  93137. // getting updates only after the object has changed since the last
  93138. // request. Use googleapi.IsNotModified to check whether the response
  93139. // error from Do is the result of In-None-Match.
  93140. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  93141. c.ifNoneMatch_ = entityTag
  93142. return c
  93143. }
  93144. // Context sets the context to be used in this call's Do method. Any
  93145. // pending HTTP request will be aborted if the provided context is
  93146. // canceled.
  93147. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  93148. c.ctx_ = ctx
  93149. return c
  93150. }
  93151. // Header returns an http.Header that can be modified by the caller to
  93152. // add HTTP headers to the request.
  93153. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  93154. if c.header_ == nil {
  93155. c.header_ = make(http.Header)
  93156. }
  93157. return c.header_
  93158. }
  93159. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  93160. reqHeaders := make(http.Header)
  93161. for k, v := range c.header_ {
  93162. reqHeaders[k] = v
  93163. }
  93164. reqHeaders.Set("User-Agent", c.s.userAgent())
  93165. if c.ifNoneMatch_ != "" {
  93166. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93167. }
  93168. var body io.Reader = nil
  93169. c.urlParams_.Set("alt", alt)
  93170. c.urlParams_.Set("prettyPrint", "false")
  93171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  93172. urls += "?" + c.urlParams_.Encode()
  93173. req, err := http.NewRequest("GET", urls, body)
  93174. if err != nil {
  93175. return nil, err
  93176. }
  93177. req.Header = reqHeaders
  93178. googleapi.Expand(req.URL, map[string]string{
  93179. "project": c.project,
  93180. "region": c.region,
  93181. })
  93182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93183. }
  93184. // Do executes the "compute.targetVpnGateways.list" call.
  93185. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  93186. // non-2xx status code is an error. Response headers are in either
  93187. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  93188. // returned at all) in error.(*googleapi.Error).Header. Use
  93189. // googleapi.IsNotModified to check whether the returned error was
  93190. // because http.StatusNotModified was returned.
  93191. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  93192. gensupport.SetOptions(c.urlParams_, opts...)
  93193. res, err := c.doRequest("json")
  93194. if res != nil && res.StatusCode == http.StatusNotModified {
  93195. if res.Body != nil {
  93196. res.Body.Close()
  93197. }
  93198. return nil, &googleapi.Error{
  93199. Code: res.StatusCode,
  93200. Header: res.Header,
  93201. }
  93202. }
  93203. if err != nil {
  93204. return nil, err
  93205. }
  93206. defer googleapi.CloseBody(res)
  93207. if err := googleapi.CheckResponse(res); err != nil {
  93208. return nil, err
  93209. }
  93210. ret := &TargetVpnGatewayList{
  93211. ServerResponse: googleapi.ServerResponse{
  93212. Header: res.Header,
  93213. HTTPStatusCode: res.StatusCode,
  93214. },
  93215. }
  93216. target := &ret
  93217. if err := gensupport.DecodeResponse(target, res); err != nil {
  93218. return nil, err
  93219. }
  93220. return ret, nil
  93221. // {
  93222. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  93223. // "httpMethod": "GET",
  93224. // "id": "compute.targetVpnGateways.list",
  93225. // "parameterOrder": [
  93226. // "project",
  93227. // "region"
  93228. // ],
  93229. // "parameters": {
  93230. // "filter": {
  93231. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93232. // "location": "query",
  93233. // "type": "string"
  93234. // },
  93235. // "maxResults": {
  93236. // "default": "500",
  93237. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93238. // "format": "uint32",
  93239. // "location": "query",
  93240. // "minimum": "0",
  93241. // "type": "integer"
  93242. // },
  93243. // "orderBy": {
  93244. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93245. // "location": "query",
  93246. // "type": "string"
  93247. // },
  93248. // "pageToken": {
  93249. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93250. // "location": "query",
  93251. // "type": "string"
  93252. // },
  93253. // "project": {
  93254. // "description": "Project ID for this request.",
  93255. // "location": "path",
  93256. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93257. // "required": true,
  93258. // "type": "string"
  93259. // },
  93260. // "region": {
  93261. // "description": "Name of the region for this request.",
  93262. // "location": "path",
  93263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93264. // "required": true,
  93265. // "type": "string"
  93266. // }
  93267. // },
  93268. // "path": "{project}/regions/{region}/targetVpnGateways",
  93269. // "response": {
  93270. // "$ref": "TargetVpnGatewayList"
  93271. // },
  93272. // "scopes": [
  93273. // "https://www.googleapis.com/auth/cloud-platform",
  93274. // "https://www.googleapis.com/auth/compute",
  93275. // "https://www.googleapis.com/auth/compute.readonly"
  93276. // ]
  93277. // }
  93278. }
  93279. // Pages invokes f for each page of results.
  93280. // A non-nil error returned from f will halt the iteration.
  93281. // The provided context supersedes any context provided to the Context method.
  93282. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  93283. c.ctx_ = ctx
  93284. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93285. for {
  93286. x, err := c.Do()
  93287. if err != nil {
  93288. return err
  93289. }
  93290. if err := f(x); err != nil {
  93291. return err
  93292. }
  93293. if x.NextPageToken == "" {
  93294. return nil
  93295. }
  93296. c.PageToken(x.NextPageToken)
  93297. }
  93298. }
  93299. // method id "compute.urlMaps.delete":
  93300. type UrlMapsDeleteCall struct {
  93301. s *Service
  93302. project string
  93303. urlMap string
  93304. urlParams_ gensupport.URLParams
  93305. ctx_ context.Context
  93306. header_ http.Header
  93307. }
  93308. // Delete: Deletes the specified UrlMap resource.
  93309. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  93310. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  93311. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93312. c.project = project
  93313. c.urlMap = urlMap
  93314. return c
  93315. }
  93316. // RequestId sets the optional parameter "requestId": An optional
  93317. // request ID to identify requests. Specify a unique request ID so that
  93318. // if you must retry your request, the server will know to ignore the
  93319. // request if it has already been completed.
  93320. //
  93321. // For example, consider a situation where you make an initial request
  93322. // and the request times out. If you make the request again with the
  93323. // same request ID, the server can check if original operation with the
  93324. // same request ID was received, and if so, will ignore the second
  93325. // request. This prevents clients from accidentally creating duplicate
  93326. // commitments.
  93327. //
  93328. // The request ID must be a valid UUID with the exception that zero UUID
  93329. // is not supported (00000000-0000-0000-0000-000000000000).
  93330. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  93331. c.urlParams_.Set("requestId", requestId)
  93332. return c
  93333. }
  93334. // Fields allows partial responses to be retrieved. See
  93335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93336. // for more information.
  93337. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  93338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93339. return c
  93340. }
  93341. // Context sets the context to be used in this call's Do method. Any
  93342. // pending HTTP request will be aborted if the provided context is
  93343. // canceled.
  93344. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  93345. c.ctx_ = ctx
  93346. return c
  93347. }
  93348. // Header returns an http.Header that can be modified by the caller to
  93349. // add HTTP headers to the request.
  93350. func (c *UrlMapsDeleteCall) Header() http.Header {
  93351. if c.header_ == nil {
  93352. c.header_ = make(http.Header)
  93353. }
  93354. return c.header_
  93355. }
  93356. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  93357. reqHeaders := make(http.Header)
  93358. for k, v := range c.header_ {
  93359. reqHeaders[k] = v
  93360. }
  93361. reqHeaders.Set("User-Agent", c.s.userAgent())
  93362. var body io.Reader = nil
  93363. c.urlParams_.Set("alt", alt)
  93364. c.urlParams_.Set("prettyPrint", "false")
  93365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  93366. urls += "?" + c.urlParams_.Encode()
  93367. req, err := http.NewRequest("DELETE", urls, body)
  93368. if err != nil {
  93369. return nil, err
  93370. }
  93371. req.Header = reqHeaders
  93372. googleapi.Expand(req.URL, map[string]string{
  93373. "project": c.project,
  93374. "urlMap": c.urlMap,
  93375. })
  93376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93377. }
  93378. // Do executes the "compute.urlMaps.delete" call.
  93379. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93380. // status code is an error. Response headers are in either
  93381. // *Operation.ServerResponse.Header or (if a response was returned at
  93382. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93383. // to check whether the returned error was because
  93384. // http.StatusNotModified was returned.
  93385. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93386. gensupport.SetOptions(c.urlParams_, opts...)
  93387. res, err := c.doRequest("json")
  93388. if res != nil && res.StatusCode == http.StatusNotModified {
  93389. if res.Body != nil {
  93390. res.Body.Close()
  93391. }
  93392. return nil, &googleapi.Error{
  93393. Code: res.StatusCode,
  93394. Header: res.Header,
  93395. }
  93396. }
  93397. if err != nil {
  93398. return nil, err
  93399. }
  93400. defer googleapi.CloseBody(res)
  93401. if err := googleapi.CheckResponse(res); err != nil {
  93402. return nil, err
  93403. }
  93404. ret := &Operation{
  93405. ServerResponse: googleapi.ServerResponse{
  93406. Header: res.Header,
  93407. HTTPStatusCode: res.StatusCode,
  93408. },
  93409. }
  93410. target := &ret
  93411. if err := gensupport.DecodeResponse(target, res); err != nil {
  93412. return nil, err
  93413. }
  93414. return ret, nil
  93415. // {
  93416. // "description": "Deletes the specified UrlMap resource.",
  93417. // "httpMethod": "DELETE",
  93418. // "id": "compute.urlMaps.delete",
  93419. // "parameterOrder": [
  93420. // "project",
  93421. // "urlMap"
  93422. // ],
  93423. // "parameters": {
  93424. // "project": {
  93425. // "description": "Project ID for this request.",
  93426. // "location": "path",
  93427. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93428. // "required": true,
  93429. // "type": "string"
  93430. // },
  93431. // "requestId": {
  93432. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93433. // "location": "query",
  93434. // "type": "string"
  93435. // },
  93436. // "urlMap": {
  93437. // "description": "Name of the UrlMap resource to delete.",
  93438. // "location": "path",
  93439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93440. // "required": true,
  93441. // "type": "string"
  93442. // }
  93443. // },
  93444. // "path": "{project}/global/urlMaps/{urlMap}",
  93445. // "response": {
  93446. // "$ref": "Operation"
  93447. // },
  93448. // "scopes": [
  93449. // "https://www.googleapis.com/auth/cloud-platform",
  93450. // "https://www.googleapis.com/auth/compute"
  93451. // ]
  93452. // }
  93453. }
  93454. // method id "compute.urlMaps.get":
  93455. type UrlMapsGetCall struct {
  93456. s *Service
  93457. project string
  93458. urlMap string
  93459. urlParams_ gensupport.URLParams
  93460. ifNoneMatch_ string
  93461. ctx_ context.Context
  93462. header_ http.Header
  93463. }
  93464. // Get: Returns the specified UrlMap resource. Gets a list of available
  93465. // URL maps by making a list() request.
  93466. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  93467. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  93468. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93469. c.project = project
  93470. c.urlMap = urlMap
  93471. return c
  93472. }
  93473. // Fields allows partial responses to be retrieved. See
  93474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93475. // for more information.
  93476. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  93477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93478. return c
  93479. }
  93480. // IfNoneMatch sets the optional parameter which makes the operation
  93481. // fail if the object's ETag matches the given value. This is useful for
  93482. // getting updates only after the object has changed since the last
  93483. // request. Use googleapi.IsNotModified to check whether the response
  93484. // error from Do is the result of In-None-Match.
  93485. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  93486. c.ifNoneMatch_ = entityTag
  93487. return c
  93488. }
  93489. // Context sets the context to be used in this call's Do method. Any
  93490. // pending HTTP request will be aborted if the provided context is
  93491. // canceled.
  93492. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  93493. c.ctx_ = ctx
  93494. return c
  93495. }
  93496. // Header returns an http.Header that can be modified by the caller to
  93497. // add HTTP headers to the request.
  93498. func (c *UrlMapsGetCall) Header() http.Header {
  93499. if c.header_ == nil {
  93500. c.header_ = make(http.Header)
  93501. }
  93502. return c.header_
  93503. }
  93504. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  93505. reqHeaders := make(http.Header)
  93506. for k, v := range c.header_ {
  93507. reqHeaders[k] = v
  93508. }
  93509. reqHeaders.Set("User-Agent", c.s.userAgent())
  93510. if c.ifNoneMatch_ != "" {
  93511. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93512. }
  93513. var body io.Reader = nil
  93514. c.urlParams_.Set("alt", alt)
  93515. c.urlParams_.Set("prettyPrint", "false")
  93516. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  93517. urls += "?" + c.urlParams_.Encode()
  93518. req, err := http.NewRequest("GET", urls, body)
  93519. if err != nil {
  93520. return nil, err
  93521. }
  93522. req.Header = reqHeaders
  93523. googleapi.Expand(req.URL, map[string]string{
  93524. "project": c.project,
  93525. "urlMap": c.urlMap,
  93526. })
  93527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93528. }
  93529. // Do executes the "compute.urlMaps.get" call.
  93530. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  93531. // code is an error. Response headers are in either
  93532. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  93533. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  93534. // check whether the returned error was because http.StatusNotModified
  93535. // was returned.
  93536. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  93537. gensupport.SetOptions(c.urlParams_, opts...)
  93538. res, err := c.doRequest("json")
  93539. if res != nil && res.StatusCode == http.StatusNotModified {
  93540. if res.Body != nil {
  93541. res.Body.Close()
  93542. }
  93543. return nil, &googleapi.Error{
  93544. Code: res.StatusCode,
  93545. Header: res.Header,
  93546. }
  93547. }
  93548. if err != nil {
  93549. return nil, err
  93550. }
  93551. defer googleapi.CloseBody(res)
  93552. if err := googleapi.CheckResponse(res); err != nil {
  93553. return nil, err
  93554. }
  93555. ret := &UrlMap{
  93556. ServerResponse: googleapi.ServerResponse{
  93557. Header: res.Header,
  93558. HTTPStatusCode: res.StatusCode,
  93559. },
  93560. }
  93561. target := &ret
  93562. if err := gensupport.DecodeResponse(target, res); err != nil {
  93563. return nil, err
  93564. }
  93565. return ret, nil
  93566. // {
  93567. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  93568. // "httpMethod": "GET",
  93569. // "id": "compute.urlMaps.get",
  93570. // "parameterOrder": [
  93571. // "project",
  93572. // "urlMap"
  93573. // ],
  93574. // "parameters": {
  93575. // "project": {
  93576. // "description": "Project ID for this request.",
  93577. // "location": "path",
  93578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93579. // "required": true,
  93580. // "type": "string"
  93581. // },
  93582. // "urlMap": {
  93583. // "description": "Name of the UrlMap resource to return.",
  93584. // "location": "path",
  93585. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93586. // "required": true,
  93587. // "type": "string"
  93588. // }
  93589. // },
  93590. // "path": "{project}/global/urlMaps/{urlMap}",
  93591. // "response": {
  93592. // "$ref": "UrlMap"
  93593. // },
  93594. // "scopes": [
  93595. // "https://www.googleapis.com/auth/cloud-platform",
  93596. // "https://www.googleapis.com/auth/compute",
  93597. // "https://www.googleapis.com/auth/compute.readonly"
  93598. // ]
  93599. // }
  93600. }
  93601. // method id "compute.urlMaps.insert":
  93602. type UrlMapsInsertCall struct {
  93603. s *Service
  93604. project string
  93605. urlmap *UrlMap
  93606. urlParams_ gensupport.URLParams
  93607. ctx_ context.Context
  93608. header_ http.Header
  93609. }
  93610. // Insert: Creates a UrlMap resource in the specified project using the
  93611. // data included in the request.
  93612. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  93613. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  93614. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93615. c.project = project
  93616. c.urlmap = urlmap
  93617. return c
  93618. }
  93619. // RequestId sets the optional parameter "requestId": An optional
  93620. // request ID to identify requests. Specify a unique request ID so that
  93621. // if you must retry your request, the server will know to ignore the
  93622. // request if it has already been completed.
  93623. //
  93624. // For example, consider a situation where you make an initial request
  93625. // and the request times out. If you make the request again with the
  93626. // same request ID, the server can check if original operation with the
  93627. // same request ID was received, and if so, will ignore the second
  93628. // request. This prevents clients from accidentally creating duplicate
  93629. // commitments.
  93630. //
  93631. // The request ID must be a valid UUID with the exception that zero UUID
  93632. // is not supported (00000000-0000-0000-0000-000000000000).
  93633. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  93634. c.urlParams_.Set("requestId", requestId)
  93635. return c
  93636. }
  93637. // Fields allows partial responses to be retrieved. See
  93638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93639. // for more information.
  93640. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  93641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93642. return c
  93643. }
  93644. // Context sets the context to be used in this call's Do method. Any
  93645. // pending HTTP request will be aborted if the provided context is
  93646. // canceled.
  93647. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  93648. c.ctx_ = ctx
  93649. return c
  93650. }
  93651. // Header returns an http.Header that can be modified by the caller to
  93652. // add HTTP headers to the request.
  93653. func (c *UrlMapsInsertCall) Header() http.Header {
  93654. if c.header_ == nil {
  93655. c.header_ = make(http.Header)
  93656. }
  93657. return c.header_
  93658. }
  93659. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  93660. reqHeaders := make(http.Header)
  93661. for k, v := range c.header_ {
  93662. reqHeaders[k] = v
  93663. }
  93664. reqHeaders.Set("User-Agent", c.s.userAgent())
  93665. var body io.Reader = nil
  93666. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  93667. if err != nil {
  93668. return nil, err
  93669. }
  93670. reqHeaders.Set("Content-Type", "application/json")
  93671. c.urlParams_.Set("alt", alt)
  93672. c.urlParams_.Set("prettyPrint", "false")
  93673. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  93674. urls += "?" + c.urlParams_.Encode()
  93675. req, err := http.NewRequest("POST", urls, body)
  93676. if err != nil {
  93677. return nil, err
  93678. }
  93679. req.Header = reqHeaders
  93680. googleapi.Expand(req.URL, map[string]string{
  93681. "project": c.project,
  93682. })
  93683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93684. }
  93685. // Do executes the "compute.urlMaps.insert" call.
  93686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93687. // status code is an error. Response headers are in either
  93688. // *Operation.ServerResponse.Header or (if a response was returned at
  93689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93690. // to check whether the returned error was because
  93691. // http.StatusNotModified was returned.
  93692. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93693. gensupport.SetOptions(c.urlParams_, opts...)
  93694. res, err := c.doRequest("json")
  93695. if res != nil && res.StatusCode == http.StatusNotModified {
  93696. if res.Body != nil {
  93697. res.Body.Close()
  93698. }
  93699. return nil, &googleapi.Error{
  93700. Code: res.StatusCode,
  93701. Header: res.Header,
  93702. }
  93703. }
  93704. if err != nil {
  93705. return nil, err
  93706. }
  93707. defer googleapi.CloseBody(res)
  93708. if err := googleapi.CheckResponse(res); err != nil {
  93709. return nil, err
  93710. }
  93711. ret := &Operation{
  93712. ServerResponse: googleapi.ServerResponse{
  93713. Header: res.Header,
  93714. HTTPStatusCode: res.StatusCode,
  93715. },
  93716. }
  93717. target := &ret
  93718. if err := gensupport.DecodeResponse(target, res); err != nil {
  93719. return nil, err
  93720. }
  93721. return ret, nil
  93722. // {
  93723. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  93724. // "httpMethod": "POST",
  93725. // "id": "compute.urlMaps.insert",
  93726. // "parameterOrder": [
  93727. // "project"
  93728. // ],
  93729. // "parameters": {
  93730. // "project": {
  93731. // "description": "Project ID for this request.",
  93732. // "location": "path",
  93733. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93734. // "required": true,
  93735. // "type": "string"
  93736. // },
  93737. // "requestId": {
  93738. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93739. // "location": "query",
  93740. // "type": "string"
  93741. // }
  93742. // },
  93743. // "path": "{project}/global/urlMaps",
  93744. // "request": {
  93745. // "$ref": "UrlMap"
  93746. // },
  93747. // "response": {
  93748. // "$ref": "Operation"
  93749. // },
  93750. // "scopes": [
  93751. // "https://www.googleapis.com/auth/cloud-platform",
  93752. // "https://www.googleapis.com/auth/compute"
  93753. // ]
  93754. // }
  93755. }
  93756. // method id "compute.urlMaps.invalidateCache":
  93757. type UrlMapsInvalidateCacheCall struct {
  93758. s *Service
  93759. project string
  93760. urlMap string
  93761. cacheinvalidationrule *CacheInvalidationRule
  93762. urlParams_ gensupport.URLParams
  93763. ctx_ context.Context
  93764. header_ http.Header
  93765. }
  93766. // InvalidateCache: Initiates a cache invalidation operation,
  93767. // invalidating the specified path, scoped to the specified UrlMap.
  93768. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  93769. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93770. c.project = project
  93771. c.urlMap = urlMap
  93772. c.cacheinvalidationrule = cacheinvalidationrule
  93773. return c
  93774. }
  93775. // RequestId sets the optional parameter "requestId": An optional
  93776. // request ID to identify requests. Specify a unique request ID so that
  93777. // if you must retry your request, the server will know to ignore the
  93778. // request if it has already been completed.
  93779. //
  93780. // For example, consider a situation where you make an initial request
  93781. // and the request times out. If you make the request again with the
  93782. // same request ID, the server can check if original operation with the
  93783. // same request ID was received, and if so, will ignore the second
  93784. // request. This prevents clients from accidentally creating duplicate
  93785. // commitments.
  93786. //
  93787. // The request ID must be a valid UUID with the exception that zero UUID
  93788. // is not supported (00000000-0000-0000-0000-000000000000).
  93789. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  93790. c.urlParams_.Set("requestId", requestId)
  93791. return c
  93792. }
  93793. // Fields allows partial responses to be retrieved. See
  93794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93795. // for more information.
  93796. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  93797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93798. return c
  93799. }
  93800. // Context sets the context to be used in this call's Do method. Any
  93801. // pending HTTP request will be aborted if the provided context is
  93802. // canceled.
  93803. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  93804. c.ctx_ = ctx
  93805. return c
  93806. }
  93807. // Header returns an http.Header that can be modified by the caller to
  93808. // add HTTP headers to the request.
  93809. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  93810. if c.header_ == nil {
  93811. c.header_ = make(http.Header)
  93812. }
  93813. return c.header_
  93814. }
  93815. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  93816. reqHeaders := make(http.Header)
  93817. for k, v := range c.header_ {
  93818. reqHeaders[k] = v
  93819. }
  93820. reqHeaders.Set("User-Agent", c.s.userAgent())
  93821. var body io.Reader = nil
  93822. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  93823. if err != nil {
  93824. return nil, err
  93825. }
  93826. reqHeaders.Set("Content-Type", "application/json")
  93827. c.urlParams_.Set("alt", alt)
  93828. c.urlParams_.Set("prettyPrint", "false")
  93829. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  93830. urls += "?" + c.urlParams_.Encode()
  93831. req, err := http.NewRequest("POST", urls, body)
  93832. if err != nil {
  93833. return nil, err
  93834. }
  93835. req.Header = reqHeaders
  93836. googleapi.Expand(req.URL, map[string]string{
  93837. "project": c.project,
  93838. "urlMap": c.urlMap,
  93839. })
  93840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93841. }
  93842. // Do executes the "compute.urlMaps.invalidateCache" call.
  93843. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93844. // status code is an error. Response headers are in either
  93845. // *Operation.ServerResponse.Header or (if a response was returned at
  93846. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93847. // to check whether the returned error was because
  93848. // http.StatusNotModified was returned.
  93849. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93850. gensupport.SetOptions(c.urlParams_, opts...)
  93851. res, err := c.doRequest("json")
  93852. if res != nil && res.StatusCode == http.StatusNotModified {
  93853. if res.Body != nil {
  93854. res.Body.Close()
  93855. }
  93856. return nil, &googleapi.Error{
  93857. Code: res.StatusCode,
  93858. Header: res.Header,
  93859. }
  93860. }
  93861. if err != nil {
  93862. return nil, err
  93863. }
  93864. defer googleapi.CloseBody(res)
  93865. if err := googleapi.CheckResponse(res); err != nil {
  93866. return nil, err
  93867. }
  93868. ret := &Operation{
  93869. ServerResponse: googleapi.ServerResponse{
  93870. Header: res.Header,
  93871. HTTPStatusCode: res.StatusCode,
  93872. },
  93873. }
  93874. target := &ret
  93875. if err := gensupport.DecodeResponse(target, res); err != nil {
  93876. return nil, err
  93877. }
  93878. return ret, nil
  93879. // {
  93880. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  93881. // "httpMethod": "POST",
  93882. // "id": "compute.urlMaps.invalidateCache",
  93883. // "parameterOrder": [
  93884. // "project",
  93885. // "urlMap"
  93886. // ],
  93887. // "parameters": {
  93888. // "project": {
  93889. // "description": "Project ID for this request.",
  93890. // "location": "path",
  93891. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93892. // "required": true,
  93893. // "type": "string"
  93894. // },
  93895. // "requestId": {
  93896. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93897. // "location": "query",
  93898. // "type": "string"
  93899. // },
  93900. // "urlMap": {
  93901. // "description": "Name of the UrlMap scoping this request.",
  93902. // "location": "path",
  93903. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93904. // "required": true,
  93905. // "type": "string"
  93906. // }
  93907. // },
  93908. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  93909. // "request": {
  93910. // "$ref": "CacheInvalidationRule"
  93911. // },
  93912. // "response": {
  93913. // "$ref": "Operation"
  93914. // },
  93915. // "scopes": [
  93916. // "https://www.googleapis.com/auth/cloud-platform",
  93917. // "https://www.googleapis.com/auth/compute"
  93918. // ]
  93919. // }
  93920. }
  93921. // method id "compute.urlMaps.list":
  93922. type UrlMapsListCall struct {
  93923. s *Service
  93924. project string
  93925. urlParams_ gensupport.URLParams
  93926. ifNoneMatch_ string
  93927. ctx_ context.Context
  93928. header_ http.Header
  93929. }
  93930. // List: Retrieves the list of UrlMap resources available to the
  93931. // specified project.
  93932. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  93933. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  93934. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93935. c.project = project
  93936. return c
  93937. }
  93938. // Filter sets the optional parameter "filter": A filter expression that
  93939. // filters resources listed in the response. The expression must specify
  93940. // the field name, a comparison operator, and the value that you want to
  93941. // use for filtering. The value must be a string, a number, or a
  93942. // boolean. The comparison operator must be either =, !=, >, or <.
  93943. //
  93944. // For example, if you are filtering Compute Engine instances, you can
  93945. // exclude instances named example-instance by specifying name !=
  93946. // example-instance.
  93947. //
  93948. // You can also filter nested fields. For example, you could specify
  93949. // scheduling.automaticRestart = false to include instances only if they
  93950. // are not scheduled for automatic restarts. You can use filtering on
  93951. // nested fields to filter based on resource labels.
  93952. //
  93953. // To filter on multiple expressions, provide each separate expression
  93954. // within parentheses. For example, (scheduling.automaticRestart = true)
  93955. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93956. // AND expression. However, you can include AND and OR expressions
  93957. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93958. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93959. // true).
  93960. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  93961. c.urlParams_.Set("filter", filter)
  93962. return c
  93963. }
  93964. // MaxResults sets the optional parameter "maxResults": The maximum
  93965. // number of results per page that should be returned. If the number of
  93966. // available results is larger than maxResults, Compute Engine returns a
  93967. // nextPageToken that can be used to get the next page of results in
  93968. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93969. // (Default: 500)
  93970. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  93971. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93972. return c
  93973. }
  93974. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93975. // a certain order. By default, results are returned in alphanumerical
  93976. // order based on the resource name.
  93977. //
  93978. // You can also sort results in descending order based on the creation
  93979. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93980. // based on the creationTimestamp field in reverse chronological order
  93981. // (newest result first). Use this to sort resources like operations so
  93982. // that the newest operation is returned first.
  93983. //
  93984. // Currently, only sorting by name or creationTimestamp desc is
  93985. // supported.
  93986. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  93987. c.urlParams_.Set("orderBy", orderBy)
  93988. return c
  93989. }
  93990. // PageToken sets the optional parameter "pageToken": Specifies a page
  93991. // token to use. Set pageToken to the nextPageToken returned by a
  93992. // previous list request to get the next page of results.
  93993. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  93994. c.urlParams_.Set("pageToken", pageToken)
  93995. return c
  93996. }
  93997. // Fields allows partial responses to be retrieved. See
  93998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93999. // for more information.
  94000. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  94001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94002. return c
  94003. }
  94004. // IfNoneMatch sets the optional parameter which makes the operation
  94005. // fail if the object's ETag matches the given value. This is useful for
  94006. // getting updates only after the object has changed since the last
  94007. // request. Use googleapi.IsNotModified to check whether the response
  94008. // error from Do is the result of In-None-Match.
  94009. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  94010. c.ifNoneMatch_ = entityTag
  94011. return c
  94012. }
  94013. // Context sets the context to be used in this call's Do method. Any
  94014. // pending HTTP request will be aborted if the provided context is
  94015. // canceled.
  94016. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  94017. c.ctx_ = ctx
  94018. return c
  94019. }
  94020. // Header returns an http.Header that can be modified by the caller to
  94021. // add HTTP headers to the request.
  94022. func (c *UrlMapsListCall) Header() http.Header {
  94023. if c.header_ == nil {
  94024. c.header_ = make(http.Header)
  94025. }
  94026. return c.header_
  94027. }
  94028. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  94029. reqHeaders := make(http.Header)
  94030. for k, v := range c.header_ {
  94031. reqHeaders[k] = v
  94032. }
  94033. reqHeaders.Set("User-Agent", c.s.userAgent())
  94034. if c.ifNoneMatch_ != "" {
  94035. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94036. }
  94037. var body io.Reader = nil
  94038. c.urlParams_.Set("alt", alt)
  94039. c.urlParams_.Set("prettyPrint", "false")
  94040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  94041. urls += "?" + c.urlParams_.Encode()
  94042. req, err := http.NewRequest("GET", urls, body)
  94043. if err != nil {
  94044. return nil, err
  94045. }
  94046. req.Header = reqHeaders
  94047. googleapi.Expand(req.URL, map[string]string{
  94048. "project": c.project,
  94049. })
  94050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94051. }
  94052. // Do executes the "compute.urlMaps.list" call.
  94053. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  94054. // status code is an error. Response headers are in either
  94055. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  94056. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94057. // to check whether the returned error was because
  94058. // http.StatusNotModified was returned.
  94059. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  94060. gensupport.SetOptions(c.urlParams_, opts...)
  94061. res, err := c.doRequest("json")
  94062. if res != nil && res.StatusCode == http.StatusNotModified {
  94063. if res.Body != nil {
  94064. res.Body.Close()
  94065. }
  94066. return nil, &googleapi.Error{
  94067. Code: res.StatusCode,
  94068. Header: res.Header,
  94069. }
  94070. }
  94071. if err != nil {
  94072. return nil, err
  94073. }
  94074. defer googleapi.CloseBody(res)
  94075. if err := googleapi.CheckResponse(res); err != nil {
  94076. return nil, err
  94077. }
  94078. ret := &UrlMapList{
  94079. ServerResponse: googleapi.ServerResponse{
  94080. Header: res.Header,
  94081. HTTPStatusCode: res.StatusCode,
  94082. },
  94083. }
  94084. target := &ret
  94085. if err := gensupport.DecodeResponse(target, res); err != nil {
  94086. return nil, err
  94087. }
  94088. return ret, nil
  94089. // {
  94090. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  94091. // "httpMethod": "GET",
  94092. // "id": "compute.urlMaps.list",
  94093. // "parameterOrder": [
  94094. // "project"
  94095. // ],
  94096. // "parameters": {
  94097. // "filter": {
  94098. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94099. // "location": "query",
  94100. // "type": "string"
  94101. // },
  94102. // "maxResults": {
  94103. // "default": "500",
  94104. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94105. // "format": "uint32",
  94106. // "location": "query",
  94107. // "minimum": "0",
  94108. // "type": "integer"
  94109. // },
  94110. // "orderBy": {
  94111. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94112. // "location": "query",
  94113. // "type": "string"
  94114. // },
  94115. // "pageToken": {
  94116. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94117. // "location": "query",
  94118. // "type": "string"
  94119. // },
  94120. // "project": {
  94121. // "description": "Project ID for this request.",
  94122. // "location": "path",
  94123. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94124. // "required": true,
  94125. // "type": "string"
  94126. // }
  94127. // },
  94128. // "path": "{project}/global/urlMaps",
  94129. // "response": {
  94130. // "$ref": "UrlMapList"
  94131. // },
  94132. // "scopes": [
  94133. // "https://www.googleapis.com/auth/cloud-platform",
  94134. // "https://www.googleapis.com/auth/compute",
  94135. // "https://www.googleapis.com/auth/compute.readonly"
  94136. // ]
  94137. // }
  94138. }
  94139. // Pages invokes f for each page of results.
  94140. // A non-nil error returned from f will halt the iteration.
  94141. // The provided context supersedes any context provided to the Context method.
  94142. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  94143. c.ctx_ = ctx
  94144. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94145. for {
  94146. x, err := c.Do()
  94147. if err != nil {
  94148. return err
  94149. }
  94150. if err := f(x); err != nil {
  94151. return err
  94152. }
  94153. if x.NextPageToken == "" {
  94154. return nil
  94155. }
  94156. c.PageToken(x.NextPageToken)
  94157. }
  94158. }
  94159. // method id "compute.urlMaps.patch":
  94160. type UrlMapsPatchCall struct {
  94161. s *Service
  94162. project string
  94163. urlMap string
  94164. urlmap *UrlMap
  94165. urlParams_ gensupport.URLParams
  94166. ctx_ context.Context
  94167. header_ http.Header
  94168. }
  94169. // Patch: Patches the specified UrlMap resource with the data included
  94170. // in the request. This method supports PATCH semantics and uses the
  94171. // JSON merge patch format and processing rules.
  94172. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  94173. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  94174. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94175. c.project = project
  94176. c.urlMap = urlMap
  94177. c.urlmap = urlmap
  94178. return c
  94179. }
  94180. // RequestId sets the optional parameter "requestId": An optional
  94181. // request ID to identify requests. Specify a unique request ID so that
  94182. // if you must retry your request, the server will know to ignore the
  94183. // request if it has already been completed.
  94184. //
  94185. // For example, consider a situation where you make an initial request
  94186. // and the request times out. If you make the request again with the
  94187. // same request ID, the server can check if original operation with the
  94188. // same request ID was received, and if so, will ignore the second
  94189. // request. This prevents clients from accidentally creating duplicate
  94190. // commitments.
  94191. //
  94192. // The request ID must be a valid UUID with the exception that zero UUID
  94193. // is not supported (00000000-0000-0000-0000-000000000000).
  94194. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  94195. c.urlParams_.Set("requestId", requestId)
  94196. return c
  94197. }
  94198. // Fields allows partial responses to be retrieved. See
  94199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94200. // for more information.
  94201. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  94202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94203. return c
  94204. }
  94205. // Context sets the context to be used in this call's Do method. Any
  94206. // pending HTTP request will be aborted if the provided context is
  94207. // canceled.
  94208. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  94209. c.ctx_ = ctx
  94210. return c
  94211. }
  94212. // Header returns an http.Header that can be modified by the caller to
  94213. // add HTTP headers to the request.
  94214. func (c *UrlMapsPatchCall) Header() http.Header {
  94215. if c.header_ == nil {
  94216. c.header_ = make(http.Header)
  94217. }
  94218. return c.header_
  94219. }
  94220. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  94221. reqHeaders := make(http.Header)
  94222. for k, v := range c.header_ {
  94223. reqHeaders[k] = v
  94224. }
  94225. reqHeaders.Set("User-Agent", c.s.userAgent())
  94226. var body io.Reader = nil
  94227. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  94228. if err != nil {
  94229. return nil, err
  94230. }
  94231. reqHeaders.Set("Content-Type", "application/json")
  94232. c.urlParams_.Set("alt", alt)
  94233. c.urlParams_.Set("prettyPrint", "false")
  94234. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  94235. urls += "?" + c.urlParams_.Encode()
  94236. req, err := http.NewRequest("PATCH", urls, body)
  94237. if err != nil {
  94238. return nil, err
  94239. }
  94240. req.Header = reqHeaders
  94241. googleapi.Expand(req.URL, map[string]string{
  94242. "project": c.project,
  94243. "urlMap": c.urlMap,
  94244. })
  94245. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94246. }
  94247. // Do executes the "compute.urlMaps.patch" call.
  94248. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94249. // status code is an error. Response headers are in either
  94250. // *Operation.ServerResponse.Header or (if a response was returned at
  94251. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94252. // to check whether the returned error was because
  94253. // http.StatusNotModified was returned.
  94254. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94255. gensupport.SetOptions(c.urlParams_, opts...)
  94256. res, err := c.doRequest("json")
  94257. if res != nil && res.StatusCode == http.StatusNotModified {
  94258. if res.Body != nil {
  94259. res.Body.Close()
  94260. }
  94261. return nil, &googleapi.Error{
  94262. Code: res.StatusCode,
  94263. Header: res.Header,
  94264. }
  94265. }
  94266. if err != nil {
  94267. return nil, err
  94268. }
  94269. defer googleapi.CloseBody(res)
  94270. if err := googleapi.CheckResponse(res); err != nil {
  94271. return nil, err
  94272. }
  94273. ret := &Operation{
  94274. ServerResponse: googleapi.ServerResponse{
  94275. Header: res.Header,
  94276. HTTPStatusCode: res.StatusCode,
  94277. },
  94278. }
  94279. target := &ret
  94280. if err := gensupport.DecodeResponse(target, res); err != nil {
  94281. return nil, err
  94282. }
  94283. return ret, nil
  94284. // {
  94285. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  94286. // "httpMethod": "PATCH",
  94287. // "id": "compute.urlMaps.patch",
  94288. // "parameterOrder": [
  94289. // "project",
  94290. // "urlMap"
  94291. // ],
  94292. // "parameters": {
  94293. // "project": {
  94294. // "description": "Project ID for this request.",
  94295. // "location": "path",
  94296. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94297. // "required": true,
  94298. // "type": "string"
  94299. // },
  94300. // "requestId": {
  94301. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94302. // "location": "query",
  94303. // "type": "string"
  94304. // },
  94305. // "urlMap": {
  94306. // "description": "Name of the UrlMap resource to patch.",
  94307. // "location": "path",
  94308. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94309. // "required": true,
  94310. // "type": "string"
  94311. // }
  94312. // },
  94313. // "path": "{project}/global/urlMaps/{urlMap}",
  94314. // "request": {
  94315. // "$ref": "UrlMap"
  94316. // },
  94317. // "response": {
  94318. // "$ref": "Operation"
  94319. // },
  94320. // "scopes": [
  94321. // "https://www.googleapis.com/auth/cloud-platform",
  94322. // "https://www.googleapis.com/auth/compute"
  94323. // ]
  94324. // }
  94325. }
  94326. // method id "compute.urlMaps.update":
  94327. type UrlMapsUpdateCall struct {
  94328. s *Service
  94329. project string
  94330. urlMap string
  94331. urlmap *UrlMap
  94332. urlParams_ gensupport.URLParams
  94333. ctx_ context.Context
  94334. header_ http.Header
  94335. }
  94336. // Update: Updates the specified UrlMap resource with the data included
  94337. // in the request.
  94338. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  94339. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  94340. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94341. c.project = project
  94342. c.urlMap = urlMap
  94343. c.urlmap = urlmap
  94344. return c
  94345. }
  94346. // RequestId sets the optional parameter "requestId": An optional
  94347. // request ID to identify requests. Specify a unique request ID so that
  94348. // if you must retry your request, the server will know to ignore the
  94349. // request if it has already been completed.
  94350. //
  94351. // For example, consider a situation where you make an initial request
  94352. // and the request times out. If you make the request again with the
  94353. // same request ID, the server can check if original operation with the
  94354. // same request ID was received, and if so, will ignore the second
  94355. // request. This prevents clients from accidentally creating duplicate
  94356. // commitments.
  94357. //
  94358. // The request ID must be a valid UUID with the exception that zero UUID
  94359. // is not supported (00000000-0000-0000-0000-000000000000).
  94360. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  94361. c.urlParams_.Set("requestId", requestId)
  94362. return c
  94363. }
  94364. // Fields allows partial responses to be retrieved. See
  94365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94366. // for more information.
  94367. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  94368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94369. return c
  94370. }
  94371. // Context sets the context to be used in this call's Do method. Any
  94372. // pending HTTP request will be aborted if the provided context is
  94373. // canceled.
  94374. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  94375. c.ctx_ = ctx
  94376. return c
  94377. }
  94378. // Header returns an http.Header that can be modified by the caller to
  94379. // add HTTP headers to the request.
  94380. func (c *UrlMapsUpdateCall) Header() http.Header {
  94381. if c.header_ == nil {
  94382. c.header_ = make(http.Header)
  94383. }
  94384. return c.header_
  94385. }
  94386. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  94387. reqHeaders := make(http.Header)
  94388. for k, v := range c.header_ {
  94389. reqHeaders[k] = v
  94390. }
  94391. reqHeaders.Set("User-Agent", c.s.userAgent())
  94392. var body io.Reader = nil
  94393. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  94394. if err != nil {
  94395. return nil, err
  94396. }
  94397. reqHeaders.Set("Content-Type", "application/json")
  94398. c.urlParams_.Set("alt", alt)
  94399. c.urlParams_.Set("prettyPrint", "false")
  94400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  94401. urls += "?" + c.urlParams_.Encode()
  94402. req, err := http.NewRequest("PUT", urls, body)
  94403. if err != nil {
  94404. return nil, err
  94405. }
  94406. req.Header = reqHeaders
  94407. googleapi.Expand(req.URL, map[string]string{
  94408. "project": c.project,
  94409. "urlMap": c.urlMap,
  94410. })
  94411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94412. }
  94413. // Do executes the "compute.urlMaps.update" call.
  94414. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94415. // status code is an error. Response headers are in either
  94416. // *Operation.ServerResponse.Header or (if a response was returned at
  94417. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94418. // to check whether the returned error was because
  94419. // http.StatusNotModified was returned.
  94420. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94421. gensupport.SetOptions(c.urlParams_, opts...)
  94422. res, err := c.doRequest("json")
  94423. if res != nil && res.StatusCode == http.StatusNotModified {
  94424. if res.Body != nil {
  94425. res.Body.Close()
  94426. }
  94427. return nil, &googleapi.Error{
  94428. Code: res.StatusCode,
  94429. Header: res.Header,
  94430. }
  94431. }
  94432. if err != nil {
  94433. return nil, err
  94434. }
  94435. defer googleapi.CloseBody(res)
  94436. if err := googleapi.CheckResponse(res); err != nil {
  94437. return nil, err
  94438. }
  94439. ret := &Operation{
  94440. ServerResponse: googleapi.ServerResponse{
  94441. Header: res.Header,
  94442. HTTPStatusCode: res.StatusCode,
  94443. },
  94444. }
  94445. target := &ret
  94446. if err := gensupport.DecodeResponse(target, res); err != nil {
  94447. return nil, err
  94448. }
  94449. return ret, nil
  94450. // {
  94451. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  94452. // "httpMethod": "PUT",
  94453. // "id": "compute.urlMaps.update",
  94454. // "parameterOrder": [
  94455. // "project",
  94456. // "urlMap"
  94457. // ],
  94458. // "parameters": {
  94459. // "project": {
  94460. // "description": "Project ID for this request.",
  94461. // "location": "path",
  94462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94463. // "required": true,
  94464. // "type": "string"
  94465. // },
  94466. // "requestId": {
  94467. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94468. // "location": "query",
  94469. // "type": "string"
  94470. // },
  94471. // "urlMap": {
  94472. // "description": "Name of the UrlMap resource to update.",
  94473. // "location": "path",
  94474. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94475. // "required": true,
  94476. // "type": "string"
  94477. // }
  94478. // },
  94479. // "path": "{project}/global/urlMaps/{urlMap}",
  94480. // "request": {
  94481. // "$ref": "UrlMap"
  94482. // },
  94483. // "response": {
  94484. // "$ref": "Operation"
  94485. // },
  94486. // "scopes": [
  94487. // "https://www.googleapis.com/auth/cloud-platform",
  94488. // "https://www.googleapis.com/auth/compute"
  94489. // ]
  94490. // }
  94491. }
  94492. // method id "compute.urlMaps.validate":
  94493. type UrlMapsValidateCall struct {
  94494. s *Service
  94495. project string
  94496. urlMap string
  94497. urlmapsvalidaterequest *UrlMapsValidateRequest
  94498. urlParams_ gensupport.URLParams
  94499. ctx_ context.Context
  94500. header_ http.Header
  94501. }
  94502. // Validate: Runs static validation for the UrlMap. In particular, the
  94503. // tests of the provided UrlMap will be run. Calling this method does
  94504. // NOT create the UrlMap.
  94505. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  94506. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  94507. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94508. c.project = project
  94509. c.urlMap = urlMap
  94510. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  94511. return c
  94512. }
  94513. // Fields allows partial responses to be retrieved. See
  94514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94515. // for more information.
  94516. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  94517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94518. return c
  94519. }
  94520. // Context sets the context to be used in this call's Do method. Any
  94521. // pending HTTP request will be aborted if the provided context is
  94522. // canceled.
  94523. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  94524. c.ctx_ = ctx
  94525. return c
  94526. }
  94527. // Header returns an http.Header that can be modified by the caller to
  94528. // add HTTP headers to the request.
  94529. func (c *UrlMapsValidateCall) Header() http.Header {
  94530. if c.header_ == nil {
  94531. c.header_ = make(http.Header)
  94532. }
  94533. return c.header_
  94534. }
  94535. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  94536. reqHeaders := make(http.Header)
  94537. for k, v := range c.header_ {
  94538. reqHeaders[k] = v
  94539. }
  94540. reqHeaders.Set("User-Agent", c.s.userAgent())
  94541. var body io.Reader = nil
  94542. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  94543. if err != nil {
  94544. return nil, err
  94545. }
  94546. reqHeaders.Set("Content-Type", "application/json")
  94547. c.urlParams_.Set("alt", alt)
  94548. c.urlParams_.Set("prettyPrint", "false")
  94549. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  94550. urls += "?" + c.urlParams_.Encode()
  94551. req, err := http.NewRequest("POST", urls, body)
  94552. if err != nil {
  94553. return nil, err
  94554. }
  94555. req.Header = reqHeaders
  94556. googleapi.Expand(req.URL, map[string]string{
  94557. "project": c.project,
  94558. "urlMap": c.urlMap,
  94559. })
  94560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94561. }
  94562. // Do executes the "compute.urlMaps.validate" call.
  94563. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  94564. // non-2xx status code is an error. Response headers are in either
  94565. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  94566. // returned at all) in error.(*googleapi.Error).Header. Use
  94567. // googleapi.IsNotModified to check whether the returned error was
  94568. // because http.StatusNotModified was returned.
  94569. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  94570. gensupport.SetOptions(c.urlParams_, opts...)
  94571. res, err := c.doRequest("json")
  94572. if res != nil && res.StatusCode == http.StatusNotModified {
  94573. if res.Body != nil {
  94574. res.Body.Close()
  94575. }
  94576. return nil, &googleapi.Error{
  94577. Code: res.StatusCode,
  94578. Header: res.Header,
  94579. }
  94580. }
  94581. if err != nil {
  94582. return nil, err
  94583. }
  94584. defer googleapi.CloseBody(res)
  94585. if err := googleapi.CheckResponse(res); err != nil {
  94586. return nil, err
  94587. }
  94588. ret := &UrlMapsValidateResponse{
  94589. ServerResponse: googleapi.ServerResponse{
  94590. Header: res.Header,
  94591. HTTPStatusCode: res.StatusCode,
  94592. },
  94593. }
  94594. target := &ret
  94595. if err := gensupport.DecodeResponse(target, res); err != nil {
  94596. return nil, err
  94597. }
  94598. return ret, nil
  94599. // {
  94600. // "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
  94601. // "httpMethod": "POST",
  94602. // "id": "compute.urlMaps.validate",
  94603. // "parameterOrder": [
  94604. // "project",
  94605. // "urlMap"
  94606. // ],
  94607. // "parameters": {
  94608. // "project": {
  94609. // "description": "Project ID for this request.",
  94610. // "location": "path",
  94611. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94612. // "required": true,
  94613. // "type": "string"
  94614. // },
  94615. // "urlMap": {
  94616. // "description": "Name of the UrlMap resource to be validated as.",
  94617. // "location": "path",
  94618. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94619. // "required": true,
  94620. // "type": "string"
  94621. // }
  94622. // },
  94623. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  94624. // "request": {
  94625. // "$ref": "UrlMapsValidateRequest"
  94626. // },
  94627. // "response": {
  94628. // "$ref": "UrlMapsValidateResponse"
  94629. // },
  94630. // "scopes": [
  94631. // "https://www.googleapis.com/auth/cloud-platform",
  94632. // "https://www.googleapis.com/auth/compute"
  94633. // ]
  94634. // }
  94635. }
  94636. // method id "compute.vpnTunnels.aggregatedList":
  94637. type VpnTunnelsAggregatedListCall struct {
  94638. s *Service
  94639. project string
  94640. urlParams_ gensupport.URLParams
  94641. ifNoneMatch_ string
  94642. ctx_ context.Context
  94643. header_ http.Header
  94644. }
  94645. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  94646. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  94647. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94648. c.project = project
  94649. return c
  94650. }
  94651. // Filter sets the optional parameter "filter": A filter expression that
  94652. // filters resources listed in the response. The expression must specify
  94653. // the field name, a comparison operator, and the value that you want to
  94654. // use for filtering. The value must be a string, a number, or a
  94655. // boolean. The comparison operator must be either =, !=, >, or <.
  94656. //
  94657. // For example, if you are filtering Compute Engine instances, you can
  94658. // exclude instances named example-instance by specifying name !=
  94659. // example-instance.
  94660. //
  94661. // You can also filter nested fields. For example, you could specify
  94662. // scheduling.automaticRestart = false to include instances only if they
  94663. // are not scheduled for automatic restarts. You can use filtering on
  94664. // nested fields to filter based on resource labels.
  94665. //
  94666. // To filter on multiple expressions, provide each separate expression
  94667. // within parentheses. For example, (scheduling.automaticRestart = true)
  94668. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94669. // AND expression. However, you can include AND and OR expressions
  94670. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94671. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94672. // true).
  94673. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  94674. c.urlParams_.Set("filter", filter)
  94675. return c
  94676. }
  94677. // MaxResults sets the optional parameter "maxResults": The maximum
  94678. // number of results per page that should be returned. If the number of
  94679. // available results is larger than maxResults, Compute Engine returns a
  94680. // nextPageToken that can be used to get the next page of results in
  94681. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94682. // (Default: 500)
  94683. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  94684. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94685. return c
  94686. }
  94687. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94688. // a certain order. By default, results are returned in alphanumerical
  94689. // order based on the resource name.
  94690. //
  94691. // You can also sort results in descending order based on the creation
  94692. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94693. // based on the creationTimestamp field in reverse chronological order
  94694. // (newest result first). Use this to sort resources like operations so
  94695. // that the newest operation is returned first.
  94696. //
  94697. // Currently, only sorting by name or creationTimestamp desc is
  94698. // supported.
  94699. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  94700. c.urlParams_.Set("orderBy", orderBy)
  94701. return c
  94702. }
  94703. // PageToken sets the optional parameter "pageToken": Specifies a page
  94704. // token to use. Set pageToken to the nextPageToken returned by a
  94705. // previous list request to get the next page of results.
  94706. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  94707. c.urlParams_.Set("pageToken", pageToken)
  94708. return c
  94709. }
  94710. // Fields allows partial responses to be retrieved. See
  94711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94712. // for more information.
  94713. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  94714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94715. return c
  94716. }
  94717. // IfNoneMatch sets the optional parameter which makes the operation
  94718. // fail if the object's ETag matches the given value. This is useful for
  94719. // getting updates only after the object has changed since the last
  94720. // request. Use googleapi.IsNotModified to check whether the response
  94721. // error from Do is the result of In-None-Match.
  94722. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  94723. c.ifNoneMatch_ = entityTag
  94724. return c
  94725. }
  94726. // Context sets the context to be used in this call's Do method. Any
  94727. // pending HTTP request will be aborted if the provided context is
  94728. // canceled.
  94729. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  94730. c.ctx_ = ctx
  94731. return c
  94732. }
  94733. // Header returns an http.Header that can be modified by the caller to
  94734. // add HTTP headers to the request.
  94735. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  94736. if c.header_ == nil {
  94737. c.header_ = make(http.Header)
  94738. }
  94739. return c.header_
  94740. }
  94741. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  94742. reqHeaders := make(http.Header)
  94743. for k, v := range c.header_ {
  94744. reqHeaders[k] = v
  94745. }
  94746. reqHeaders.Set("User-Agent", c.s.userAgent())
  94747. if c.ifNoneMatch_ != "" {
  94748. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94749. }
  94750. var body io.Reader = nil
  94751. c.urlParams_.Set("alt", alt)
  94752. c.urlParams_.Set("prettyPrint", "false")
  94753. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  94754. urls += "?" + c.urlParams_.Encode()
  94755. req, err := http.NewRequest("GET", urls, body)
  94756. if err != nil {
  94757. return nil, err
  94758. }
  94759. req.Header = reqHeaders
  94760. googleapi.Expand(req.URL, map[string]string{
  94761. "project": c.project,
  94762. })
  94763. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94764. }
  94765. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  94766. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  94767. // non-2xx status code is an error. Response headers are in either
  94768. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  94769. // returned at all) in error.(*googleapi.Error).Header. Use
  94770. // googleapi.IsNotModified to check whether the returned error was
  94771. // because http.StatusNotModified was returned.
  94772. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  94773. gensupport.SetOptions(c.urlParams_, opts...)
  94774. res, err := c.doRequest("json")
  94775. if res != nil && res.StatusCode == http.StatusNotModified {
  94776. if res.Body != nil {
  94777. res.Body.Close()
  94778. }
  94779. return nil, &googleapi.Error{
  94780. Code: res.StatusCode,
  94781. Header: res.Header,
  94782. }
  94783. }
  94784. if err != nil {
  94785. return nil, err
  94786. }
  94787. defer googleapi.CloseBody(res)
  94788. if err := googleapi.CheckResponse(res); err != nil {
  94789. return nil, err
  94790. }
  94791. ret := &VpnTunnelAggregatedList{
  94792. ServerResponse: googleapi.ServerResponse{
  94793. Header: res.Header,
  94794. HTTPStatusCode: res.StatusCode,
  94795. },
  94796. }
  94797. target := &ret
  94798. if err := gensupport.DecodeResponse(target, res); err != nil {
  94799. return nil, err
  94800. }
  94801. return ret, nil
  94802. // {
  94803. // "description": "Retrieves an aggregated list of VPN tunnels.",
  94804. // "httpMethod": "GET",
  94805. // "id": "compute.vpnTunnels.aggregatedList",
  94806. // "parameterOrder": [
  94807. // "project"
  94808. // ],
  94809. // "parameters": {
  94810. // "filter": {
  94811. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94812. // "location": "query",
  94813. // "type": "string"
  94814. // },
  94815. // "maxResults": {
  94816. // "default": "500",
  94817. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94818. // "format": "uint32",
  94819. // "location": "query",
  94820. // "minimum": "0",
  94821. // "type": "integer"
  94822. // },
  94823. // "orderBy": {
  94824. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94825. // "location": "query",
  94826. // "type": "string"
  94827. // },
  94828. // "pageToken": {
  94829. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94830. // "location": "query",
  94831. // "type": "string"
  94832. // },
  94833. // "project": {
  94834. // "description": "Project ID for this request.",
  94835. // "location": "path",
  94836. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94837. // "required": true,
  94838. // "type": "string"
  94839. // }
  94840. // },
  94841. // "path": "{project}/aggregated/vpnTunnels",
  94842. // "response": {
  94843. // "$ref": "VpnTunnelAggregatedList"
  94844. // },
  94845. // "scopes": [
  94846. // "https://www.googleapis.com/auth/cloud-platform",
  94847. // "https://www.googleapis.com/auth/compute",
  94848. // "https://www.googleapis.com/auth/compute.readonly"
  94849. // ]
  94850. // }
  94851. }
  94852. // Pages invokes f for each page of results.
  94853. // A non-nil error returned from f will halt the iteration.
  94854. // The provided context supersedes any context provided to the Context method.
  94855. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  94856. c.ctx_ = ctx
  94857. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94858. for {
  94859. x, err := c.Do()
  94860. if err != nil {
  94861. return err
  94862. }
  94863. if err := f(x); err != nil {
  94864. return err
  94865. }
  94866. if x.NextPageToken == "" {
  94867. return nil
  94868. }
  94869. c.PageToken(x.NextPageToken)
  94870. }
  94871. }
  94872. // method id "compute.vpnTunnels.delete":
  94873. type VpnTunnelsDeleteCall struct {
  94874. s *Service
  94875. project string
  94876. region string
  94877. vpnTunnel string
  94878. urlParams_ gensupport.URLParams
  94879. ctx_ context.Context
  94880. header_ http.Header
  94881. }
  94882. // Delete: Deletes the specified VpnTunnel resource.
  94883. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  94884. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94885. c.project = project
  94886. c.region = region
  94887. c.vpnTunnel = vpnTunnel
  94888. return c
  94889. }
  94890. // RequestId sets the optional parameter "requestId": An optional
  94891. // request ID to identify requests. Specify a unique request ID so that
  94892. // if you must retry your request, the server will know to ignore the
  94893. // request if it has already been completed.
  94894. //
  94895. // For example, consider a situation where you make an initial request
  94896. // and the request times out. If you make the request again with the
  94897. // same request ID, the server can check if original operation with the
  94898. // same request ID was received, and if so, will ignore the second
  94899. // request. This prevents clients from accidentally creating duplicate
  94900. // commitments.
  94901. //
  94902. // The request ID must be a valid UUID with the exception that zero UUID
  94903. // is not supported (00000000-0000-0000-0000-000000000000).
  94904. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  94905. c.urlParams_.Set("requestId", requestId)
  94906. return c
  94907. }
  94908. // Fields allows partial responses to be retrieved. See
  94909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94910. // for more information.
  94911. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  94912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94913. return c
  94914. }
  94915. // Context sets the context to be used in this call's Do method. Any
  94916. // pending HTTP request will be aborted if the provided context is
  94917. // canceled.
  94918. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  94919. c.ctx_ = ctx
  94920. return c
  94921. }
  94922. // Header returns an http.Header that can be modified by the caller to
  94923. // add HTTP headers to the request.
  94924. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  94925. if c.header_ == nil {
  94926. c.header_ = make(http.Header)
  94927. }
  94928. return c.header_
  94929. }
  94930. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  94931. reqHeaders := make(http.Header)
  94932. for k, v := range c.header_ {
  94933. reqHeaders[k] = v
  94934. }
  94935. reqHeaders.Set("User-Agent", c.s.userAgent())
  94936. var body io.Reader = nil
  94937. c.urlParams_.Set("alt", alt)
  94938. c.urlParams_.Set("prettyPrint", "false")
  94939. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  94940. urls += "?" + c.urlParams_.Encode()
  94941. req, err := http.NewRequest("DELETE", urls, body)
  94942. if err != nil {
  94943. return nil, err
  94944. }
  94945. req.Header = reqHeaders
  94946. googleapi.Expand(req.URL, map[string]string{
  94947. "project": c.project,
  94948. "region": c.region,
  94949. "vpnTunnel": c.vpnTunnel,
  94950. })
  94951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94952. }
  94953. // Do executes the "compute.vpnTunnels.delete" call.
  94954. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94955. // status code is an error. Response headers are in either
  94956. // *Operation.ServerResponse.Header or (if a response was returned at
  94957. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94958. // to check whether the returned error was because
  94959. // http.StatusNotModified was returned.
  94960. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94961. gensupport.SetOptions(c.urlParams_, opts...)
  94962. res, err := c.doRequest("json")
  94963. if res != nil && res.StatusCode == http.StatusNotModified {
  94964. if res.Body != nil {
  94965. res.Body.Close()
  94966. }
  94967. return nil, &googleapi.Error{
  94968. Code: res.StatusCode,
  94969. Header: res.Header,
  94970. }
  94971. }
  94972. if err != nil {
  94973. return nil, err
  94974. }
  94975. defer googleapi.CloseBody(res)
  94976. if err := googleapi.CheckResponse(res); err != nil {
  94977. return nil, err
  94978. }
  94979. ret := &Operation{
  94980. ServerResponse: googleapi.ServerResponse{
  94981. Header: res.Header,
  94982. HTTPStatusCode: res.StatusCode,
  94983. },
  94984. }
  94985. target := &ret
  94986. if err := gensupport.DecodeResponse(target, res); err != nil {
  94987. return nil, err
  94988. }
  94989. return ret, nil
  94990. // {
  94991. // "description": "Deletes the specified VpnTunnel resource.",
  94992. // "httpMethod": "DELETE",
  94993. // "id": "compute.vpnTunnels.delete",
  94994. // "parameterOrder": [
  94995. // "project",
  94996. // "region",
  94997. // "vpnTunnel"
  94998. // ],
  94999. // "parameters": {
  95000. // "project": {
  95001. // "description": "Project ID for this request.",
  95002. // "location": "path",
  95003. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95004. // "required": true,
  95005. // "type": "string"
  95006. // },
  95007. // "region": {
  95008. // "description": "Name of the region for this request.",
  95009. // "location": "path",
  95010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95011. // "required": true,
  95012. // "type": "string"
  95013. // },
  95014. // "requestId": {
  95015. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95016. // "location": "query",
  95017. // "type": "string"
  95018. // },
  95019. // "vpnTunnel": {
  95020. // "description": "Name of the VpnTunnel resource to delete.",
  95021. // "location": "path",
  95022. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95023. // "required": true,
  95024. // "type": "string"
  95025. // }
  95026. // },
  95027. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  95028. // "response": {
  95029. // "$ref": "Operation"
  95030. // },
  95031. // "scopes": [
  95032. // "https://www.googleapis.com/auth/cloud-platform",
  95033. // "https://www.googleapis.com/auth/compute"
  95034. // ]
  95035. // }
  95036. }
  95037. // method id "compute.vpnTunnels.get":
  95038. type VpnTunnelsGetCall struct {
  95039. s *Service
  95040. project string
  95041. region string
  95042. vpnTunnel string
  95043. urlParams_ gensupport.URLParams
  95044. ifNoneMatch_ string
  95045. ctx_ context.Context
  95046. header_ http.Header
  95047. }
  95048. // Get: Returns the specified VpnTunnel resource. Gets a list of
  95049. // available VPN tunnels by making a list() request.
  95050. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  95051. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95052. c.project = project
  95053. c.region = region
  95054. c.vpnTunnel = vpnTunnel
  95055. return c
  95056. }
  95057. // Fields allows partial responses to be retrieved. See
  95058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95059. // for more information.
  95060. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  95061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95062. return c
  95063. }
  95064. // IfNoneMatch sets the optional parameter which makes the operation
  95065. // fail if the object's ETag matches the given value. This is useful for
  95066. // getting updates only after the object has changed since the last
  95067. // request. Use googleapi.IsNotModified to check whether the response
  95068. // error from Do is the result of In-None-Match.
  95069. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  95070. c.ifNoneMatch_ = entityTag
  95071. return c
  95072. }
  95073. // Context sets the context to be used in this call's Do method. Any
  95074. // pending HTTP request will be aborted if the provided context is
  95075. // canceled.
  95076. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  95077. c.ctx_ = ctx
  95078. return c
  95079. }
  95080. // Header returns an http.Header that can be modified by the caller to
  95081. // add HTTP headers to the request.
  95082. func (c *VpnTunnelsGetCall) Header() http.Header {
  95083. if c.header_ == nil {
  95084. c.header_ = make(http.Header)
  95085. }
  95086. return c.header_
  95087. }
  95088. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  95089. reqHeaders := make(http.Header)
  95090. for k, v := range c.header_ {
  95091. reqHeaders[k] = v
  95092. }
  95093. reqHeaders.Set("User-Agent", c.s.userAgent())
  95094. if c.ifNoneMatch_ != "" {
  95095. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95096. }
  95097. var body io.Reader = nil
  95098. c.urlParams_.Set("alt", alt)
  95099. c.urlParams_.Set("prettyPrint", "false")
  95100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  95101. urls += "?" + c.urlParams_.Encode()
  95102. req, err := http.NewRequest("GET", urls, body)
  95103. if err != nil {
  95104. return nil, err
  95105. }
  95106. req.Header = reqHeaders
  95107. googleapi.Expand(req.URL, map[string]string{
  95108. "project": c.project,
  95109. "region": c.region,
  95110. "vpnTunnel": c.vpnTunnel,
  95111. })
  95112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95113. }
  95114. // Do executes the "compute.vpnTunnels.get" call.
  95115. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  95116. // status code is an error. Response headers are in either
  95117. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  95118. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95119. // to check whether the returned error was because
  95120. // http.StatusNotModified was returned.
  95121. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  95122. gensupport.SetOptions(c.urlParams_, opts...)
  95123. res, err := c.doRequest("json")
  95124. if res != nil && res.StatusCode == http.StatusNotModified {
  95125. if res.Body != nil {
  95126. res.Body.Close()
  95127. }
  95128. return nil, &googleapi.Error{
  95129. Code: res.StatusCode,
  95130. Header: res.Header,
  95131. }
  95132. }
  95133. if err != nil {
  95134. return nil, err
  95135. }
  95136. defer googleapi.CloseBody(res)
  95137. if err := googleapi.CheckResponse(res); err != nil {
  95138. return nil, err
  95139. }
  95140. ret := &VpnTunnel{
  95141. ServerResponse: googleapi.ServerResponse{
  95142. Header: res.Header,
  95143. HTTPStatusCode: res.StatusCode,
  95144. },
  95145. }
  95146. target := &ret
  95147. if err := gensupport.DecodeResponse(target, res); err != nil {
  95148. return nil, err
  95149. }
  95150. return ret, nil
  95151. // {
  95152. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  95153. // "httpMethod": "GET",
  95154. // "id": "compute.vpnTunnels.get",
  95155. // "parameterOrder": [
  95156. // "project",
  95157. // "region",
  95158. // "vpnTunnel"
  95159. // ],
  95160. // "parameters": {
  95161. // "project": {
  95162. // "description": "Project ID for this request.",
  95163. // "location": "path",
  95164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95165. // "required": true,
  95166. // "type": "string"
  95167. // },
  95168. // "region": {
  95169. // "description": "Name of the region for this request.",
  95170. // "location": "path",
  95171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95172. // "required": true,
  95173. // "type": "string"
  95174. // },
  95175. // "vpnTunnel": {
  95176. // "description": "Name of the VpnTunnel resource to return.",
  95177. // "location": "path",
  95178. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95179. // "required": true,
  95180. // "type": "string"
  95181. // }
  95182. // },
  95183. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  95184. // "response": {
  95185. // "$ref": "VpnTunnel"
  95186. // },
  95187. // "scopes": [
  95188. // "https://www.googleapis.com/auth/cloud-platform",
  95189. // "https://www.googleapis.com/auth/compute",
  95190. // "https://www.googleapis.com/auth/compute.readonly"
  95191. // ]
  95192. // }
  95193. }
  95194. // method id "compute.vpnTunnels.insert":
  95195. type VpnTunnelsInsertCall struct {
  95196. s *Service
  95197. project string
  95198. region string
  95199. vpntunnel *VpnTunnel
  95200. urlParams_ gensupport.URLParams
  95201. ctx_ context.Context
  95202. header_ http.Header
  95203. }
  95204. // Insert: Creates a VpnTunnel resource in the specified project and
  95205. // region using the data included in the request.
  95206. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  95207. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95208. c.project = project
  95209. c.region = region
  95210. c.vpntunnel = vpntunnel
  95211. return c
  95212. }
  95213. // RequestId sets the optional parameter "requestId": An optional
  95214. // request ID to identify requests. Specify a unique request ID so that
  95215. // if you must retry your request, the server will know to ignore the
  95216. // request if it has already been completed.
  95217. //
  95218. // For example, consider a situation where you make an initial request
  95219. // and the request times out. If you make the request again with the
  95220. // same request ID, the server can check if original operation with the
  95221. // same request ID was received, and if so, will ignore the second
  95222. // request. This prevents clients from accidentally creating duplicate
  95223. // commitments.
  95224. //
  95225. // The request ID must be a valid UUID with the exception that zero UUID
  95226. // is not supported (00000000-0000-0000-0000-000000000000).
  95227. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  95228. c.urlParams_.Set("requestId", requestId)
  95229. return c
  95230. }
  95231. // Fields allows partial responses to be retrieved. See
  95232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95233. // for more information.
  95234. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  95235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95236. return c
  95237. }
  95238. // Context sets the context to be used in this call's Do method. Any
  95239. // pending HTTP request will be aborted if the provided context is
  95240. // canceled.
  95241. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  95242. c.ctx_ = ctx
  95243. return c
  95244. }
  95245. // Header returns an http.Header that can be modified by the caller to
  95246. // add HTTP headers to the request.
  95247. func (c *VpnTunnelsInsertCall) Header() http.Header {
  95248. if c.header_ == nil {
  95249. c.header_ = make(http.Header)
  95250. }
  95251. return c.header_
  95252. }
  95253. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  95254. reqHeaders := make(http.Header)
  95255. for k, v := range c.header_ {
  95256. reqHeaders[k] = v
  95257. }
  95258. reqHeaders.Set("User-Agent", c.s.userAgent())
  95259. var body io.Reader = nil
  95260. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  95261. if err != nil {
  95262. return nil, err
  95263. }
  95264. reqHeaders.Set("Content-Type", "application/json")
  95265. c.urlParams_.Set("alt", alt)
  95266. c.urlParams_.Set("prettyPrint", "false")
  95267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  95268. urls += "?" + c.urlParams_.Encode()
  95269. req, err := http.NewRequest("POST", urls, body)
  95270. if err != nil {
  95271. return nil, err
  95272. }
  95273. req.Header = reqHeaders
  95274. googleapi.Expand(req.URL, map[string]string{
  95275. "project": c.project,
  95276. "region": c.region,
  95277. })
  95278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95279. }
  95280. // Do executes the "compute.vpnTunnels.insert" call.
  95281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95282. // status code is an error. Response headers are in either
  95283. // *Operation.ServerResponse.Header or (if a response was returned at
  95284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95285. // to check whether the returned error was because
  95286. // http.StatusNotModified was returned.
  95287. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95288. gensupport.SetOptions(c.urlParams_, opts...)
  95289. res, err := c.doRequest("json")
  95290. if res != nil && res.StatusCode == http.StatusNotModified {
  95291. if res.Body != nil {
  95292. res.Body.Close()
  95293. }
  95294. return nil, &googleapi.Error{
  95295. Code: res.StatusCode,
  95296. Header: res.Header,
  95297. }
  95298. }
  95299. if err != nil {
  95300. return nil, err
  95301. }
  95302. defer googleapi.CloseBody(res)
  95303. if err := googleapi.CheckResponse(res); err != nil {
  95304. return nil, err
  95305. }
  95306. ret := &Operation{
  95307. ServerResponse: googleapi.ServerResponse{
  95308. Header: res.Header,
  95309. HTTPStatusCode: res.StatusCode,
  95310. },
  95311. }
  95312. target := &ret
  95313. if err := gensupport.DecodeResponse(target, res); err != nil {
  95314. return nil, err
  95315. }
  95316. return ret, nil
  95317. // {
  95318. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  95319. // "httpMethod": "POST",
  95320. // "id": "compute.vpnTunnels.insert",
  95321. // "parameterOrder": [
  95322. // "project",
  95323. // "region"
  95324. // ],
  95325. // "parameters": {
  95326. // "project": {
  95327. // "description": "Project ID for this request.",
  95328. // "location": "path",
  95329. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95330. // "required": true,
  95331. // "type": "string"
  95332. // },
  95333. // "region": {
  95334. // "description": "Name of the region for this request.",
  95335. // "location": "path",
  95336. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95337. // "required": true,
  95338. // "type": "string"
  95339. // },
  95340. // "requestId": {
  95341. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95342. // "location": "query",
  95343. // "type": "string"
  95344. // }
  95345. // },
  95346. // "path": "{project}/regions/{region}/vpnTunnels",
  95347. // "request": {
  95348. // "$ref": "VpnTunnel"
  95349. // },
  95350. // "response": {
  95351. // "$ref": "Operation"
  95352. // },
  95353. // "scopes": [
  95354. // "https://www.googleapis.com/auth/cloud-platform",
  95355. // "https://www.googleapis.com/auth/compute"
  95356. // ]
  95357. // }
  95358. }
  95359. // method id "compute.vpnTunnels.list":
  95360. type VpnTunnelsListCall struct {
  95361. s *Service
  95362. project string
  95363. region string
  95364. urlParams_ gensupport.URLParams
  95365. ifNoneMatch_ string
  95366. ctx_ context.Context
  95367. header_ http.Header
  95368. }
  95369. // List: Retrieves a list of VpnTunnel resources contained in the
  95370. // specified project and region.
  95371. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  95372. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95373. c.project = project
  95374. c.region = region
  95375. return c
  95376. }
  95377. // Filter sets the optional parameter "filter": A filter expression that
  95378. // filters resources listed in the response. The expression must specify
  95379. // the field name, a comparison operator, and the value that you want to
  95380. // use for filtering. The value must be a string, a number, or a
  95381. // boolean. The comparison operator must be either =, !=, >, or <.
  95382. //
  95383. // For example, if you are filtering Compute Engine instances, you can
  95384. // exclude instances named example-instance by specifying name !=
  95385. // example-instance.
  95386. //
  95387. // You can also filter nested fields. For example, you could specify
  95388. // scheduling.automaticRestart = false to include instances only if they
  95389. // are not scheduled for automatic restarts. You can use filtering on
  95390. // nested fields to filter based on resource labels.
  95391. //
  95392. // To filter on multiple expressions, provide each separate expression
  95393. // within parentheses. For example, (scheduling.automaticRestart = true)
  95394. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95395. // AND expression. However, you can include AND and OR expressions
  95396. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95397. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95398. // true).
  95399. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  95400. c.urlParams_.Set("filter", filter)
  95401. return c
  95402. }
  95403. // MaxResults sets the optional parameter "maxResults": The maximum
  95404. // number of results per page that should be returned. If the number of
  95405. // available results is larger than maxResults, Compute Engine returns a
  95406. // nextPageToken that can be used to get the next page of results in
  95407. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95408. // (Default: 500)
  95409. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  95410. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95411. return c
  95412. }
  95413. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95414. // a certain order. By default, results are returned in alphanumerical
  95415. // order based on the resource name.
  95416. //
  95417. // You can also sort results in descending order based on the creation
  95418. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95419. // based on the creationTimestamp field in reverse chronological order
  95420. // (newest result first). Use this to sort resources like operations so
  95421. // that the newest operation is returned first.
  95422. //
  95423. // Currently, only sorting by name or creationTimestamp desc is
  95424. // supported.
  95425. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  95426. c.urlParams_.Set("orderBy", orderBy)
  95427. return c
  95428. }
  95429. // PageToken sets the optional parameter "pageToken": Specifies a page
  95430. // token to use. Set pageToken to the nextPageToken returned by a
  95431. // previous list request to get the next page of results.
  95432. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  95433. c.urlParams_.Set("pageToken", pageToken)
  95434. return c
  95435. }
  95436. // Fields allows partial responses to be retrieved. See
  95437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95438. // for more information.
  95439. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  95440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95441. return c
  95442. }
  95443. // IfNoneMatch sets the optional parameter which makes the operation
  95444. // fail if the object's ETag matches the given value. This is useful for
  95445. // getting updates only after the object has changed since the last
  95446. // request. Use googleapi.IsNotModified to check whether the response
  95447. // error from Do is the result of In-None-Match.
  95448. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  95449. c.ifNoneMatch_ = entityTag
  95450. return c
  95451. }
  95452. // Context sets the context to be used in this call's Do method. Any
  95453. // pending HTTP request will be aborted if the provided context is
  95454. // canceled.
  95455. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  95456. c.ctx_ = ctx
  95457. return c
  95458. }
  95459. // Header returns an http.Header that can be modified by the caller to
  95460. // add HTTP headers to the request.
  95461. func (c *VpnTunnelsListCall) Header() http.Header {
  95462. if c.header_ == nil {
  95463. c.header_ = make(http.Header)
  95464. }
  95465. return c.header_
  95466. }
  95467. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  95468. reqHeaders := make(http.Header)
  95469. for k, v := range c.header_ {
  95470. reqHeaders[k] = v
  95471. }
  95472. reqHeaders.Set("User-Agent", c.s.userAgent())
  95473. if c.ifNoneMatch_ != "" {
  95474. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95475. }
  95476. var body io.Reader = nil
  95477. c.urlParams_.Set("alt", alt)
  95478. c.urlParams_.Set("prettyPrint", "false")
  95479. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  95480. urls += "?" + c.urlParams_.Encode()
  95481. req, err := http.NewRequest("GET", urls, body)
  95482. if err != nil {
  95483. return nil, err
  95484. }
  95485. req.Header = reqHeaders
  95486. googleapi.Expand(req.URL, map[string]string{
  95487. "project": c.project,
  95488. "region": c.region,
  95489. })
  95490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95491. }
  95492. // Do executes the "compute.vpnTunnels.list" call.
  95493. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  95494. // status code is an error. Response headers are in either
  95495. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  95496. // at all) in error.(*googleapi.Error).Header. Use
  95497. // googleapi.IsNotModified to check whether the returned error was
  95498. // because http.StatusNotModified was returned.
  95499. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  95500. gensupport.SetOptions(c.urlParams_, opts...)
  95501. res, err := c.doRequest("json")
  95502. if res != nil && res.StatusCode == http.StatusNotModified {
  95503. if res.Body != nil {
  95504. res.Body.Close()
  95505. }
  95506. return nil, &googleapi.Error{
  95507. Code: res.StatusCode,
  95508. Header: res.Header,
  95509. }
  95510. }
  95511. if err != nil {
  95512. return nil, err
  95513. }
  95514. defer googleapi.CloseBody(res)
  95515. if err := googleapi.CheckResponse(res); err != nil {
  95516. return nil, err
  95517. }
  95518. ret := &VpnTunnelList{
  95519. ServerResponse: googleapi.ServerResponse{
  95520. Header: res.Header,
  95521. HTTPStatusCode: res.StatusCode,
  95522. },
  95523. }
  95524. target := &ret
  95525. if err := gensupport.DecodeResponse(target, res); err != nil {
  95526. return nil, err
  95527. }
  95528. return ret, nil
  95529. // {
  95530. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  95531. // "httpMethod": "GET",
  95532. // "id": "compute.vpnTunnels.list",
  95533. // "parameterOrder": [
  95534. // "project",
  95535. // "region"
  95536. // ],
  95537. // "parameters": {
  95538. // "filter": {
  95539. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  95540. // "location": "query",
  95541. // "type": "string"
  95542. // },
  95543. // "maxResults": {
  95544. // "default": "500",
  95545. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  95546. // "format": "uint32",
  95547. // "location": "query",
  95548. // "minimum": "0",
  95549. // "type": "integer"
  95550. // },
  95551. // "orderBy": {
  95552. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  95553. // "location": "query",
  95554. // "type": "string"
  95555. // },
  95556. // "pageToken": {
  95557. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  95558. // "location": "query",
  95559. // "type": "string"
  95560. // },
  95561. // "project": {
  95562. // "description": "Project ID for this request.",
  95563. // "location": "path",
  95564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95565. // "required": true,
  95566. // "type": "string"
  95567. // },
  95568. // "region": {
  95569. // "description": "Name of the region for this request.",
  95570. // "location": "path",
  95571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95572. // "required": true,
  95573. // "type": "string"
  95574. // }
  95575. // },
  95576. // "path": "{project}/regions/{region}/vpnTunnels",
  95577. // "response": {
  95578. // "$ref": "VpnTunnelList"
  95579. // },
  95580. // "scopes": [
  95581. // "https://www.googleapis.com/auth/cloud-platform",
  95582. // "https://www.googleapis.com/auth/compute",
  95583. // "https://www.googleapis.com/auth/compute.readonly"
  95584. // ]
  95585. // }
  95586. }
  95587. // Pages invokes f for each page of results.
  95588. // A non-nil error returned from f will halt the iteration.
  95589. // The provided context supersedes any context provided to the Context method.
  95590. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  95591. c.ctx_ = ctx
  95592. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95593. for {
  95594. x, err := c.Do()
  95595. if err != nil {
  95596. return err
  95597. }
  95598. if err := f(x); err != nil {
  95599. return err
  95600. }
  95601. if x.NextPageToken == "" {
  95602. return nil
  95603. }
  95604. c.PageToken(x.NextPageToken)
  95605. }
  95606. }
  95607. // method id "compute.zoneOperations.delete":
  95608. type ZoneOperationsDeleteCall struct {
  95609. s *Service
  95610. project string
  95611. zone string
  95612. operation string
  95613. urlParams_ gensupport.URLParams
  95614. ctx_ context.Context
  95615. header_ http.Header
  95616. }
  95617. // Delete: Deletes the specified zone-specific Operations resource.
  95618. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  95619. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  95620. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95621. c.project = project
  95622. c.zone = zone
  95623. c.operation = operation
  95624. return c
  95625. }
  95626. // Fields allows partial responses to be retrieved. See
  95627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95628. // for more information.
  95629. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  95630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95631. return c
  95632. }
  95633. // Context sets the context to be used in this call's Do method. Any
  95634. // pending HTTP request will be aborted if the provided context is
  95635. // canceled.
  95636. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  95637. c.ctx_ = ctx
  95638. return c
  95639. }
  95640. // Header returns an http.Header that can be modified by the caller to
  95641. // add HTTP headers to the request.
  95642. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  95643. if c.header_ == nil {
  95644. c.header_ = make(http.Header)
  95645. }
  95646. return c.header_
  95647. }
  95648. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  95649. reqHeaders := make(http.Header)
  95650. for k, v := range c.header_ {
  95651. reqHeaders[k] = v
  95652. }
  95653. reqHeaders.Set("User-Agent", c.s.userAgent())
  95654. var body io.Reader = nil
  95655. c.urlParams_.Set("alt", alt)
  95656. c.urlParams_.Set("prettyPrint", "false")
  95657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  95658. urls += "?" + c.urlParams_.Encode()
  95659. req, err := http.NewRequest("DELETE", urls, body)
  95660. if err != nil {
  95661. return nil, err
  95662. }
  95663. req.Header = reqHeaders
  95664. googleapi.Expand(req.URL, map[string]string{
  95665. "project": c.project,
  95666. "zone": c.zone,
  95667. "operation": c.operation,
  95668. })
  95669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95670. }
  95671. // Do executes the "compute.zoneOperations.delete" call.
  95672. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  95673. gensupport.SetOptions(c.urlParams_, opts...)
  95674. res, err := c.doRequest("json")
  95675. if err != nil {
  95676. return err
  95677. }
  95678. defer googleapi.CloseBody(res)
  95679. if err := googleapi.CheckResponse(res); err != nil {
  95680. return err
  95681. }
  95682. return nil
  95683. // {
  95684. // "description": "Deletes the specified zone-specific Operations resource.",
  95685. // "httpMethod": "DELETE",
  95686. // "id": "compute.zoneOperations.delete",
  95687. // "parameterOrder": [
  95688. // "project",
  95689. // "zone",
  95690. // "operation"
  95691. // ],
  95692. // "parameters": {
  95693. // "operation": {
  95694. // "description": "Name of the Operations resource to delete.",
  95695. // "location": "path",
  95696. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95697. // "required": true,
  95698. // "type": "string"
  95699. // },
  95700. // "project": {
  95701. // "description": "Project ID for this request.",
  95702. // "location": "path",
  95703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95704. // "required": true,
  95705. // "type": "string"
  95706. // },
  95707. // "zone": {
  95708. // "description": "Name of the zone for this request.",
  95709. // "location": "path",
  95710. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95711. // "required": true,
  95712. // "type": "string"
  95713. // }
  95714. // },
  95715. // "path": "{project}/zones/{zone}/operations/{operation}",
  95716. // "scopes": [
  95717. // "https://www.googleapis.com/auth/cloud-platform",
  95718. // "https://www.googleapis.com/auth/compute"
  95719. // ]
  95720. // }
  95721. }
  95722. // method id "compute.zoneOperations.get":
  95723. type ZoneOperationsGetCall struct {
  95724. s *Service
  95725. project string
  95726. zone string
  95727. operation string
  95728. urlParams_ gensupport.URLParams
  95729. ifNoneMatch_ string
  95730. ctx_ context.Context
  95731. header_ http.Header
  95732. }
  95733. // Get: Retrieves the specified zone-specific Operations resource.
  95734. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  95735. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  95736. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95737. c.project = project
  95738. c.zone = zone
  95739. c.operation = operation
  95740. return c
  95741. }
  95742. // Fields allows partial responses to be retrieved. See
  95743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95744. // for more information.
  95745. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  95746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95747. return c
  95748. }
  95749. // IfNoneMatch sets the optional parameter which makes the operation
  95750. // fail if the object's ETag matches the given value. This is useful for
  95751. // getting updates only after the object has changed since the last
  95752. // request. Use googleapi.IsNotModified to check whether the response
  95753. // error from Do is the result of In-None-Match.
  95754. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  95755. c.ifNoneMatch_ = entityTag
  95756. return c
  95757. }
  95758. // Context sets the context to be used in this call's Do method. Any
  95759. // pending HTTP request will be aborted if the provided context is
  95760. // canceled.
  95761. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  95762. c.ctx_ = ctx
  95763. return c
  95764. }
  95765. // Header returns an http.Header that can be modified by the caller to
  95766. // add HTTP headers to the request.
  95767. func (c *ZoneOperationsGetCall) Header() http.Header {
  95768. if c.header_ == nil {
  95769. c.header_ = make(http.Header)
  95770. }
  95771. return c.header_
  95772. }
  95773. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  95774. reqHeaders := make(http.Header)
  95775. for k, v := range c.header_ {
  95776. reqHeaders[k] = v
  95777. }
  95778. reqHeaders.Set("User-Agent", c.s.userAgent())
  95779. if c.ifNoneMatch_ != "" {
  95780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95781. }
  95782. var body io.Reader = nil
  95783. c.urlParams_.Set("alt", alt)
  95784. c.urlParams_.Set("prettyPrint", "false")
  95785. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  95786. urls += "?" + c.urlParams_.Encode()
  95787. req, err := http.NewRequest("GET", urls, body)
  95788. if err != nil {
  95789. return nil, err
  95790. }
  95791. req.Header = reqHeaders
  95792. googleapi.Expand(req.URL, map[string]string{
  95793. "project": c.project,
  95794. "zone": c.zone,
  95795. "operation": c.operation,
  95796. })
  95797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95798. }
  95799. // Do executes the "compute.zoneOperations.get" call.
  95800. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95801. // status code is an error. Response headers are in either
  95802. // *Operation.ServerResponse.Header or (if a response was returned at
  95803. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95804. // to check whether the returned error was because
  95805. // http.StatusNotModified was returned.
  95806. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95807. gensupport.SetOptions(c.urlParams_, opts...)
  95808. res, err := c.doRequest("json")
  95809. if res != nil && res.StatusCode == http.StatusNotModified {
  95810. if res.Body != nil {
  95811. res.Body.Close()
  95812. }
  95813. return nil, &googleapi.Error{
  95814. Code: res.StatusCode,
  95815. Header: res.Header,
  95816. }
  95817. }
  95818. if err != nil {
  95819. return nil, err
  95820. }
  95821. defer googleapi.CloseBody(res)
  95822. if err := googleapi.CheckResponse(res); err != nil {
  95823. return nil, err
  95824. }
  95825. ret := &Operation{
  95826. ServerResponse: googleapi.ServerResponse{
  95827. Header: res.Header,
  95828. HTTPStatusCode: res.StatusCode,
  95829. },
  95830. }
  95831. target := &ret
  95832. if err := gensupport.DecodeResponse(target, res); err != nil {
  95833. return nil, err
  95834. }
  95835. return ret, nil
  95836. // {
  95837. // "description": "Retrieves the specified zone-specific Operations resource.",
  95838. // "httpMethod": "GET",
  95839. // "id": "compute.zoneOperations.get",
  95840. // "parameterOrder": [
  95841. // "project",
  95842. // "zone",
  95843. // "operation"
  95844. // ],
  95845. // "parameters": {
  95846. // "operation": {
  95847. // "description": "Name of the Operations resource to return.",
  95848. // "location": "path",
  95849. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95850. // "required": true,
  95851. // "type": "string"
  95852. // },
  95853. // "project": {
  95854. // "description": "Project ID for this request.",
  95855. // "location": "path",
  95856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95857. // "required": true,
  95858. // "type": "string"
  95859. // },
  95860. // "zone": {
  95861. // "description": "Name of the zone for this request.",
  95862. // "location": "path",
  95863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95864. // "required": true,
  95865. // "type": "string"
  95866. // }
  95867. // },
  95868. // "path": "{project}/zones/{zone}/operations/{operation}",
  95869. // "response": {
  95870. // "$ref": "Operation"
  95871. // },
  95872. // "scopes": [
  95873. // "https://www.googleapis.com/auth/cloud-platform",
  95874. // "https://www.googleapis.com/auth/compute",
  95875. // "https://www.googleapis.com/auth/compute.readonly"
  95876. // ]
  95877. // }
  95878. }
  95879. // method id "compute.zoneOperations.list":
  95880. type ZoneOperationsListCall struct {
  95881. s *Service
  95882. project string
  95883. zone string
  95884. urlParams_ gensupport.URLParams
  95885. ifNoneMatch_ string
  95886. ctx_ context.Context
  95887. header_ http.Header
  95888. }
  95889. // List: Retrieves a list of Operation resources contained within the
  95890. // specified zone.
  95891. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  95892. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  95893. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95894. c.project = project
  95895. c.zone = zone
  95896. return c
  95897. }
  95898. // Filter sets the optional parameter "filter": A filter expression that
  95899. // filters resources listed in the response. The expression must specify
  95900. // the field name, a comparison operator, and the value that you want to
  95901. // use for filtering. The value must be a string, a number, or a
  95902. // boolean. The comparison operator must be either =, !=, >, or <.
  95903. //
  95904. // For example, if you are filtering Compute Engine instances, you can
  95905. // exclude instances named example-instance by specifying name !=
  95906. // example-instance.
  95907. //
  95908. // You can also filter nested fields. For example, you could specify
  95909. // scheduling.automaticRestart = false to include instances only if they
  95910. // are not scheduled for automatic restarts. You can use filtering on
  95911. // nested fields to filter based on resource labels.
  95912. //
  95913. // To filter on multiple expressions, provide each separate expression
  95914. // within parentheses. For example, (scheduling.automaticRestart = true)
  95915. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95916. // AND expression. However, you can include AND and OR expressions
  95917. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95918. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95919. // true).
  95920. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  95921. c.urlParams_.Set("filter", filter)
  95922. return c
  95923. }
  95924. // MaxResults sets the optional parameter "maxResults": The maximum
  95925. // number of results per page that should be returned. If the number of
  95926. // available results is larger than maxResults, Compute Engine returns a
  95927. // nextPageToken that can be used to get the next page of results in
  95928. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95929. // (Default: 500)
  95930. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  95931. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95932. return c
  95933. }
  95934. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95935. // a certain order. By default, results are returned in alphanumerical
  95936. // order based on the resource name.
  95937. //
  95938. // You can also sort results in descending order based on the creation
  95939. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95940. // based on the creationTimestamp field in reverse chronological order
  95941. // (newest result first). Use this to sort resources like operations so
  95942. // that the newest operation is returned first.
  95943. //
  95944. // Currently, only sorting by name or creationTimestamp desc is
  95945. // supported.
  95946. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  95947. c.urlParams_.Set("orderBy", orderBy)
  95948. return c
  95949. }
  95950. // PageToken sets the optional parameter "pageToken": Specifies a page
  95951. // token to use. Set pageToken to the nextPageToken returned by a
  95952. // previous list request to get the next page of results.
  95953. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  95954. c.urlParams_.Set("pageToken", pageToken)
  95955. return c
  95956. }
  95957. // Fields allows partial responses to be retrieved. See
  95958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95959. // for more information.
  95960. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  95961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95962. return c
  95963. }
  95964. // IfNoneMatch sets the optional parameter which makes the operation
  95965. // fail if the object's ETag matches the given value. This is useful for
  95966. // getting updates only after the object has changed since the last
  95967. // request. Use googleapi.IsNotModified to check whether the response
  95968. // error from Do is the result of In-None-Match.
  95969. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  95970. c.ifNoneMatch_ = entityTag
  95971. return c
  95972. }
  95973. // Context sets the context to be used in this call's Do method. Any
  95974. // pending HTTP request will be aborted if the provided context is
  95975. // canceled.
  95976. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  95977. c.ctx_ = ctx
  95978. return c
  95979. }
  95980. // Header returns an http.Header that can be modified by the caller to
  95981. // add HTTP headers to the request.
  95982. func (c *ZoneOperationsListCall) Header() http.Header {
  95983. if c.header_ == nil {
  95984. c.header_ = make(http.Header)
  95985. }
  95986. return c.header_
  95987. }
  95988. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  95989. reqHeaders := make(http.Header)
  95990. for k, v := range c.header_ {
  95991. reqHeaders[k] = v
  95992. }
  95993. reqHeaders.Set("User-Agent", c.s.userAgent())
  95994. if c.ifNoneMatch_ != "" {
  95995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95996. }
  95997. var body io.Reader = nil
  95998. c.urlParams_.Set("alt", alt)
  95999. c.urlParams_.Set("prettyPrint", "false")
  96000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  96001. urls += "?" + c.urlParams_.Encode()
  96002. req, err := http.NewRequest("GET", urls, body)
  96003. if err != nil {
  96004. return nil, err
  96005. }
  96006. req.Header = reqHeaders
  96007. googleapi.Expand(req.URL, map[string]string{
  96008. "project": c.project,
  96009. "zone": c.zone,
  96010. })
  96011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96012. }
  96013. // Do executes the "compute.zoneOperations.list" call.
  96014. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  96015. // status code is an error. Response headers are in either
  96016. // *OperationList.ServerResponse.Header or (if a response was returned
  96017. // at all) in error.(*googleapi.Error).Header. Use
  96018. // googleapi.IsNotModified to check whether the returned error was
  96019. // because http.StatusNotModified was returned.
  96020. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  96021. gensupport.SetOptions(c.urlParams_, opts...)
  96022. res, err := c.doRequest("json")
  96023. if res != nil && res.StatusCode == http.StatusNotModified {
  96024. if res.Body != nil {
  96025. res.Body.Close()
  96026. }
  96027. return nil, &googleapi.Error{
  96028. Code: res.StatusCode,
  96029. Header: res.Header,
  96030. }
  96031. }
  96032. if err != nil {
  96033. return nil, err
  96034. }
  96035. defer googleapi.CloseBody(res)
  96036. if err := googleapi.CheckResponse(res); err != nil {
  96037. return nil, err
  96038. }
  96039. ret := &OperationList{
  96040. ServerResponse: googleapi.ServerResponse{
  96041. Header: res.Header,
  96042. HTTPStatusCode: res.StatusCode,
  96043. },
  96044. }
  96045. target := &ret
  96046. if err := gensupport.DecodeResponse(target, res); err != nil {
  96047. return nil, err
  96048. }
  96049. return ret, nil
  96050. // {
  96051. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  96052. // "httpMethod": "GET",
  96053. // "id": "compute.zoneOperations.list",
  96054. // "parameterOrder": [
  96055. // "project",
  96056. // "zone"
  96057. // ],
  96058. // "parameters": {
  96059. // "filter": {
  96060. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96061. // "location": "query",
  96062. // "type": "string"
  96063. // },
  96064. // "maxResults": {
  96065. // "default": "500",
  96066. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96067. // "format": "uint32",
  96068. // "location": "query",
  96069. // "minimum": "0",
  96070. // "type": "integer"
  96071. // },
  96072. // "orderBy": {
  96073. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96074. // "location": "query",
  96075. // "type": "string"
  96076. // },
  96077. // "pageToken": {
  96078. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96079. // "location": "query",
  96080. // "type": "string"
  96081. // },
  96082. // "project": {
  96083. // "description": "Project ID for this request.",
  96084. // "location": "path",
  96085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96086. // "required": true,
  96087. // "type": "string"
  96088. // },
  96089. // "zone": {
  96090. // "description": "Name of the zone for request.",
  96091. // "location": "path",
  96092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96093. // "required": true,
  96094. // "type": "string"
  96095. // }
  96096. // },
  96097. // "path": "{project}/zones/{zone}/operations",
  96098. // "response": {
  96099. // "$ref": "OperationList"
  96100. // },
  96101. // "scopes": [
  96102. // "https://www.googleapis.com/auth/cloud-platform",
  96103. // "https://www.googleapis.com/auth/compute",
  96104. // "https://www.googleapis.com/auth/compute.readonly"
  96105. // ]
  96106. // }
  96107. }
  96108. // Pages invokes f for each page of results.
  96109. // A non-nil error returned from f will halt the iteration.
  96110. // The provided context supersedes any context provided to the Context method.
  96111. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  96112. c.ctx_ = ctx
  96113. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96114. for {
  96115. x, err := c.Do()
  96116. if err != nil {
  96117. return err
  96118. }
  96119. if err := f(x); err != nil {
  96120. return err
  96121. }
  96122. if x.NextPageToken == "" {
  96123. return nil
  96124. }
  96125. c.PageToken(x.NextPageToken)
  96126. }
  96127. }
  96128. // method id "compute.zones.get":
  96129. type ZonesGetCall struct {
  96130. s *Service
  96131. project string
  96132. zone string
  96133. urlParams_ gensupport.URLParams
  96134. ifNoneMatch_ string
  96135. ctx_ context.Context
  96136. header_ http.Header
  96137. }
  96138. // Get: Returns the specified Zone resource. Gets a list of available
  96139. // zones by making a list() request.
  96140. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  96141. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  96142. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96143. c.project = project
  96144. c.zone = zone
  96145. return c
  96146. }
  96147. // Fields allows partial responses to be retrieved. See
  96148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96149. // for more information.
  96150. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  96151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96152. return c
  96153. }
  96154. // IfNoneMatch sets the optional parameter which makes the operation
  96155. // fail if the object's ETag matches the given value. This is useful for
  96156. // getting updates only after the object has changed since the last
  96157. // request. Use googleapi.IsNotModified to check whether the response
  96158. // error from Do is the result of In-None-Match.
  96159. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  96160. c.ifNoneMatch_ = entityTag
  96161. return c
  96162. }
  96163. // Context sets the context to be used in this call's Do method. Any
  96164. // pending HTTP request will be aborted if the provided context is
  96165. // canceled.
  96166. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  96167. c.ctx_ = ctx
  96168. return c
  96169. }
  96170. // Header returns an http.Header that can be modified by the caller to
  96171. // add HTTP headers to the request.
  96172. func (c *ZonesGetCall) Header() http.Header {
  96173. if c.header_ == nil {
  96174. c.header_ = make(http.Header)
  96175. }
  96176. return c.header_
  96177. }
  96178. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  96179. reqHeaders := make(http.Header)
  96180. for k, v := range c.header_ {
  96181. reqHeaders[k] = v
  96182. }
  96183. reqHeaders.Set("User-Agent", c.s.userAgent())
  96184. if c.ifNoneMatch_ != "" {
  96185. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96186. }
  96187. var body io.Reader = nil
  96188. c.urlParams_.Set("alt", alt)
  96189. c.urlParams_.Set("prettyPrint", "false")
  96190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  96191. urls += "?" + c.urlParams_.Encode()
  96192. req, err := http.NewRequest("GET", urls, body)
  96193. if err != nil {
  96194. return nil, err
  96195. }
  96196. req.Header = reqHeaders
  96197. googleapi.Expand(req.URL, map[string]string{
  96198. "project": c.project,
  96199. "zone": c.zone,
  96200. })
  96201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96202. }
  96203. // Do executes the "compute.zones.get" call.
  96204. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  96205. // code is an error. Response headers are in either
  96206. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  96207. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  96208. // whether the returned error was because http.StatusNotModified was
  96209. // returned.
  96210. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  96211. gensupport.SetOptions(c.urlParams_, opts...)
  96212. res, err := c.doRequest("json")
  96213. if res != nil && res.StatusCode == http.StatusNotModified {
  96214. if res.Body != nil {
  96215. res.Body.Close()
  96216. }
  96217. return nil, &googleapi.Error{
  96218. Code: res.StatusCode,
  96219. Header: res.Header,
  96220. }
  96221. }
  96222. if err != nil {
  96223. return nil, err
  96224. }
  96225. defer googleapi.CloseBody(res)
  96226. if err := googleapi.CheckResponse(res); err != nil {
  96227. return nil, err
  96228. }
  96229. ret := &Zone{
  96230. ServerResponse: googleapi.ServerResponse{
  96231. Header: res.Header,
  96232. HTTPStatusCode: res.StatusCode,
  96233. },
  96234. }
  96235. target := &ret
  96236. if err := gensupport.DecodeResponse(target, res); err != nil {
  96237. return nil, err
  96238. }
  96239. return ret, nil
  96240. // {
  96241. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  96242. // "httpMethod": "GET",
  96243. // "id": "compute.zones.get",
  96244. // "parameterOrder": [
  96245. // "project",
  96246. // "zone"
  96247. // ],
  96248. // "parameters": {
  96249. // "project": {
  96250. // "description": "Project ID for this request.",
  96251. // "location": "path",
  96252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96253. // "required": true,
  96254. // "type": "string"
  96255. // },
  96256. // "zone": {
  96257. // "description": "Name of the zone resource to return.",
  96258. // "location": "path",
  96259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96260. // "required": true,
  96261. // "type": "string"
  96262. // }
  96263. // },
  96264. // "path": "{project}/zones/{zone}",
  96265. // "response": {
  96266. // "$ref": "Zone"
  96267. // },
  96268. // "scopes": [
  96269. // "https://www.googleapis.com/auth/cloud-platform",
  96270. // "https://www.googleapis.com/auth/compute",
  96271. // "https://www.googleapis.com/auth/compute.readonly"
  96272. // ]
  96273. // }
  96274. }
  96275. // method id "compute.zones.list":
  96276. type ZonesListCall struct {
  96277. s *Service
  96278. project string
  96279. urlParams_ gensupport.URLParams
  96280. ifNoneMatch_ string
  96281. ctx_ context.Context
  96282. header_ http.Header
  96283. }
  96284. // List: Retrieves the list of Zone resources available to the specified
  96285. // project.
  96286. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  96287. func (r *ZonesService) List(project string) *ZonesListCall {
  96288. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96289. c.project = project
  96290. return c
  96291. }
  96292. // Filter sets the optional parameter "filter": A filter expression that
  96293. // filters resources listed in the response. The expression must specify
  96294. // the field name, a comparison operator, and the value that you want to
  96295. // use for filtering. The value must be a string, a number, or a
  96296. // boolean. The comparison operator must be either =, !=, >, or <.
  96297. //
  96298. // For example, if you are filtering Compute Engine instances, you can
  96299. // exclude instances named example-instance by specifying name !=
  96300. // example-instance.
  96301. //
  96302. // You can also filter nested fields. For example, you could specify
  96303. // scheduling.automaticRestart = false to include instances only if they
  96304. // are not scheduled for automatic restarts. You can use filtering on
  96305. // nested fields to filter based on resource labels.
  96306. //
  96307. // To filter on multiple expressions, provide each separate expression
  96308. // within parentheses. For example, (scheduling.automaticRestart = true)
  96309. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96310. // AND expression. However, you can include AND and OR expressions
  96311. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96312. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96313. // true).
  96314. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  96315. c.urlParams_.Set("filter", filter)
  96316. return c
  96317. }
  96318. // MaxResults sets the optional parameter "maxResults": The maximum
  96319. // number of results per page that should be returned. If the number of
  96320. // available results is larger than maxResults, Compute Engine returns a
  96321. // nextPageToken that can be used to get the next page of results in
  96322. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96323. // (Default: 500)
  96324. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  96325. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96326. return c
  96327. }
  96328. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96329. // a certain order. By default, results are returned in alphanumerical
  96330. // order based on the resource name.
  96331. //
  96332. // You can also sort results in descending order based on the creation
  96333. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96334. // based on the creationTimestamp field in reverse chronological order
  96335. // (newest result first). Use this to sort resources like operations so
  96336. // that the newest operation is returned first.
  96337. //
  96338. // Currently, only sorting by name or creationTimestamp desc is
  96339. // supported.
  96340. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  96341. c.urlParams_.Set("orderBy", orderBy)
  96342. return c
  96343. }
  96344. // PageToken sets the optional parameter "pageToken": Specifies a page
  96345. // token to use. Set pageToken to the nextPageToken returned by a
  96346. // previous list request to get the next page of results.
  96347. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  96348. c.urlParams_.Set("pageToken", pageToken)
  96349. return c
  96350. }
  96351. // Fields allows partial responses to be retrieved. See
  96352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96353. // for more information.
  96354. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  96355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96356. return c
  96357. }
  96358. // IfNoneMatch sets the optional parameter which makes the operation
  96359. // fail if the object's ETag matches the given value. This is useful for
  96360. // getting updates only after the object has changed since the last
  96361. // request. Use googleapi.IsNotModified to check whether the response
  96362. // error from Do is the result of In-None-Match.
  96363. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  96364. c.ifNoneMatch_ = entityTag
  96365. return c
  96366. }
  96367. // Context sets the context to be used in this call's Do method. Any
  96368. // pending HTTP request will be aborted if the provided context is
  96369. // canceled.
  96370. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  96371. c.ctx_ = ctx
  96372. return c
  96373. }
  96374. // Header returns an http.Header that can be modified by the caller to
  96375. // add HTTP headers to the request.
  96376. func (c *ZonesListCall) Header() http.Header {
  96377. if c.header_ == nil {
  96378. c.header_ = make(http.Header)
  96379. }
  96380. return c.header_
  96381. }
  96382. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  96383. reqHeaders := make(http.Header)
  96384. for k, v := range c.header_ {
  96385. reqHeaders[k] = v
  96386. }
  96387. reqHeaders.Set("User-Agent", c.s.userAgent())
  96388. if c.ifNoneMatch_ != "" {
  96389. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96390. }
  96391. var body io.Reader = nil
  96392. c.urlParams_.Set("alt", alt)
  96393. c.urlParams_.Set("prettyPrint", "false")
  96394. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  96395. urls += "?" + c.urlParams_.Encode()
  96396. req, err := http.NewRequest("GET", urls, body)
  96397. if err != nil {
  96398. return nil, err
  96399. }
  96400. req.Header = reqHeaders
  96401. googleapi.Expand(req.URL, map[string]string{
  96402. "project": c.project,
  96403. })
  96404. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96405. }
  96406. // Do executes the "compute.zones.list" call.
  96407. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  96408. // code is an error. Response headers are in either
  96409. // *ZoneList.ServerResponse.Header or (if a response was returned at
  96410. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96411. // to check whether the returned error was because
  96412. // http.StatusNotModified was returned.
  96413. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  96414. gensupport.SetOptions(c.urlParams_, opts...)
  96415. res, err := c.doRequest("json")
  96416. if res != nil && res.StatusCode == http.StatusNotModified {
  96417. if res.Body != nil {
  96418. res.Body.Close()
  96419. }
  96420. return nil, &googleapi.Error{
  96421. Code: res.StatusCode,
  96422. Header: res.Header,
  96423. }
  96424. }
  96425. if err != nil {
  96426. return nil, err
  96427. }
  96428. defer googleapi.CloseBody(res)
  96429. if err := googleapi.CheckResponse(res); err != nil {
  96430. return nil, err
  96431. }
  96432. ret := &ZoneList{
  96433. ServerResponse: googleapi.ServerResponse{
  96434. Header: res.Header,
  96435. HTTPStatusCode: res.StatusCode,
  96436. },
  96437. }
  96438. target := &ret
  96439. if err := gensupport.DecodeResponse(target, res); err != nil {
  96440. return nil, err
  96441. }
  96442. return ret, nil
  96443. // {
  96444. // "description": "Retrieves the list of Zone resources available to the specified project.",
  96445. // "httpMethod": "GET",
  96446. // "id": "compute.zones.list",
  96447. // "parameterOrder": [
  96448. // "project"
  96449. // ],
  96450. // "parameters": {
  96451. // "filter": {
  96452. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96453. // "location": "query",
  96454. // "type": "string"
  96455. // },
  96456. // "maxResults": {
  96457. // "default": "500",
  96458. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96459. // "format": "uint32",
  96460. // "location": "query",
  96461. // "minimum": "0",
  96462. // "type": "integer"
  96463. // },
  96464. // "orderBy": {
  96465. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96466. // "location": "query",
  96467. // "type": "string"
  96468. // },
  96469. // "pageToken": {
  96470. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96471. // "location": "query",
  96472. // "type": "string"
  96473. // },
  96474. // "project": {
  96475. // "description": "Project ID for this request.",
  96476. // "location": "path",
  96477. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96478. // "required": true,
  96479. // "type": "string"
  96480. // }
  96481. // },
  96482. // "path": "{project}/zones",
  96483. // "response": {
  96484. // "$ref": "ZoneList"
  96485. // },
  96486. // "scopes": [
  96487. // "https://www.googleapis.com/auth/cloud-platform",
  96488. // "https://www.googleapis.com/auth/compute",
  96489. // "https://www.googleapis.com/auth/compute.readonly"
  96490. // ]
  96491. // }
  96492. }
  96493. // Pages invokes f for each page of results.
  96494. // A non-nil error returned from f will halt the iteration.
  96495. // The provided context supersedes any context provided to the Context method.
  96496. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  96497. c.ctx_ = ctx
  96498. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96499. for {
  96500. x, err := c.Do()
  96501. if err != nil {
  96502. return err
  96503. }
  96504. if err := f(x); err != nil {
  96505. return err
  96506. }
  96507. if x.NextPageToken == "" {
  96508. return nil
  96509. }
  96510. c.PageToken(x.NextPageToken)
  96511. }
  96512. }